aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-08-01 10:13:20 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-08-01 10:13:20 +0000
commit7cba04f6dedcf888170496bf8f1857c4069d1131 (patch)
treeaffaa99c83934efb6c95255ee6bf36973f5be860
parent660f11be541813be5f09fbaf44d8e7c6d5a5bbfe (diff)
downloadqemu-7cba04f6dedcf888170496bf8f1857c4069d1131.zip
qemu-7cba04f6dedcf888170496bf8f1857c4069d1131.tar.gz
qemu-7cba04f6dedcf888170496bf8f1857c4069d1131.tar.bz2
More NULL pointer fixes
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--bsd-user/bsdload.c2
-rw-r--r--bsd-user/elfload.c2
-rw-r--r--linux-user/elfload.c2
-rw-r--r--linux-user/linuxload.c2
-rw-r--r--qemu-char.c4
-rw-r--r--slirp/tcp_timer.c10
-rw-r--r--vnc_keysym.h2
7 files changed, 13 insertions, 11 deletions
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index 05fd20a..14a93bf 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -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;
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index ed25e85..678f3e6 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -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;
}
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 63d0ae4..a38167d 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -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;
}
diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
index 14c433e..4091bdc 100644
--- a/linux-user/linuxload.c
+++ b/linux-user/linuxload.c
@@ -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;
diff --git a/qemu-char.c b/qemu-char.c
index 2144d1a..be27994 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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);
diff --git a/slirp/tcp_timer.c b/slirp/tcp_timer.c
index 556e32e..6c5bb11 100644
--- a/slirp/tcp_timer.c
+++ b/slirp/tcp_timer.c
@@ -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);
diff --git a/vnc_keysym.h b/vnc_keysym.h
index 2d255c9..55cb87e 100644
--- a/vnc_keysym.h
+++ b/vnc_keysym.h
@@ -320,5 +320,5 @@ static const name2keysym_t name2keysym[]={
{"Katakana_Real", 0xff25},
{"Eisu_toggle", 0xff30},
-{0,0},
+{NULL,0},
};