Code

fix miscellaneous sparse warnings
authorMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 19:24:58 +0000 (21:24 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 19:24:58 +0000 (21:24 +0200)
Static variables, pointers vs integers, void function returning, ...

src/main.c
src/screen.c
src/str_pool.c
src/wreadln.c

index a33643d10e46b0cf44eed16bfdbde186e5183c00..02b1680dc7d08774cdb875897262bb31c08c03bb 100644 (file)
@@ -454,4 +454,6 @@ main(int argc, const char *argv[])
 
        exit_and_cleanup();
        ncu_deinit();
+
+       return 0;
 }
index 9c7ca50a58187c99a98d1e7b3062b0ac79694d69..526f091dd09df03aa0fa7bb42af3c35256b218da 100644 (file)
@@ -558,7 +558,7 @@ screen_update(mpdclient_t *c)
        static int dbupdate = -1;
 
        if( !screen.painted )
-               return screen_paint(c);
+               screen_paint(c);
 
        /* print a message if mpd status has changed */
        if (c->status != NULL) {
index 74839b59d453488cbffb6bad5bf1cfd3c596db3b..3313b3c50fd8e6834cf707010414511169bff089 100644 (file)
@@ -31,7 +31,7 @@ struct slot {
        char value[1];
 } __attribute__((packed));
 
-struct slot *slots[NUM_SLOTS];
+static struct slot *slots[NUM_SLOTS];
 
 static inline unsigned
 calc_hash(const char *p)
index dc1dfe86708f629d8eeb80bff240e03df6c20b86..cc703898bdeac1c8d72f2074490c187e63c85ccc 100644 (file)
@@ -334,7 +334,7 @@ _wreadln(WINDOW *w,
                        if (key >= 32) {
                                if (strlen (line + cursor)) { /* if the cursor is */
                                        /* not at the last pos */
-                                       gchar *tmp = 0;
+                                       gchar *tmp = NULL;
                                        gsize size = strlen(line + cursor) + 1;
 
                                        tmp = g_malloc0(size);