]> git.cworth.org Git - kub/commitdiff
Seg Fault bug and compiler warning fixes
authorKevin Worth <kworth@ibuntu.localdomain>
Tue, 13 Apr 2010 06:13:59 +0000 (02:13 -0400)
committerKevin Worth <kworth@ibuntu.localdomain>
Tue, 13 Apr 2010 06:13:59 +0000 (02:13 -0400)
kub.c

diff --git a/kub.c b/kub.c
index f76bb97a59238a0ebe7a4a43a9429b6b38827acd..4132bd3dee51e31aec356ca2c40d782c9e224e6f 100644 (file)
--- a/kub.c
+++ b/kub.c
@@ -228,17 +228,13 @@ static int tile_compare(const void *one, const void *two)
 {
     const tile_t *tile_one = one;
     const tile_t *tile_two = two;
-    return tile_one->number - tile_two->number;
+    return tile_one->number - tile_two->number;        //Sort lowest to highest
 }
 
-static int tile_compare_1(tile_t *tile_one, tile_t *tile_two)
+static int int_compare(const void *vx, const void *vy)
 {
-    return tile_one->number - tile_two->number;                //Sort lowest to highest
-}
-
-static int int_compare(int *x, int *y)
-{
-    return y - x;      //Sort highest to lowest
+    const int *x = vx, *y = vy;
+    return *y - *x;    //Sort highest to lowest
 }
 
 /*
@@ -841,7 +837,7 @@ static gboolean on_button_release_event (GtkWidget *widget, GdkEventButton *even
            game->board.num_groups++;
        }
        board_print(game);
-       printf("\nBut is the board valid?\t\t%s\n", board_valid(&game->board));
+       printf("\nBut is the board valid?\t\t%s\n", board_valid(&game->board) ? "yes" : "no");
     }    
     game->select_mode = 1;