[libgsystem] Fix signed/unsigned comparision warnings



commit f20dbcbd0d56ba62a636dc3769fa821ee4296b19
Author: Christian Persch <chpe gnome org>
Date:   Mon Oct 21 15:09:50 2013 +0200

    Fix signed/unsigned comparision warnings

 gsystem-console.c    |    2 +-
 gsystem-file-utils.c |    2 +-
 gsystem-subprocess.c |    6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gsystem-console.c b/gsystem-console.c
index 00bb94d..0b7d946 100644
--- a/gsystem-console.c
+++ b/gsystem-console.c
@@ -381,7 +381,7 @@ gs_console_begin_status_line (GSConsole     *console,
   /* Now we need to pad with spaces enough to overwrite our last line
    */
   if (console->last_line_written >= 0
-      && linelen < console->last_line_written)
+      && linelen < (gsize) console->last_line_written)
     {
       gsize towrite = console->last_line_written - linelen;
       const char c = ' ';
diff --git a/gsystem-file-utils.c b/gsystem-file-utils.c
index a07fad7..73d947f 100644
--- a/gsystem-file-utils.c
+++ b/gsystem-file-utils.c
@@ -477,7 +477,7 @@ gs_file_open_in_tmpdir_at (int                tmpdir_fd,
 {
   gboolean ret = FALSE;
   const int max_attempts = 128;
-  guint i;
+  int i;
   char *tmp_name = NULL;
   int fd;
 
diff --git a/gsystem-subprocess.c b/gsystem-subprocess.c
index a967896..655b1b8 100644
--- a/gsystem-subprocess.c
+++ b/gsystem-subprocess.c
@@ -292,7 +292,7 @@ static void
 child_setup (gpointer user_data)
 {
   ChildData *child_data = user_data;
-  gint i;
+  guint i;
   gint result;
 
   /* We're on the child side now.  "Rename" the file descriptors in
@@ -304,7 +304,7 @@ child_setup (gpointer user_data)
    */
   for (i = 0; i < 3; i++)
     {
-      if (child_data->fds[i] != -1 && child_data->fds[i] != i)
+      if (child_data->fds[i] != -1 && child_data->fds[i] != (int) i)
         {
           do
             result = dup2 (child_data->fds[i], i);
@@ -345,7 +345,7 @@ initable_init (GInitable     *initable,
   gint close_fds[3] = { -1, -1, -1 };
   GSpawnFlags spawn_flags = 0;
   gboolean success = FALSE;
-  gint i;
+  guint i;
 
   if (g_cancellable_set_error_if_cancelled (cancellable, error))
     return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]