Fix missing casts to match printf format specifier in test_atomic
authorIvan Maidanski <ivmai@mail.ru>
Fri, 13 Jun 2014 08:17:08 +0000 (12:17 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 13 Jun 2014 08:17:08 +0000 (12:17 +0400)
* tests/test_atomic.c (test_and_set_thr): Add missing casts to long
for locked_counter (which is unsigned long) to match printf format
specifier.

tests/test_atomic.c

index 86fede1..b063a92 100644 (file)
@@ -148,7 +148,7 @@ void * test_and_set_thr(void * id)
       if (locked_counter != 1)
         {
           fprintf(stderr, "Test and set failure 1, counter = %ld, id = %d\n",
-                  locked_counter, (int)(AO_PTRDIFF_T)id);
+                  (long)locked_counter, (int)(AO_PTRDIFF_T)id);
           abort();
         }
       locked_counter *= 2;
@@ -158,7 +158,7 @@ void * test_and_set_thr(void * id)
       if (locked_counter != 1)
         {
           fprintf(stderr, "Test and set failure 2, counter = %ld, id = %d\n",
-                  locked_counter, (int)(AO_PTRDIFF_T)id);
+                  (long)locked_counter, (int)(AO_PTRDIFF_T)id);
           abort();
         }
       --locked_counter;