[gnome-games] Fix a few compiler warnings



commit 7bf96663e154ffaf96b5cec58ba58f35522a8b14
Author: Christian Persch <chpe gnome org>
Date:   Thu Jun 25 19:41:33 2009 +0200

    Fix a few compiler warnings

 libgames-support/eggdesktopfile.c    |    2 ++
 libgames-support/eggsmclient-xsmp.c  |   12 ++++++------
 libgames-support/games-card-images.c |   10 ++++------
 libgames-support/games-runtime.c     |    2 +-
 libgames-support/games-scores.c      |    4 ++--
 5 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/libgames-support/eggdesktopfile.c b/libgames-support/eggdesktopfile.c
index ce0c6f3..4795ebe 100644
--- a/libgames-support/eggdesktopfile.c
+++ b/libgames-support/eggdesktopfile.c
@@ -1386,6 +1386,8 @@ egg_desktop_file_launch (EggDesktopFile *desktop_file,
       free_document_list (documents);
       break;
 
+    case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED:
+    case EGG_DESKTOP_FILE_TYPE_DIRECTORY:
     default:
       g_set_error (error, EGG_DESKTOP_FILE_ERROR,
 		   EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE,
diff --git a/libgames-support/eggsmclient-xsmp.c b/libgames-support/eggsmclient-xsmp.c
index 81af7d2..69f96f8 100644
--- a/libgames-support/eggsmclient-xsmp.c
+++ b/libgames-support/eggsmclient-xsmp.c
@@ -1087,13 +1087,13 @@ generate_command (char **argv, const char *client_id,
 
   if (client_id)
     {
-      g_ptr_array_add (cmd, "--sm-client-id");
+      g_ptr_array_add (cmd, (char *)"--sm-client-id");
       g_ptr_array_add (cmd, (char *)client_id);
     }
 
   if (state_file)
     {
-      g_ptr_array_add (cmd, "--sm-client-state-file");
+      g_ptr_array_add (cmd, (char *)"--sm-client-state-file");
       g_ptr_array_add (cmd, (char *)state_file);
     }
 
@@ -1176,7 +1176,7 @@ array_prop (const char *name, ...)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmLISTofARRAY8;
+  prop->type = (char *)SmLISTofARRAY8;
 
   vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue));
 
@@ -1210,7 +1210,7 @@ ptrarray_prop (const char *name, GPtrArray *values)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmLISTofARRAY8;
+  prop->type = (char *)SmLISTofARRAY8;
 
   vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue));
 
@@ -1240,7 +1240,7 @@ string_prop (const char *name, const char *value)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmARRAY8;
+  prop->type = (char *)SmARRAY8;
 
   prop->num_vals = 1;
   prop->vals = g_new (SmPropValue, 1);
@@ -1265,7 +1265,7 @@ card8_prop (const char *name, unsigned char value)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmCARD8;
+  prop->type = (char *)SmCARD8;
 
   prop->num_vals = 1;
   prop->vals = g_new (SmPropValue, 2);
diff --git a/libgames-support/games-card-images.c b/libgames-support/games-card-images.c
index cd0099c..734f8d0 100644
--- a/libgames-support/games-card-images.c
+++ b/libgames-support/games-card-images.c
@@ -383,7 +383,7 @@ games_card_images_set_cache_mode (GamesCardImages * images,
                                   GamesCardImagesCacheMode mode)
 {
   g_return_if_fail (GAMES_IS_CARD_IMAGES (images));
-  g_return_if_fail (mode >= 0 && mode < LAST_CACHE_MODE);
+  g_return_if_fail (mode < LAST_CACHE_MODE);
 
   if (mode == images->cache_mode)
     return;
@@ -529,8 +529,7 @@ games_card_images_get_card_pixbuf_by_id (GamesCardImages * images,
   guint idx;
 
   g_return_val_if_fail (GAMES_IS_CARD_IMAGES (images), NULL);
-  g_return_val_if_fail ((card_id >= 0)
-                        && (card_id < GAMES_CARDS_TOTAL), NULL);
+  g_return_val_if_fail ((card_id < GAMES_CARDS_TOTAL), NULL);
   g_return_val_if_fail (images->cache_mode == CACHE_PIXBUFS, NULL);
 
   LOG_CALL (images);
@@ -628,8 +627,7 @@ games_card_images_get_card_pixmap_by_id (GamesCardImages * images,
   guint idx;
 
   g_return_val_if_fail (GAMES_IS_CARD_IMAGES (images), NULL);
-  g_return_val_if_fail ((card_id >= 0)
-                        && (card_id < GAMES_CARDS_TOTAL), NULL);
+  g_return_val_if_fail ((card_id < GAMES_CARDS_TOTAL), NULL);
   g_return_val_if_fail (images->cache_mode == CACHE_PIXMAPS, NULL);
   g_return_val_if_fail (images->drawable != NULL, NULL);
 
@@ -900,7 +898,7 @@ GdkPixmap *
 games_card_images_get_card_pixmap_by_suit_and_rank (GamesCardImages * images,
                                                     guint suit, guint rank)
 {
-  g_return_val_if_fail (((suit >= GAMES_CARDS_CLUBS) &&
+  g_return_val_if_fail (( /* (suit >= GAMES_CARDS_CLUBS) && */
                          (suit <= GAMES_CARDS_SPADES)), NULL);
   g_return_val_if_fail (((rank >= GAMES_CARD_ACE) &&
                          (rank <= GAMES_CARD_ACE_HIGH)), NULL);
diff --git a/libgames-support/games-runtime.c b/libgames-support/games-runtime.c
index ec5a2c1..973caaf 100644
--- a/libgames-support/games-runtime.c
+++ b/libgames-support/games-runtime.c
@@ -198,7 +198,7 @@ games_runtime_get_directory (GamesRuntimeDirectory directory)
   char *path = NULL;
 
   g_return_val_if_fail (app_name != NULL, NULL);
-  g_return_val_if_fail (directory >= 0 && directory < GAMES_RUNTIME_LAST_DIRECTORY, NULL);
+  g_return_val_if_fail (directory < GAMES_RUNTIME_LAST_DIRECTORY, NULL);
 
   if (cached_directories[directory])
     return cached_directories[directory];
diff --git a/libgames-support/games-scores.c b/libgames-support/games-scores.c
index 3e5de92..a7a18ec 100644
--- a/libgames-support/games-scores.c
+++ b/libgames-support/games-scores.c
@@ -172,8 +172,8 @@ games_scores_new (const char *app_name,
   priv->style = style;
 
   /* Set up the anonymous category for use when no categories are specified. */
-  priv->dummycat.category.key = "";
-  priv->dummycat.category.name = "";
+  priv->dummycat.category.key = (char *) "";
+  priv->dummycat.category.name = (char *) "";
   priv->dummycat.backend = NULL;
 
   return self;



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