@@ -1112,20 +1112,22 @@ test_spinlock(void)
11121112 */
11131113#ifndef HAVE_SPINLOCKS
11141114{
1115+ uint32 i ;
1116+
11151117/*
11161118 * Initialize enough spinlocks to advance counter close to
11171119 * wraparound. It's too expensive to perform acquire/release for each,
11181120 * as those may be syscalls when the spinlock emulation is used (and
11191121 * even just atomic TAS would be expensive).
11201122 */
1121- for (uint32 i = 0 ;i < INT32_MAX - 100000 ;i ++ )
1123+ for (i = 0 ;i < INT32_MAX - 100000 ;i ++ )
11221124{
11231125slock_t lock ;
11241126
11251127SpinLockInit (& lock );
11261128}
11271129
1128- for (uint32 i = 0 ;i < 200000 ;i ++ )
1130+ for (i = 0 ;i < 200000 ;i ++ )
11291131{
11301132slock_t lock ;
11311133
@@ -1161,25 +1163,26 @@ test_atomic_spin_nest(void)
11611163#define NUM_TEST_ATOMICS (NUM_SPINLOCK_SEMAPHORES + NUM_ATOMICS_SEMAPHORES + 27)
11621164pg_atomic_uint32 atomics32 [NUM_TEST_ATOMICS ];
11631165pg_atomic_uint64 atomics64 [NUM_TEST_ATOMICS ];
1166+ int i ;
11641167
11651168SpinLockInit (& lock );
11661169
1167- for (int i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
1170+ for (i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
11681171{
11691172pg_atomic_init_u32 (& atomics32 [i ],0 );
11701173pg_atomic_init_u64 (& atomics64 [i ],0 );
11711174}
11721175
11731176/* just so it's not all zeroes */
1174- for (int i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
1177+ for (i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
11751178{
11761179EXPECT_EQ_U32 (pg_atomic_fetch_add_u32 (& atomics32 [i ],i ),0 );
11771180EXPECT_EQ_U64 (pg_atomic_fetch_add_u64 (& atomics64 [i ],i ),0 );
11781181}
11791182
11801183/* test whether we can do atomic op with lock held */
11811184SpinLockAcquire (& lock );
1182- for (int i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
1185+ for (i = 0 ;i < NUM_TEST_ATOMICS ;i ++ )
11831186{
11841187EXPECT_EQ_U32 (pg_atomic_fetch_sub_u32 (& atomics32 [i ],i ),i );
11851188EXPECT_EQ_U32 (pg_atomic_read_u32 (& atomics32 [i ]),0 );