gnome-games r8948 - trunk/gnomine



Author: thomashpa
Date: Sun Mar 29 23:42:30 2009
New Revision: 8948
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8948&view=rev

Log:
Fix build warnings with -Wextra. Converts a nonsense check for lower bound to higher bound check as bonus. Patch by Johannes Svensson. Fixes bug #577115

Modified:
   trunk/gnomine/minefield.c

Modified: trunk/gnomine/minefield.c
==============================================================================
--- trunk/gnomine/minefield.c	(original)
+++ trunk/gnomine/minefield.c	Sun Mar 29 23:42:30 2009
@@ -148,7 +148,7 @@
 static gint
 cell_idx (GtkMineField * mfield, guint x, guint y)
 {
-  if (x >= 0 && x < mfield->xsize && y >= 0 && y < mfield->ysize)
+  if (x < mfield->xsize && y < mfield->ysize)
     return cell_idx_no_checks (mfield, x, y);
 
   return -1;
@@ -946,7 +946,7 @@
   gint nx, ny, i, c2;
   guint lose = 0;
 
-  if (c < 0)			/* The release was outside the main area. */
+  if (c >= mfield->xsize * mfield->ysize) /* The release was outside the main area. */
     return;
 
   mfield->multi_mode = 0;



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