From: Matthias Kramm Date: Tue, 15 Jun 2010 00:58:26 +0000 (-0700) Subject: fixed some compiler warnings X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=d7367b3ec772ea163ebca6b7497639a0cb45c20c fixed some compiler warnings --- diff --git a/lib/as3/pool.c b/lib/as3/pool.c index 4cd4352..ce279a3 100644 --- a/lib/as3/pool.c +++ b/lib/as3/pool.c @@ -209,7 +209,7 @@ namespace_t* namespace_fromstring(const char*name) namespace_t*ns = malloc(sizeof(namespace_t)); memset(ns, 0, sizeof(namespace_t)); if(name[0] == '[') { - U8 access; + U8 access = 0; char*n = strdup(name); char*bracket = strchr(n, ']'); if(bracket) { diff --git a/lib/devices/render.c b/lib/devices/render.c index 250356a..8586cfa 100644 --- a/lib/devices/render.c +++ b/lib/devices/render.c @@ -608,7 +608,7 @@ void render_stroke(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxc static void draw_line(gfxdevice_t*dev, gfxline_t*line) { internal_t*i = (internal_t*)dev->internal; - double x,y; + double x=0,y=0; while(line) { diff --git a/lib/gfxfont.c b/lib/gfxfont.c index 549e50d..920796d 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -395,7 +395,7 @@ gfxfont_t* gfxfont_load(const char*id, const char*filename, unsigned int flags, } l = l->next; } - if(!ok && !name) { + if(!ok && !hasname) { gfxline_free(font->glyphs[font->num_glyphs].line); font->glyphs[font->num_glyphs].line = 0; font->glyphs[font->num_glyphs].advance = 0; diff --git a/lib/gfxpoly/convert.c b/lib/gfxpoly/convert.c index bb01942..9fbe40d 100644 --- a/lib/gfxpoly/convert.c +++ b/lib/gfxpoly/convert.c @@ -93,10 +93,10 @@ static void convert_file(const char*filename, polywriter_t*w, double gridsize) double x,y; char s[256]; if(sscanf(line, "%lf %lf %s", &x, &y, (char*)&s) == 3) { - if(s && !strcmp(s,"moveto")) { + if(!strcmp(s,"moveto")) { w->moveto(w, convert_coord(x,z), convert_coord(y,z)); count++; - } else if(s && !strcmp(s,"lineto")) { + } else if(!strcmp(s,"lineto")) { w->lineto(w, convert_coord(x,z), convert_coord(y,z)); count++; } else { diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 7160033..082eefa 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -205,8 +205,8 @@ static double get_spline_len(qspline_abc_t*s) void gfxtool_draw_dashed_line(gfxdrawer_t*d, gfxline_t*line, float*r, float phase) { double x=0,y=0; - double linepos,nextpos; - char on; + double linepos = 0,nextpos = 0; + char on = 0; int apos=0; if(line && line->type != gfx_moveTo) { @@ -911,7 +911,7 @@ gfxbbox_t* gfxline_isrectangle(gfxline_t*_l) gfxline_t*l = gfxline_clone(_l); gfxline_optimize(l); - double x1,x2,y1,y2; + double x1=0,x2=0,y1=0,y2=0; int xc=0,yc=0; char corners=0; diff --git a/src/png2swf.c b/src/png2swf.c index 8d1c476..83cc31d 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -454,7 +454,7 @@ void applyfilter1(int mode, U8*src, U8*old, U8*dest, int width) } -TAG* PNG2Image(TAG*t, U16 id, char*filename, int*width, int*height) +TAG* PNG2Image(TAG*t, U16 id, char*filename, unsigned*width, unsigned*height) { char tagid[4]; U8*data;