exit 1
fi
-WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings"
+WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings -Wformat"
if test "x$ENABLE_WARNINGS" '!=' "x";then
WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -Wno-write-strings -D_FORTIFY_SOURCE=2 "
fi
exit 1
fi
-WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings"
+WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings -Wformat"
if test "x$ENABLE_WARNINGS" '!=' "x";then
WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -Wno-write-strings -D_FORTIFY_SOURCE=2 "
fi
DEBUG printf("method %d) %s ", t, m->name);
DEBUG params_dump(stdout, m->parameters, m->optional_parameters);
- DEBUG printf("flags=%02x\n", t, m->flags);
+ DEBUG printf("flags=%02x\n", m->flags);
if(m->flags&0x08) {
m->optional_parameters = list_new();
void lookupswitch_print(lookupswitch_t*l)
{
- printf("default: %08x\n", l->def);
+ printf("default: %08x\n", (int)l->def);
code_list_t*t = l->targets;
while(t) {
- printf("target: %08x\n", t->code);
+ printf("target: %08x\n", (int)t->code);
t = t->next;
}
}
if(c->branch)
fprintf(fo, "->%d", c->branch->pos);
else
- fprintf(fo, "%08x", c->branch);
+ fprintf(fo, "%08x", (unsigned int)c->branch);
} else if(*p == 's') {
char*s = string_escape((string_t*)data);
fprintf(fo, "\"%s\"", s);
char*s = escape_string(ns->name);
char*string = (char*)malloc(strlen(access)+strlen(s)+7);
if(!s)
- sprintf(string, "[%s]NULL", access, s);
+ sprintf(string, "[%s]NULL", access);
else if(!*s)
- sprintf(string, "[%s]\"\"", access, s);
+ sprintf(string, "[%s]\"\"", access);
else
sprintf(string, "[%s]%s", access, s);
free(s);
{
int i = array_find(pool->x_ints, &x);
if(i<=0) {
- fprintf(stderr, "Couldn't find int \"%d\" in constant pool\n", x);
+ fprintf(stderr, "Couldn't find int \"%f\" in constant pool\n", x);
return 0;
}
return i;
int i = array_find(pool->x_namespaces, ns);
if(i<0) {
char*s = namespace_tostring(ns);
- fprintf(stderr, "Couldn't find namespace \"%s\" %08x in constant pool\n", s, ns);
+ fprintf(stderr, "Couldn't find namespace \"%s\" %08x in constant pool\n", s, (int)ns);
free(s);
return 0;
}
string_t s = string_new2(str);
int i = array_find(pool->x_strings, &s);
if(i<=0) {
- fprintf(stderr, "Couldn't find string \"%s\" in constant pool\n", s);
+ fprintf(stderr, "Couldn't find string \"%s\" in constant pool\n", str);
return 0;
}
return i;
int freq = (int)(ptroff_t)array_getvalue(pool->x_strings, t);
if(flags&1) fprintf(fo, "%5d %d) ", freq, t);
if(flags&1) fwrite(str.str, str.len, 1, fo);
- if(flags&1) fprintf(fo, "\n", t);
+ if(flags&1) fprintf(fo, "\n");
}
fprintf(fo, "%d namespaces\n", pool->x_namespaces->num);
for(t=1;t<pool->x_namespaces->num;t++) {
int fontid = (int)(ptroff_t)gfxfontlist_getuserdata(i->fontlist, font->id);
PDF_setfont(i->p, fontid, matrix->m00);
char name[32];
- sprintf(name, "%c\0", glyphnr+32);
+ sprintf(name, "%c", glyphnr+32);
if(fabs(matrix->tx - i->lastx) > 0.001 || matrix->ty != i->lasty) {
PDF_show_xy2(i->p, name, strlen(name), matrix->tx, matrix->ty);
int d= 256/depth;
char*str = (char*)malloc(img->width*img->height*4 + 500 + 16*depth*depth*depth);
char*p = str;
- p+= sprintf(p, "static char *noname[] = {\n\"%d %d 262144 3\",\n");
+ p+= sprintf(p, "static char *noname[] = {\n\"%d %d 262144 3\",\n", img->width, img->height);
int r,g,b;
for(r=0;r<depth;r++)
for(g=0;g<depth;g++)
return 0;
}
if(face->num_glyphs <= 0) {
- fprintf(stderr, "File %s contains %d glyphs\n", face->num_glyphs);
+ fprintf(stderr, "File %s contains %d glyphs\n", filename, (int)face->num_glyphs);
return 0;
}
error = FT_Load_Glyph(face, t, FT_LOAD_NO_BITMAP);
if(error) {
if(hasname)
- fprintf(stderr, "Warning: glyph %d/%d (unicode %d, name %s) has return code %d\n", t, face->num_glyphs, glyph2unicode[t], name, error);
+ fprintf(stderr, "Warning: glyph %d/%d (unicode %d, name %s) has return code %d\n", t, (int)face->num_glyphs, glyph2unicode[t], name, error);
else
- fprintf(stderr, "Warning: glyph %d/%d (unicode %d) has return code %d\n", t, face->num_glyphs, glyph2unicode[t], error);
+ fprintf(stderr, "Warning: glyph %d/%d (unicode %d) has return code %d\n", t, (int)face->num_glyphs, glyph2unicode[t], error);
omit = 2;
#if 0
if(!omit) {
error = FT_Get_Glyph(face->glyph, &glyph);
if(error) {
- fprintf(stderr, "Couldn't get glyph %d/%d, error:%d\n", t, face->num_glyphs, error);
+ fprintf(stderr, "Couldn't get glyph %d/%d, error:%d\n", t, (int)face->num_glyphs, error);
omit = 3;
}
}
break;
double x,y;
char s[256];
- if(sscanf(line, "%lf %lf %s", &x, &y, &s) == 3) {
+ if(sscanf(line, "%lf %lf %s", &x, &y, (char*)&s) == 3) {
if(s && !strcmp(s,"moveto")) {
w->moveto(w, convert_coord(x,z), convert_coord(y,z));
count++;
{
int s,t;
double g = poly->gridsize;
- fprintf(stderr, "polyon %08x (gridsize: %f)\n", poly, poly->gridsize);
+ fprintf(stderr, "polyon %08x (gridsize: %f)\n", (int)poly, poly->gridsize);
gfxpolystroke_t*stroke = poly->strokes;
for(;stroke;stroke=stroke->next) {
- fprintf(stderr, "%08x", stroke);
+ fprintf(stderr, "%08x", (int)stroke);
for(s=0;s<stroke->num_points-1;s++) {
point_t a = stroke->points[s];
point_t b = stroke->points[s+1];
}
if(fill.is_filled && lastx!=buf->width) {
/* we're bleeding, fill over padding, too. */
- fprintf(stderr, "Polygon %08x is bleeding in line %d\n", polygon, y);
+ fprintf(stderr, "Polygon %08x is bleeding in line %d\n", (int)polygon, y);
fill_bitwise(line, lastx, width8*8);
assert(line[width8-1]&0x01);
bleeding = 1;
void mem_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
struct jpeg_source_mgr* mgr = cinfo->src;
- printf("skip %d +%d\n", size - mgr->bytes_in_buffer, num_bytes);
+ printf("skip %d +%ld\n", size - mgr->bytes_in_buffer, num_bytes);
if(num_bytes<=0)
return;
mgr->next_input_byte += num_bytes;
FT_Set_Pixel_Sizes (face, 16*loadfont_scale*scale, 16*loadfont_scale*scale);
if(face->num_glyphs <= 0) {
- fprintf(stderr, "File %s contains %d glyphs\n", face->num_glyphs);
+ fprintf(stderr, "File %s contains %d glyphs\n", filename, (int)face->num_glyphs);
return 0;
}
layer_t*before=0, *self=0, *after=0;
if(DEBUG&2) {
- printf("[(%d,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1);
+ printf("[(%f,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1);
}
search_layer(state, p->depth, &before, &self, &after);
// used to be mktemp. This does remove the warnings, but
// It's not exactly an improvement.
#ifdef HAVE_LRAND48
- sprintf(ptr, "%s%s%08x%08x",dir,sep,lrand48(),lrand48());
+ sprintf(ptr, "%s%s%08x%08x",dir,sep,(unsigned int)lrand48(),(unsigned int)lrand48());
#else
# ifdef HAVE_RAND
sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand());
if(verbose) {
int t;
for(t=0;t<=statepos;t++) {
- printf("%08x ", states[t].state);
+ printf("%08x ", (unsigned int)states[t].state);
}
printf("\n");
}
+ // used to be mktemp. This does remove the warnings, but
+ // It's not exactly an improvement.
+#ifdef HAVE_LRAND48
-+ sprintf(ptr, "%s%s%08x%08x",dir,sep,lrand48(),lrand48());
++ sprintf(ptr, "%s%s%08x%08x",dir,sep,(unsigned int)lrand48(),(unsigned int)lrand48());
+#else
+# ifdef HAVE_RAND
+ sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand());
return 0;
}
if(a!=8 && (b==2 || b==6)) {
- printf("Bpp %d in mode %d not supported!\n", a);
+ printf("Bpp %d in mode %d not supported!\n", b, a);
return 0;
}
if(c!=0) {
}
if(t->rest) {
buffer[pos]=0;
- printf("%s%s %08x\n", buffer, t->rest, t->data);
+ printf("%s%s %08x\n", buffer, t->rest, (int)t->data);
}
}
dictentry_t*e = h->slots[t];
while(e) {
if(h->key_type!=&charptr_type) {
- fprintf(fi, "%s%08x=%08x\n", prefix, e->key, e->data);
+ fprintf(fi, "%s%08x=%08x\n", prefix, (int)e->key, (int)e->data);
} else {
- fprintf(fi, "%s%s=%08x\n", prefix, e->key, e->data);
+ fprintf(fi, "%s%s=%08x\n", prefix, (char*)e->key, (int)e->data);
}
e = e->next;
}
static void dumpmapentry(void*data, const void*key, void*value)
{
FILE*fi = (FILE*)data;
- fprintf(fi, "%s=%s\n", key, (char*)value);
+ fprintf(fi, "%s=%s\n", (char*)key, (char*)value);
}
void map_dump(map_t*map, FILE*fi, const char*prefix)
{
void map16_add_id(map16_t*map, int nr, void*id)
{
if(map->ids[nr])
- fprintf(stderr, "Warning: ID %d defined more than once\n");
+ fprintf(stderr, "Warning: ID %d defined more than once\n", nr);
map->ids[nr] = id;
}
void map16_remove_id(map16_t*map, int nr)
sprintf(s,"Content-type: application/x-shockwave-flash\n"
"Accept-Ranges: bytes\n"
- "Content-Length: %lu\n"
+ "Content-Length: %d\n"
"Expires: Thu, 13 Apr 2000 23:59:59 GMT\n"
"\n",len);
return 0;
}
if(block.size + 8 < filesize)
- fprintf(stderr, "wav_read: warning - more tags (%d extra bytes)\n",
- filesize - block.size - 8);
+ fprintf(stderr, "wav_read: warning - more tags (%lu extra bytes)\n", filesize - block.size - 8);
if(block.size == filesize)
/* some buggy software doesn't generate the right tag length */
block.size = filesize - 8;
if(block.size + 8 > filesize)
- fprintf(stderr, "wav_read: warning - short file (%d bytes missing)\n",
- block.size + 8 - filesize);
+ fprintf(stderr, "wav_read: warning - short file (%lu bytes missing)\n", block.size + 8 - filesize);
if(fread(b, 1, 4, fi) < 4)
{
fclose(fi);
void wav_print(struct WAV*wav)
{
- printf("tag:%04x channels:%d samples/sec:%d bytes/sec:%d align:%d bits/sample:%d size:%d\n",
+ printf("tag:%04x channels:%d samples/sec:%lu bytes/sec:%lu align:%d bits/sample:%d size:%d\n",
wav->tag, wav->channels, wav->sampsPerSec, wav->bytesPerSec,
wav->align, wav->bps, wav->size);
}
int i;
for (i = 0; i < global.nfiles; i++) {
if (VERBOSE(3))
- fprintf(stderr, "[%03i] %s (%i%%, 1/%i)\n", i,
+ fprintf(stderr, "[%03i] %s (%i%%)\n", i,
image[i].filename, image[i].quality);
t = MovieAddFrame(&swf, t, image[i].filename, image[i].quality,
image[i].width, image[i].height);
exit(1);
}
if(a!=8 && (b==2 || b==6)) {
- fprintf(stderr, "Bpp %d in mode %d not supported!\n", a);
+ fprintf(stderr, "Bpp %d in mode %d not supported!\n", b, a);
exit(1);
}
if(c!=0) {
}
if(!zimagedata || uncompress(imagedata, &imagedatalen, zimagedata, zimagedatalen) != Z_OK) {
- fprintf(stderr, "Couldn't uncompress IDAT chunk (%d bytes) in %s!\n", imagedatalen, filename);
+ fprintf(stderr, "Couldn't uncompress IDAT chunk (%lu bytes) in %s!\n", imagedatalen, filename);
if(zimagedata)
free(zimagedata);
return 0;
printf("-q , --quiet Omit normal log messages, only log errors\n");
printf("-C , --cgi For use as CGI- prepend http header, write to stdout\n");
printf("-V , --version Print version information and exit\n");
- printf("-s , --scale <percent> Scale image to <percent>% size.\n");
+ printf("-s , --scale <percent> Scale image to <percent>%% size.\n");
printf("\n");
}
return 1;
}
int len=strlen(str);
- U8 alpha = 255;
+ int alpha = 255;
if(strchr(str, '/')) {
len = strchr(str, '/')-str;
sscanf(str+len+1,"%02x", &alpha);
printf("-f , --frame The following identifier is a frame or framelabel, not an id or objectname\n");
printf("-x , --movex <xpos> x Adjust position of slave by <xpos> pixels\n");
printf("-y , --movey <ypos> y Adjust position of slave by <ypos> pixels\n");
- printf("-s , --scale <scale> Adjust size of slave by <scale> percent (e.g. 100% = original size)\n");
+ printf("-s , --scale <scale> Adjust size of slave by <scale> percent (e.g. 100%% = original size)\n");
printf("-r , --rate <fps> Set movie framerate to <fps> (frames/sec)\n");
printf("-X , --width <width> Force movie bbox width to <width> (default: use master width (not with -t))\n");
printf("-Y , --height <height> Force movie bbox height to <height> (default: use master height (not with -t))\n");
deblock = swf_GetBits(tag, 1);
if(deblock)
- printf(" deblock ", deblock);
+ printf(" deblock %d ", deblock);
quantizer = swf_GetBits(tag, 5);
printf(" quant: %d ", quantizer);
}
}
else {
int id = GET16(tag->data);
- fprintf(stderr, "Object %d is not a JPEG picture!\n",id, jpegtables);
+ fprintf(stderr, "Object %d is not a JPEG picture!\n", id);
exit(1);
}
}
samplerate = 44100;
else {
fprintf(stderr, "Invalid samplerate: %d\n", samplerate);
- fprintf(stderr, "Allowed values: 11025, 22050, 44100\n", samplerate);
+ fprintf(stderr, "Allowed values: 11025, 22050, 44100\n");
exit(1);
}
return 1;