Skip to content
Snippets Groups Projects
Commit d3583e11 authored by Justin Raymond's avatar Justin Raymond
Browse files

fix c99 mode

parent a0c76f7c
No related branches found
No related tags found
1 merge request!100implement bsearch
...@@ -10,7 +10,8 @@ int int_cmp(const void* a, const void* b) { ...@@ -10,7 +10,8 @@ int int_cmp(const void* a, const void* b) {
void* res = bsearch((const void*) &key, (void*) arr, len, sizeof(int), int_cmp); \ void* res = bsearch((const void*) &key, (void*) arr, len, sizeof(int), int_cmp); \
if (res != expect) { \ if (res != expect) { \
printf("FAIL bsearch for %d in [", key); \ printf("FAIL bsearch for %d in [", key); \
for (size_t i = 0; i < len; ++i) printf("%d,", arr[i]); \ size_t i = 0; \
for (; i < len; ++i) printf("%d,", arr[i]); \
printf("] expected %p but got %p\n", (void*) expect, res); \ printf("] expected %p but got %p\n", (void*) expect, res); \
return 1; \ return 1; \
} \ } \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment