Fix 32-bit build warnings (99.9% in printf)

This commit is contained in:
Vitaliy Filippov
2024-02-22 12:22:16 +03:00
parent b3c15db331
commit f20564b44b
62 changed files with 384 additions and 371 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ inline void* memalign_or_die(size_t alignment, size_t size)
void *buf = memalign(alignment, size);
if (!buf)
{
printf("Failed to allocate %lu bytes\n", size);
printf("Failed to allocate %zu bytes\n", size);
exit(1);
}
return buf;
@@ -22,7 +22,7 @@ inline void* malloc_or_die(size_t size)
void *buf = malloc(size);
if (!buf)
{
printf("Failed to allocate %lu bytes\n", size);
printf("Failed to allocate %zu bytes\n", size);
exit(1);
}
return buf;
@@ -33,7 +33,7 @@ inline void* realloc_or_die(void *ptr, size_t size)
void *buf = realloc(ptr, size);
if (!buf)
{
printf("Failed to allocate %lu bytes\n", size);
printf("Failed to allocate %zu bytes\n", size);
exit(1);
}
return buf;
@@ -44,7 +44,7 @@ inline void* calloc_or_die(size_t nmemb, size_t size)
void *buf = calloc(nmemb, size);
if (!buf)
{
printf("Failed to allocate %lu bytes\n", size * nmemb);
printf("Failed to allocate %zu bytes\n", size * nmemb);
exit(1);
}
return buf;