]> git.proxmox.com Git - qemu.git/commitdiff
More NULL pointer fixes
authorBlue Swirl <blauwirbel@gmail.com>
Sat, 1 Aug 2009 10:13:20 +0000 (10:13 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 28 Aug 2009 02:23:36 +0000 (21:23 -0500)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
bsd-user/bsdload.c
bsd-user/elfload.c
linux-user/elfload.c
linux-user/linuxload.c
qemu-char.c
slirp/tcp_timer.c
vnc_keysym.h

index 05fd20acd1678bf134b83f71e2c29e575cb68a39..14a93bf39bbce09362c6277e4bd9a6ac583e1efe 100644 (file)
@@ -163,7 +163,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
 
     bprm.p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int);
     for (i=0 ; i<MAX_ARG_PAGES ; i++)       /* clear page-table */
-            bprm.page[i] = 0;
+            bprm.page[i] = NULL;
     retval = open(filename, O_RDONLY);
     if (retval < 0)
         return retval;
index ed25e8519e300cacd3069085b82498766bf60778..678f3e6ad9895af068b85ed46bcb34c809c09141 100644 (file)
@@ -1014,7 +1014,7 @@ static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr)
     key.st_value = orig_addr;
 
     sym = bsearch(&key, syms, s->disas_num_syms, sizeof(*syms), symfind);
-    if (sym != 0) {
+    if (sym != NULL) {
         return s->disas_strtab + sym->st_name;
     }
 
index d31cca71d1add5ec740075a559b08d48a166a1a4..199e9d815ee07c58ddf3c90d66e222824bb6beeb 100644 (file)
@@ -1220,7 +1220,7 @@ static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr)
     key.st_value = orig_addr;
 
     sym = bsearch(&key, syms, s->disas_num_syms, sizeof(*syms), symfind);
-    if (sym != 0) {
+    if (sym != NULL) {
         return s->disas_strtab + sym->st_name;
     }
 
index 14c433ea236eee743b0578ea9b50fd2144f2db25..4091bdccccd873f946e9cd3649d3fdf51ed34513 100644 (file)
@@ -165,7 +165,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
 
     bprm->p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int);
     for (i=0 ; i<MAX_ARG_PAGES ; i++)       /* clear page-table */
-            bprm->page[i] = 0;
+            bprm->page[i] = NULL;
     retval = open(filename, O_RDONLY);
     if (retval < 0)
         return retval;
index 6e2cd315a5ac3dfac8288aa0e3a1ba4e486d83cb..a3ee43e914971ee9ebf66c6fe052fc7e2311e6ab 100644 (file)
@@ -1947,7 +1947,7 @@ static void unix_process_msgfd(CharDriverState *chr, struct msghdr *msg)
 static ssize_t tcp_chr_recv(CharDriverState *chr, char *buf, size_t len)
 {
     TCPCharDriver *s = chr->opaque;
-    struct msghdr msg = { 0, };
+    struct msghdr msg = { NULL, };
     struct iovec iov[1];
     union {
         struct cmsghdr cmsg;
@@ -2212,7 +2212,7 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i
     CharDriverState *chr;
 
     if (!strcmp(filename, "vc")) {
-        chr = text_console_init(0);
+        chr = text_console_init(NULL);
     } else
     if (strstart(filename, "vc:", &p)) {
         chr = text_console_init(p);
index 556e32eaddd892e12fe8c3b330a23c9959361380..6c5bb11cc39aeebe057b80848f216ce7e6864319 100644 (file)
@@ -74,13 +74,15 @@ tcp_slowtimo(Slirp *slirp)
         * Search through tcb's and update active timers.
         */
        ip = slirp->tcb.so_next;
-       if (ip == 0)
-          return;
+        if (ip == NULL) {
+            return;
+        }
        for (; ip != &slirp->tcb; ip = ipnxt) {
                ipnxt = ip->so_next;
                tp = sototcpcb(ip);
-               if (tp == 0)
-                       continue;
+                if (tp == NULL) {
+                        continue;
+                }
                for (i = 0; i < TCPT_NTIMERS; i++) {
                        if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
                                tcp_timers(tp,i);
index 2d255c96398607329bf17dba0c12da85bbbd3617..55cb87edecad7e14a6f51f6815d8eb1921f378ec 100644 (file)
@@ -320,5 +320,5 @@ static const name2keysym_t name2keysym[]={
 {"Katakana_Real", 0xff25},
 {"Eisu_toggle", 0xff30},
 
-{0,0},
+{NULL,0},
 };