[glib: 1/7] Fix signedness warnings in gio/gcredentials.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/7] Fix signedness warnings in gio/gcredentials.c
- Date: Tue, 12 Jan 2021 18:03:08 +0000 (UTC)
commit 6e3d30a105b88558e748f9177d8d7f254c02a39d
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Mon Nov 16 23:44:10 2020 +0100
Fix signedness warnings in gio/gcredentials.c
gio/gcredentials.c: In function ‘linux_ucred_check_valid’:
gio/gcredentials.c:317:22: error: comparison of integer expressions of different signedness: ‘uid_t’ {aka
‘unsigned int’} and ‘int’
317 | || native->uid == -1
| ^~
gio/gcredentials.c:318:22: error: comparison of integer expressions of different signedness: ‘gid_t’ {aka
‘unsigned int’} and ‘int’
318 | || native->gid == -1)
| ^~
gio/gcredentials.c: In function ‘g_credentials_set_unix_user’:
gio/gcredentials.c:639:29: error: comparison of integer expressions of different signedness: ‘uid_t’ {aka
‘unsigned int’} and ‘int’
639 | g_return_val_if_fail (uid != -1, FALSE);
| ^~
gio/gcredentials.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gio/gcredentials.c b/gio/gcredentials.c
index c5d3d46ac..ebbc2cc5b 100644
--- a/gio/gcredentials.c
+++ b/gio/gcredentials.c
@@ -314,8 +314,8 @@ linux_ucred_check_valid (struct ucred *native,
GError **error)
{
if (native->pid == 0
- || native->uid == -1
- || native->gid == -1)
+ || native->uid == (uid_t) -1
+ || native->gid == (gid_t) -1)
{
g_set_error_literal (error,
G_IO_ERROR,
@@ -636,7 +636,7 @@ g_credentials_set_unix_user (GCredentials *credentials,
gboolean ret = FALSE;
g_return_val_if_fail (G_IS_CREDENTIALS (credentials), FALSE);
- g_return_val_if_fail (uid != -1, FALSE);
+ g_return_val_if_fail (uid != (uid_t) -1, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
#if G_CREDENTIALS_USE_LINUX_UCRED
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]