]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename write variable to avoid a warning:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 30 Apr 2015 20:30:12 +0000 (20:30 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 30 Apr 2015 20:30:12 +0000 (20:30 +0000)
memrw.c:37: warning: declaration of ‘write’ shadows a global declaration
/usr/include/unistd.h:333: warning: shadowed declaration is here

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

perf/memrw.c

index c368f26f23840578f00fe3faa0b4c306ba5e27cf..c10c38481db58183b82ece01e01117416068313d 100644 (file)
@@ -34,20 +34,20 @@ static unsigned char **mb;
 static void *memrw_fn(void *v)
 {
    int loops, m, b;
-   int write;
+   int dowrite;
    int differs = 0;
    unsigned char prev = 0;
 
    for (loops = 0; loops < nr_loops; loops++) {
-      // printf("loop %d write %d\n", loops, write);
+      // printf("loop %d dowrite %d\n", loops, dowrite);
       // Note: in case of multiple threads, we will have
       // to add lock/unlock somewhere in the below, maybe to lock
       // the MB we are reading or writing.
       for (m = 0; m < nr_mb_ws; m++) {
          for (b = 0; b < 1024 * 1024; b++) {
-            write = b % 5 == 0;
+            dowrite = b % 5 == 0;
             // Do some write or read operations.
-            if (write) {
+            if (dowrite) {
                if (mb[m][b] < 255)
                   mb[m][b] += differs;
                else