use size_t in offset test to fix warning

pull/111/head
Daniel Micay 2020-06-17 16:26:01 -04:00
parent dcc80a01db
commit c9c7dca498
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
static unsigned size_classes[] = { static size_t size_classes[] = {
/* large */ 4 * 1024 * 1024, /* large */ 4 * 1024 * 1024,
/* 0 */ 0, /* 0 */ 0,
/* 16 */ 16, 32, 48, 64, 80, 96, 112, 128, /* 16 */ 16, 32, 48, 64, 80, 96, 112, 128,
@ -32,7 +32,7 @@ int main(void) {
void *p[N_SIZE_CLASSES]; void *p[N_SIZE_CLASSES];
for (unsigned i = 0; i < N_SIZE_CLASSES; i++) { for (unsigned i = 0; i < N_SIZE_CLASSES; i++) {
unsigned size = size_classes[i]; size_t size = size_classes[i];
p[i] = malloc(size); p[i] = malloc(size);
if (!p) { if (!p) {
return 1; return 1;