]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix order of % versus * in memalign2.c new checks introduced in 12642
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 15 Jun 2012 22:57:40 +0000 (22:57 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 15 Jun 2012 22:57:40 +0000 (22:57 +0000)
(spotted by Florian eagle eyes)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12643

memcheck/tests/memalign2.c

index bd478026f08bf2dfadb4d5dbfb1caebbe9adb677..b35a70eaaa0222f83a8fa050ae1f01c2077bbb85 100644 (file)
@@ -76,8 +76,8 @@ int main ( void )
    p = memalign(4096, 100);   assert(0 == (long)p % 4096);
    p = memalign(4097, 100);   assert(0 == (long)p % 8192);
 
-   p = memalign(4 * 1024 * 1024, 100);   assert(0 == (long)p % 4 * 1024 * 1024);
-   p = memalign(16 * 1024 * 1024, 100);   assert(0 == (long)p % 16 * 1024 * 1024);
+   p = memalign(4 * 1024 * 1024, 100);   assert(0 == (long)p % (4 * 1024 * 1024));
+   p = memalign(16 * 1024 * 1024, 100);   assert(0 == (long)p % (16 * 1024 * 1024));
 
 #  define PM(a,b,c) posix_memalign((void**)a, b, c)
 
@@ -98,9 +98,9 @@ int main ( void )
    res = PM(&p, 4097, 100);   assert(EINVAL == res);
 
    res = PM(&p, 4 * 1024 * 1024, 100);   assert(0 == res 
-                                                && 0 == (long)p % 4 * 1024 * 1024);
+                                                && 0 == (long)p % (4 * 1024 * 1024));
    res = PM(&p, 16 * 1024 * 1024, 100);   assert(0 == res 
-                                                && 0 == (long)p % 16 * 1024 * 1024);
+                                                && 0 == (long)p % (16 * 1024 * 1024));
 #  endif
    
    return 0;