diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-07 15:32:56 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-07 15:32:56 +0000 |
commit | 511d2b140f3ff2f80d14637cdc2f29743a2daa51 (patch) | |
tree | 6cf21d1c95846f1c86879c60dffbe6a3eaa8aa6d /block-vmdk.c | |
parent | c2764719914ff0c4d6c06adafea17629600f21ba (diff) |
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings:
* use NULL instead of plain 0
* rearrange header include order to avoid redefining types accidentally
* ANSIfy SLIRP
* avoid "restrict" keyword
* add static
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-vmdk.c')
-rw-r--r-- | block-vmdk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block-vmdk.c b/block-vmdk.c index 71d7504bda..d9e76d7f38 100644 --- a/block-vmdk.c +++ b/block-vmdk.c @@ -134,7 +134,7 @@ static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent) cid_str_size = sizeof("CID"); } - if ((p_name = strstr(desc,cid_str)) != 0) { + if ((p_name = strstr(desc,cid_str)) != NULL) { p_name += cid_str_size; sscanf(p_name,"%x",&cid); } @@ -154,7 +154,7 @@ static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid) tmp_str = strstr(desc,"parentCID"); pstrcpy(tmp_desc, sizeof(tmp_desc), tmp_str); - if ((p_name = strstr(desc,"CID")) != 0) { + if ((p_name = strstr(desc,"CID")) != NULL) { p_name += sizeof("CID"); snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid); pstrcat(desc, sizeof(desc), tmp_desc); @@ -239,7 +239,7 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) if (read(p_fd, p_desc, DESC_SIZE) != DESC_SIZE) goto fail; - if ((p_name = strstr(p_desc,"CID")) != 0) { + if ((p_name = strstr(p_desc,"CID")) != NULL) { p_name += sizeof("CID"); sscanf(p_name,"%x",&p_cid); } @@ -330,12 +330,12 @@ static int vmdk_parent_open(BlockDriverState *bs, const char * filename) if (bdrv_pread(s->hd, 0x200, desc, DESC_SIZE) != DESC_SIZE) return -1; - if ((p_name = strstr(desc,"parentFileNameHint")) != 0) { + if ((p_name = strstr(desc,"parentFileNameHint")) != NULL) { char *end_name; struct stat file_buf; p_name += sizeof("parentFileNameHint") + 1; - if ((end_name = strchr(p_name,'\"')) == 0) + if ((end_name = strchr(p_name,'\"')) == NULL) return -1; if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1) return -1; |