]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
compare: always use braces for for/if blocks
authorJustin Viiret <justin.viiret@intel.com>
Tue, 3 Nov 2015 05:19:47 +0000 (16:19 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 10 Nov 2015 03:36:38 +0000 (14:36 +1100)
src/util/compare.h

index b7237ec2c1b1659b7987ae2304847f669e5e97a0..11c01f08ed5bdfb3260a3d8ed983a8551d32645a 100644 (file)
@@ -98,18 +98,22 @@ u64a theirtoupper64(const u64a x) {
 static really_inline
 int cmpNocaseNaive(const u8 *p1, const u8 *p2, size_t len) {
     const u8 *pEnd = (const u8 *)p1 + len;
-    for (; p1 < pEnd; p1++, p2++)
-        if (mytolower(*p1) != mytolower(*p2))
+    for (; p1 < pEnd; p1++, p2++) {
+        if (mytolower(*p1) != mytolower(*p2)) {
             return 1;
+        }
+    }
     return 0;
 }
 
 static really_inline
 int cmpCaseNaive(const u8 *p1, const u8 *p2, size_t len) {
     const u8 *pEnd = (const u8 *)p1 + len;
-    for (; p1 < pEnd; p1++, p2++)
-        if (*p1 != *p2)
+    for (; p1 < pEnd; p1++, p2++) {
+        if (*p1 != *p2) {
             return 1;
+        }
+    }
     return 0;
 }