Răsfoiți Sursa

test62: fix signedness in comparison

When compiled with -Wextra, a warning concerning the comparison of
integers with different signs is caused in function
TrivialHash. Changing the type of the index variable i to size_t fixes
this.
Olaf Bergmann 5 ani în urmă
părinte
comite
575c590f4c
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      tests/test62.c

+ 1 - 1
tests/test62.c

@@ -8,7 +8,7 @@
 unsigned int TrivialHash(const char *s, size_t len)
 {
     unsigned int h = 0;
-    int i;
+    size_t i;
     for (i=0; i < len; ++i) {
         h += (unsigned char)s[i];
     }