OSDN Git Service

Remove >= asserts on unsigned inputs
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 5 Jul 2008 13:41:02 +0000 (13:41 +0000)
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 5 Jul 2008 13:41:02 +0000 (13:41 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4848 c046a42c-6fe2-441c-8c8c-71466251a162

block-vvfat.c

index 08d426b..9394fbd 100644 (file)
@@ -93,7 +93,6 @@ static inline void array_free(array_t* array)
 
 /* does not automatically grow */
 static inline void* array_get(array_t* array,unsigned int index) {
-    assert(index >= 0);
     assert(index < array->next);
     return array->pointer + index * array->item_size;
 }
@@ -195,7 +194,6 @@ static int array_remove(array_t* array,int index)
 static int array_index(array_t* array, void* pointer)
 {
     size_t offset = (char*)pointer - array->pointer;
-    assert(offset >= 0);
     assert((offset % array->item_size) == 0);
     assert(offset/array->item_size < array->next);
     return offset/array->item_size;
@@ -2238,7 +2236,6 @@ static int commit_one_file(BDRVVVFATState* s,
 
        assert((size - offset == 0 && fat_eof(s, c)) ||
                (size > offset && c >=2 && !fat_eof(s, c)));
-       assert(size >= 0);
 
        ret = vvfat_read(s->bs, cluster2sector(s, c),
            (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);