gnome-games r7191 - trunk/libgames-support



Author: chpe
Date: Sun Jan 13 22:08:16 2008
New Revision: 7191
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7191&view=rev

Log:
Use gdk_color_equal to compare colours instead of memcmp (which mysteriously
gives a 'Conditional jump or move depends on uninitialised value(s)' here).


Modified:
   trunk/libgames-support/games-card-images.c
   trunk/libgames-support/games-setgid-io.c

Modified: trunk/libgames-support/games-card-images.c
==============================================================================
--- trunk/libgames-support/games-card-images.c	(original)
+++ trunk/libgames-support/games-card-images.c	Sun Jan 13 22:08:16 2008
@@ -476,7 +476,7 @@
   g_return_if_fail (GAMES_IS_CARD_IMAGES (images));
   g_return_if_fail (color != NULL);
 
-  if (memcmp (&images->background_colour, color, sizeof (GdkColor)) == 0)
+  if (gdk_color_equal (&images->background_colour, color))
     return;
 
   images->background_colour = *color;
@@ -502,7 +502,7 @@
   g_return_if_fail (GAMES_IS_CARD_IMAGES (images));
   g_return_if_fail (color != NULL);
 
-  if (memcmp (&images->selection_colour, color, sizeof (GdkColor)) == 0)
+  if (gdk_color_equal (&images->selection_colour, color))
     return;
 
   images->selection_colour = *color;

Modified: trunk/libgames-support/games-setgid-io.c
==============================================================================
--- trunk/libgames-support/games-setgid-io.c	(original)
+++ trunk/libgames-support/games-setgid-io.c	Sun Jan 13 22:08:16 2008
@@ -100,7 +100,7 @@
 
 
 static gboolean
-write_n_bytes (int fd, const void *buffer, int n)
+write_n_bytes (int fd, const char *buffer, int n)
 {
   int totalcnt;
   int cnt;
@@ -117,7 +117,7 @@
 }
 
 static gboolean
-read_n_bytes (int fd, void *buffer, int n)
+read_n_bytes (int fd, char *buffer, int n)
 {
   int totalcnt;
   int cnt;
@@ -405,7 +405,7 @@
   write_int (setgid_io_outfd, length);
   write_n_bytes (setgid_io_outfd, filename, length);
 
-  read_n_bytes (setgid_io_infd, buffer, sizeof (struct stat));
+  read_n_bytes (setgid_io_infd, (char *) buffer, sizeof (struct stat));
   return read_int (setgid_io_infd);
 }
 
@@ -424,7 +424,7 @@
 
   result = stat (filename, &buffer);
 
-  write_n_bytes (outfd, &buffer, sizeof (struct stat));
+  write_n_bytes (outfd, (char *) &buffer, sizeof (struct stat));
   write_int (outfd, result);
 }
 



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