]> git.ozlabs.org Git - petitboot/commitdiff
Fix sparse warnings
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Mon, 18 Apr 2016 07:05:12 +0000 (17:05 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 20 Apr 2016 06:09:29 +0000 (16:09 +1000)
Fix some sparse warnings by using NULL instead of 0 and static-ifying a
variable not used outside its file.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/discover-server.c
ui/common/timer.c
ui/ncurses/generic-main.c
ui/twin/pbt-scr.c

index 68065895f4dc52b85ccb04633f87e7201398c950..5f6f4d5190422aa257db6f2f7cbbce6cf887e654 100644 (file)
@@ -286,7 +286,7 @@ static int discover_server_process_connection(void *arg)
        struct client *client;
 
        /* accept the incoming connection */
-       fd = accept(server->socket, NULL, 0);
+       fd = accept(server->socket, NULL, NULL);
        if (fd < 0) {
                pb_log("accept: %s\n", strerror(errno));
                return 0;
index 3d808987e3cc76d6f170406f50153089840f76a2..b0cae0dfd0e8c93b4b00f049918d372d216dc67a 100644 (file)
@@ -49,7 +49,7 @@ static int timer_cb(void *arg)
        struct ui_timer *timer = arg;
 
        timer->handle_timeout(timer);
-       timer->waiter = 0;
+       timer->waiter = NULL;
        return 0;
 }
 
index 669053c52aeb4f31f56a05897e26973245fce46c..27744d44e2efa8dce66936a34c05c9f61da0a0ee 100644 (file)
@@ -149,7 +149,7 @@ static char *default_log_filename(void)
        return name;
 }
 
-struct cui *cui;
+static struct cui *cui;
 
 /*
  * struct pb_cui - Main cui program instance.
index b774f194693932572f7d1e23db9ebc7cb306f05e..e10cab10e9c9b817d8ae06a5c6a9da27b6c8fac7 100644 (file)
@@ -402,8 +402,8 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx,
 #if !defined(HAVE_LIBTWIN_TWIN_X11_H)
                assert(0);
 #else
-               scr->twin_ctx.x11 = twin_x11_create_ext(XOpenDisplay(0), width,
-                       height, 0);
+               scr->twin_ctx.x11 = twin_x11_create_ext(XOpenDisplay(NULL),
+                       width, height, 0);
 
                if (!scr->twin_ctx.x11) {
                        pb_log("%s: twin_x11_create_ext failed.\n", __func__);