util/hash: Silence comparison between signed and unsigned integer warnings in tests
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 10 Feb 2015 16:05:12 +0000 (08:05 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 17 Feb 2015 20:29:58 +0000 (12:29 -0800)
delete_management.c:56:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size; i++) {
                  ^
delete_management.c:69:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = size - 100; i < size; i++) {
                           ^
delete_management.c:79:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       assert(key_value(entry->key) >= size - 100 &&
                               ^
delete_management.c:79:70: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       assert(key_value(entry->key) >= size - 100 &&
                                                                      ^
insert_many.c:56:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size; i++) {
                  ^
insert_many.c:62:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size; i++) {
                  ^
insert_many.c:67:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    assert(ht->entries == size);
                  ^
random_entry.c:62:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size; i++) {
                  ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/util/tests/hash_table/delete_management.c
src/util/tests/hash_table/insert_many.c
src/util/tests/hash_table/random_entry.c

index 1adddc9f82faef8f219cc07262ccd72d4a2b932a..127d81b3ca9329ffde51e47936bfc5de8964c63c 100644 (file)
@@ -47,7 +47,7 @@ main(int argc, char **argv)
 {
    struct hash_table *ht;
    struct hash_entry *entry;
-   int size = 10000;
+   unsigned size = 10000;
    uint32_t keys[size];
    uint32_t i;
 
index f2497e06f78f786ae950b3bb40c109e03f4a6cf4..b07e40842bfacd4c8cc29048bad6497b7644143d 100644 (file)
@@ -47,7 +47,7 @@ main(int argc, char **argv)
 {
    struct hash_table *ht;
    struct hash_entry *entry;
-   int size = 10000;
+   unsigned size = 10000;
    uint32_t keys[size];
    uint32_t i;
 
index d3034dfc3b9c20429dbb0cc6163b661817fcd834..d1bc44aeb306feba7307f06629f5d8906344a314 100644 (file)
@@ -53,7 +53,7 @@ main(int argc, char **argv)
 {
    struct hash_table *ht;
    struct hash_entry *entry;
-   int size = 10000;
+   unsigned size = 10000;
    uint32_t keys[size];
    uint32_t i, random_value;