ttf2png: ttf2png.c
- gcc -Wall -Wextra -Werror -std=c89 -pedantic $^ -o $@ $(shell freetype-config --cflags --libs) $(shell pkg-config --cflags --libs libpng12)
+ gcc -Wall -Wextra -Werror -std=c89 -pedantic -O2 $^ -o $@ $(shell freetype-config --cflags --libs) $(shell pkg-config --cflags --libs libpng12)
VER=0.3
a += c;
if(a<c)
{
- fprintf(stderr, "Cannot allocate %d kbytes of memory for image\n", c/1024*b);
+ fprintf(stderr, "Cannot allocate %lu kbytes of memory for image\n", (unsigned long)(c/1024*b));
return NULL;
}
b /= 2;
}
ptr = malloc(a);
if(!ptr)
- fprintf(stderr, "Cannot allocate %d kbytes of memory for image\n", a/1024*b);
+ fprintf(stderr, "Cannot allocate %lu kbytes of memory for image\n", (unsigned long)(a/1024*b));
return ptr;
}
png_info *pngi;
png_byte **rows;
unsigned i;
- png_byte *data2;
+ png_byte *data2 = 0;
int color;
if(!strcmp(fn, "-"))