]> granicus.if.org Git - gc/commitdiff
Workaround 'local t shadows outer var' cppcheck warning in disclaim_bench
authorIvan Maidanski <ivmai@mail.ru>
Tue, 15 Jan 2019 20:36:55 +0000 (23:36 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 15 Jan 2019 20:36:55 +0000 (23:36 +0300)
(fix of commit 4880d09f6)

Issue #258 (bdwgc).

* include/private/gc_priv.h [!NO_CLOCK && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (GET_TIME): Rename t local variable to tc.

include/private/gc_priv.h

index 95b4eb34c5f3bb5c58db09ab7113aa113bee3d41..ca3e0411a1314080d9cf318d7ea2b06c917ed992 100644 (file)
@@ -458,11 +458,11 @@ EXTERN_C_END
 #   define CLOCK_TYPE ULONGLONG
 #   define GET_TIME(x) \
                 do { \
-                  LARGE_INTEGER freq, t; \
+                  LARGE_INTEGER freq, tc; \
                   if (!QueryPerformanceFrequency(&freq) \
-                      || !QueryPerformanceCounter(&t)) \
+                      || !QueryPerformanceCounter(&tc)) \
                     ABORT("QueryPerformanceCounter requires WinXP+"); \
-                  x = (CLOCK_TYPE)((double)t.QuadPart/freq.QuadPart * 1e9); \
+                  x = (CLOCK_TYPE)((double)tc.QuadPart/freq.QuadPart * 1e9); \
                 } while (0)
                 /* TODO: Call QueryPerformanceFrequency once at GC init. */
 #   define MS_TIME_DIFF(a, b) ((unsigned long)(((a) - (b)) / 1000000UL))