aboutsummaryrefslogtreecommitdiff
path: root/block-vvfat.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-07 15:32:56 +0000
commit511d2b140f3ff2f80d14637cdc2f29743a2daa51 (patch)
tree6cf21d1c95846f1c86879c60dffbe6a3eaa8aa6d /block-vvfat.c
parentc2764719914ff0c4d6c06adafea17629600f21ba (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-vvfat.c')
-rw-r--r--block-vvfat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/block-vvfat.c b/block-vvfat.c
index 623ba986a6..a2d37b9ec5 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -78,7 +78,7 @@ typedef struct array_t {
static inline void array_init(array_t* array,unsigned int item_size)
{
- array->pointer=0;
+ array->pointer = NULL;
array->size=0;
array->next=0;
array->item_size=item_size;
@@ -129,7 +129,7 @@ static inline void* array_insert(array_t* array,unsigned int index,unsigned int
int increment=count*array->item_size;
array->pointer=qemu_realloc(array->pointer,array->size+increment);
if(!array->pointer)
- return 0;
+ return NULL;
array->size+=increment;
}
memmove(array->pointer+(index+count)*array->item_size,
@@ -604,8 +604,8 @@ static inline direntry_t* create_short_and_long_name(BDRVVVFATState* s,
unsigned int directory_start, const char* filename, int is_dot)
{
int i,j,long_index=s->directory.next;
- direntry_t* entry=0;
- direntry_t* entry_long=0;
+ direntry_t* entry = NULL;
+ direntry_t* entry_long = NULL;
if(is_dot) {
entry=array_get_next(&(s->directory));
@@ -696,7 +696,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
int first_cluster = mapping->begin;
int parent_index = mapping->info.dir.parent_mapping_index;
mapping_t* parent_mapping = (mapping_t*)
- (parent_index >= 0 ? array_get(&(s->mapping), parent_index) : 0);
+ (parent_index >= 0 ? array_get(&(s->mapping), parent_index) : NULL);
int first_cluster_of_parent = parent_mapping ? parent_mapping->begin : -1;
DIR* dir=opendir(dirname);
@@ -1125,10 +1125,10 @@ static inline mapping_t* find_mapping_for_cluster(BDRVVVFATState* s,int cluster_
int index=find_mapping_for_cluster_aux(s,cluster_num,0,s->mapping.next);
mapping_t* mapping;
if(index>=s->mapping.next)
- return 0;
+ return NULL;
mapping=array_get(&(s->mapping),index);
if(mapping->begin>cluster_num)
- return 0;
+ return NULL;
assert(mapping->begin<=cluster_num && mapping->end>cluster_num);
return mapping;
}