Skip to content

Commit 1f1f404

Browse files
committed
C++-ize
1 parent 0584edf commit 1f1f404

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler-rt/test/asan/TestCases/fakestack_alignment.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void *Thread(void *unused) {
4040
if (alignment != 0)
4141
misaligned = true;
4242

43-
return NULL;
43+
return nullptr;
4444
}
4545

4646
int main(int argc, char **argv) {
@@ -50,14 +50,14 @@ int main(int argc, char **argv) {
5050
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE);
5151
#endif
5252

53-
pthread_t t[THREAD_COUNT];
54-
for (int i = 0; i < THREAD_COUNT; i++)
55-
pthread_create(&t[i], &attr, Thread, 0);
53+
pthread_t threads[THREAD_COUNT];
54+
for (pthread_t& t : threads)
55+
pthread_create(&t, &attr, Thread, 0);
5656

5757
pthread_attr_destroy(&attr);
5858

59-
for (int i = 0; i < THREAD_COUNT; i++)
60-
pthread_join(t[i], 0);
59+
for (pthread_t& t : threads)
60+
pthread_join(t, 0);
6161

6262
if (misaligned) {
6363
printf("Test failed: not perfectly aligned\n");

0 commit comments

Comments
 (0)