]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
tsan_unittest.cpp does now compile cleanly even with -Wshadown enabled.
authorBart Van Assche <bvanassche@acm.org>
Thu, 4 Jun 2009 09:11:28 +0000 (09:11 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 4 Jun 2009 09:11:28 +0000 (09:11 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10241

drd/tests/Makefile.am
drd/tests/tsan_unittest.cpp

index ceaec5413be76aa9af8673dd5d8e4688afba5010..d4ffdadffca4d917bda9f73a07b0ecf375a7758b 100644 (file)
@@ -293,8 +293,7 @@ new_delete_SOURCES          = new_delete.cpp
 
 tsan_unittest_SOURCES       = tsan_unittest.cpp
 tsan_unittest_CXXFLAGS      = $(AM_CXXFLAGS) \
-                       -DTHREAD_WRAPPERS='"tsan_thread_wrappers_pthread.h"' \
-                       -Wno-sign-compare -Wno-shadow
+                       -DTHREAD_WRAPPERS='"tsan_thread_wrappers_pthread.h"'
 
 if HAVE_BOOST_1_35
 boost_thread_SOURCES        = boost_thread.cpp
index c3d4ec47912d82dd0e175fea7eb23d6789a8e16a..dd42cd8e58b181f96d4147df029ee4b1e00e2291 100644 (file)
@@ -1691,7 +1691,7 @@ void Run() {
 
   std::vector<MyThread*> vec(Nlog);
 
-  for (int i = 0; i < N_iter; i++) {
+  for (int j = 0; j < N_iter; j++) {
     // Create and start Nlog threads
     for (int i = 0; i < Nlog; i++) {
       vec[i] = new MyThread(Worker);
@@ -5413,11 +5413,11 @@ void Run() {
 
   // do few more random publishes.
   for (int i = 0; i < 20; i++) {
-    int beg = rand() % N;
-    int size = (rand() % (N - beg)) + 1;
+    const int begin = rand() % N;
+    const int size = (rand() % (N - begin)) + 1;
     CHECK(size > 0);
-    CHECK(beg + size <= N);
-    PublishRange(beg, beg + size);
+    CHECK(begin + size <= N);
+    PublishRange(begin, begin + size);
   }
 
   printf("GLOB = %d\n", (int)GLOB[0]);