Commit 295abf3616506e6e121d86e2d1a4b4ef8c9dd632
1 parent
db8baf14
Remove >= asserts on unsigned inputs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4848 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
0 additions
and
3 deletions
block-vvfat.c
| @@ -93,7 +93,6 @@ static inline void array_free(array_t* array) | @@ -93,7 +93,6 @@ static inline void array_free(array_t* array) | ||
| 93 | 93 | ||
| 94 | /* does not automatically grow */ | 94 | /* does not automatically grow */ |
| 95 | static inline void* array_get(array_t* array,unsigned int index) { | 95 | static inline void* array_get(array_t* array,unsigned int index) { |
| 96 | - assert(index >= 0); | ||
| 97 | assert(index < array->next); | 96 | assert(index < array->next); |
| 98 | return array->pointer + index * array->item_size; | 97 | return array->pointer + index * array->item_size; |
| 99 | } | 98 | } |
| @@ -195,7 +194,6 @@ static int array_remove(array_t* array,int index) | @@ -195,7 +194,6 @@ static int array_remove(array_t* array,int index) | ||
| 195 | static int array_index(array_t* array, void* pointer) | 194 | static int array_index(array_t* array, void* pointer) |
| 196 | { | 195 | { |
| 197 | size_t offset = (char*)pointer - array->pointer; | 196 | size_t offset = (char*)pointer - array->pointer; |
| 198 | - assert(offset >= 0); | ||
| 199 | assert((offset % array->item_size) == 0); | 197 | assert((offset % array->item_size) == 0); |
| 200 | assert(offset/array->item_size < array->next); | 198 | assert(offset/array->item_size < array->next); |
| 201 | return offset/array->item_size; | 199 | return offset/array->item_size; |
| @@ -2238,7 +2236,6 @@ static int commit_one_file(BDRVVVFATState* s, | @@ -2238,7 +2236,6 @@ static int commit_one_file(BDRVVVFATState* s, | ||
| 2238 | 2236 | ||
| 2239 | assert((size - offset == 0 && fat_eof(s, c)) || | 2237 | assert((size - offset == 0 && fat_eof(s, c)) || |
| 2240 | (size > offset && c >=2 && !fat_eof(s, c))); | 2238 | (size > offset && c >=2 && !fat_eof(s, c))); |
| 2241 | - assert(size >= 0); | ||
| 2242 | 2239 | ||
| 2243 | ret = vvfat_read(s->bs, cluster2sector(s, c), | 2240 | ret = vvfat_read(s->bs, cluster2sector(s, c), |
| 2244 | (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); | 2241 | (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); |