Skip to content

Commit 4887df1

Browse files
authoredApr 12, 2017
Merge pull request swiftlang#237 from compnerd/size_t
tests: adjust printf for size types
2 parents eea0667 + f6af386 commit 4887df1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎tests/dispatch_cascade.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ histogram(void)
7979
}
8080
}
8181

82-
printf("maxcount = %ld\n", maxcount);
82+
printf("maxcount = %zd\n", maxcount);
8383

8484
size_t x,y;
8585
for (y = 20; y > 0; --y) {

‎tests/dispatch_io_net.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ main(int argc, char** argv)
277277
// convenience method handlers should only be called once
278278
if (remaining) {
279279
fprintf(stderr, "Server-dispatch_write() incomplete .. "
280-
"%lu bytes\n", dispatch_data_get_size(remaining));
280+
"%zu bytes\n", dispatch_data_get_size(remaining));
281281
close(read_fd);
282282
close(clientfd);
283283
close(sockfd);

‎tests/dispatch_starfish.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ collect(void *context __attribute__((unused)))
6868
math = delta;
6969
math /= COUNT * COUNT * 2ul + COUNT * 2ul;
7070

71-
printf("lap: %ld\n", lap_count_down);
71+
printf("lap: %zd\n", lap_count_down);
7272
printf("count: %lu\n", COUNT);
7373
printf("delta: %lu ns\n", delta);
7474
printf("math: %Lf ns / lap\n", math);
@@ -144,7 +144,7 @@ do_test(void)
144144
start = mach_absolute_time();
145145

146146
for (i = 0; i < COUNT; i++) {
147-
snprintf(buf, sizeof(buf), "com.example.starfish-node#%ld", i);
147+
snprintf(buf, sizeof(buf), "com.example.starfish-node#%zd", i);
148148
queues[i] = dispatch_queue_create(buf, NULL);
149149
dispatch_suspend(queues[i]);
150150
dispatch_set_target_queue(queues[i], soup);

0 commit comments

Comments
 (0)