diff -ru libwmf-0.2.8.3.orig/src/convert/wmf2fig.c libwmf-0.2.8.3/src/convert/wmf2fig.c --- libwmf-0.2.8.3.orig/src/convert/wmf2fig.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/convert/wmf2fig.c 2004-09-01 09:38:42.000000000 +0100 @@ -74,14 +74,16 @@ int wmf2fig_draw (PlotData* pdata) { int status = 0; +#if 0 unsigned int wmf_width; unsigned int wmf_height; unsigned int page_width; unsigned int page_height; +#endif unsigned long flags; - +#if 0 int page_margin; float def_width; @@ -89,7 +91,7 @@ float ratio_wmf; float ratio_page; - +#endif static char* Default_Creator = "wmf2fig"; ImageContext IC; diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd.c libwmf-0.2.8.3/src/extra/gd/gd.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd.c 2004-09-01 10:42:04.198706861 +0100 @@ -308,7 +308,7 @@ return diff; } - +#if 0 /* * This is not actually used, but is here for completeness, in case someone wants to * use the HWB stuff for anything else... @@ -353,6 +353,7 @@ return RGB; } +#endif int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b) @@ -676,6 +677,22 @@ } } +int +gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) +{ + int p = gdImageGetPixel (im, x, y); + if (!im->trueColor) + { + return gdTrueColorAlpha (im->red[p], im->green[p], im->blue[p], + (im->transparent == p) ? gdAlphaTransparent : + gdAlphaOpaque); + } + else + { + return p; + } +} + static void gdImageBrushApply (gdImagePtr im, int x, int y) { @@ -753,7 +770,7 @@ gdImageTileApply (gdImagePtr im, int x, int y) { int srcx, srcy; - int p; + int p=0; if (!im->tile) { return; @@ -811,22 +828,6 @@ } } -int -gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) -{ - int p = gdImageGetPixel (im, x, y); - if (!im->trueColor) - { - return gdTrueColorAlpha (im->red[p], im->green[p], im->blue[p], - (im->transparent == p) ? gdAlphaTransparent : - gdAlphaOpaque); - } - else - { - return p; - } -} - /* Bresenham as presented in Foley & Van Dam */ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) @@ -986,7 +987,7 @@ int dashStep = 0; int on = 1; int wid; - int w, wstart, vert; + int vert; int thick = im->thick; dx = abs (x2 - x1); @@ -1316,7 +1317,7 @@ gdPoint pts[3]; int i; int lx = 0, ly = 0; - int fx, fy; + int fx=0, fy=0; int w2, h2; w2 = w / 2; h2 = h / 2; @@ -1898,7 +1899,7 @@ tox = dstX; for (x = srcX; (x < (srcX + srcW)); x++) { - int nc; + int nc=0; int mapTo; if (!stx[x - srcX]) { @@ -1906,7 +1907,6 @@ } if (dst->trueColor) { - int d; mapTo = gdImageGetTrueColorPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == mapTo) @@ -1986,7 +1986,6 @@ int srcW, int srcH) { int x, y; - float sx, sy; if (!dst->trueColor) { gdImageCopyResized ( @@ -1998,7 +1997,6 @@ { for (x = dstX; (x < dstX + dstW); x++) { - int pd = gdImageGetPixel (dst, x, y); float sy1, sy2, sx1, sx2; float sx, sy; float spixels = 0; diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gdft.c libwmf-0.2.8.3/src/extra/gd/gdft.c --- libwmf-0.2.8.3.orig/src/extra/gd/gdft.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gdft.c 2004-09-01 10:30:18.681451582 +0100 @@ -25,7 +25,7 @@ gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string) { - gdImageStringFT (im, brect, fg, fontlist, ptsize, + return gdImageStringFT (im, brect, fg, fontlist, ptsize, angle, x, y, string); } @@ -331,7 +331,7 @@ int n; int font_found = 0; unsigned short platform, encoding; - char *fontsearchpath, *fontpath, *fontlist; + char *fontsearchpath, *fontlist; char *fullname = NULL; char *name, *path, *dir; char *strtok_ptr; @@ -536,8 +536,8 @@ /* static */ char * gdft_draw_bitmap (gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y) { - unsigned char *pixel; - int *tpixel; + unsigned char *pixel = 0; + int *tpixel = 0; int x, y, row, col, pc; tweencolor_t *tc_elem; @@ -643,6 +643,14 @@ return (char *) NULL; } +int +gdroundupdown (FT_F26Dot6 v1, int updown) +{ + return (!updown) + ? (v1 < 0 ? ((v1 - 63) >> 6) : v1 >> 6) + : (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6); +} + extern int any2eucjp (char *, char *, unsigned int); /********************************************************************/ @@ -720,7 +728,7 @@ if (font->have_char_map_sjis) { #endif - if (tmpstr = (char *) gdMalloc (BUFSIZ)) + if ((tmpstr = (char *) gdMalloc (BUFSIZ))) { any2eucjp (tmpstr, string, BUFSIZ); next = tmpstr; @@ -925,12 +933,4 @@ return (char *) NULL; } -int -gdroundupdown (FT_F26Dot6 v1, int updown) -{ - return (!updown) - ? (v1 < 0 ? ((v1 - 63) >> 6) : v1 >> 6) - : (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6); -} - #endif /* HAVE_LIBFREETYPE */ diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd_gd2.c libwmf-0.2.8.3/src/extra/gd/gd_gd2.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd_gd2.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd_gd2.c 2004-09-01 10:37:08.564791089 +0100 @@ -262,13 +262,13 @@ int i; int ncx, ncy, nc, cs, cx, cy; int x, y, ylo, yhi, xlo, xhi; - int ch, vers, fmt; + int vers, fmt; t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */ unsigned char *chunkBuf = NULL; /* So we can gdFree it with impunity. */ int chunkNum = 0; - int chunkMax; + int chunkMax=0; uLongf chunkLen; - int chunkPos; + int chunkPos=0; int compMax; int bytesPerPixel; char *compBuf = NULL; /* So we can gdFree it with impunity. */ @@ -450,9 +450,9 @@ t_chunk_info *chunkIdx = NULL; char *chunkBuf = NULL; int chunkNum; - int chunkMax; + int chunkMax=0; uLongf chunkLen; - int chunkPos; + int chunkPos=0; int compMax; char *compBuf = NULL; @@ -635,10 +635,11 @@ { if (im->trueColor) { - ch = chunkBuf[chunkPos++] << 24 + - chunkBuf[chunkPos++] << 16 + - chunkBuf[chunkPos++] << 8 + - chunkBuf[chunkPos++]; + ch = (chunkBuf[chunkPos] << 24) + + (chunkBuf[chunkPos+1] << 16) + + (chunkBuf[chunkPos+2] << 8) + + (chunkBuf[chunkPos+3]); + chunkPos+=4; } else { @@ -710,12 +711,12 @@ char *chunkData = NULL; /* So we can gdFree it with impunity. */ char *compData = NULL; /* So we can gdFree it with impunity. */ uLongf compLen; - int idxPos; + int idxPos=0; int idxSize; t_chunk_info *chunkIdx = NULL; int posSave; int bytesPerPixel = im->trueColor ? 4 : 1; - int compMax; + int compMax=0; /*printf("Trying to write GD2 file\n"); */ diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd_gd.c libwmf-0.2.8.3/src/extra/gd/gd_gd.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd_gd.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd_gd.c 2004-09-01 10:37:59.469608715 +0100 @@ -195,7 +195,6 @@ _gdPutColors (gdImagePtr im, gdIOCtx * out) { int i; - int trans; gdPutC (im->trueColor, out); if (!im->trueColor) diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gdhelpers.c libwmf-0.2.8.3/src/extra/gd/gdhelpers.c --- libwmf-0.2.8.3.orig/src/extra/gd/gdhelpers.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gdhelpers.c 2004-09-01 10:27:27.656840239 +0100 @@ -1,6 +1,7 @@ #include "gd.h" #include "gdhelpers.h" #include +#include /* TBB: gd_strtok_r is not portable; provide an implementation */ diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd_jpeg.c libwmf-0.2.8.3/src/extra/gd/gd_jpeg.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd_jpeg.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd_jpeg.c 2004-09-01 10:32:23.527126230 +0100 @@ -249,7 +249,9 @@ } } jpeg_finish_compress (&cinfo); +#if BITS_IN_JSAMPLE == 12 error: +#endif jpeg_destroy_compress (&cinfo); gdFree (row); } diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd_png.c libwmf-0.2.8.3/src/extra/gd/gd_png.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd_png.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd_png.c 2004-09-01 10:33:38.674816796 +0100 @@ -125,7 +125,7 @@ png_bytep image_data = NULL; png_bytepp row_pointers = NULL; gdImagePtr im = NULL; - int i, j, *open; + int i, j, *open=0; volatile int transparent = -1; volatile int palette_allocated = FALSE; @@ -442,7 +442,7 @@ void gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile) { - int i, j, bit_depth, interlace_type; + int i, j, bit_depth=1, interlace_type; int width = im->sx; int height = im->sy; int colors = im->colorsTotal; @@ -579,7 +579,6 @@ int i; int j; int k; - int highTrans = -1; for (i = 0; (i < im->colorsTotal); i++) { if ((!im->open[i]) && diff -ru libwmf-0.2.8.3.orig/src/extra/gd/gd_topal.c libwmf-0.2.8.3/src/extra/gd/gd_topal.c --- libwmf-0.2.8.3.orig/src/extra/gd/gd_topal.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/gd_topal.c 2004-09-01 10:27:03.547455558 +0100 @@ -28,6 +28,7 @@ #include "gd.h" #include "gdhelpers.h" +#include /* * This module implements the well-known Heckbert paradigm for color @@ -981,9 +982,9 @@ register int *bptr; /* pointer into bestdist[] array */ int *cptr; /* pointer into bestcolor[] array */ int dist0, dist1, dist2; /* initial distance values */ - register int dist3; /* current distance in inner loop */ + register int dist3 = 0; /* current distance in inner loop */ int xx0, xx1, xx2; /* distance increments */ - register int xx3; + register int xx3 = 0; int inc0, inc1, inc2, inc3; /* initial values for increments */ /* This array holds the distance to the nearest-so-far color for each cell */ int bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS * BOX_C3_ELEMS]; diff -ru libwmf-0.2.8.3.orig/src/extra/gd/wbmp.c libwmf-0.2.8.3/src/extra/gd/wbmp.c --- libwmf-0.2.8.3.orig/src/extra/gd/wbmp.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/extra/gd/wbmp.c 2004-09-01 10:44:50.109640606 +0100 @@ -44,7 +44,7 @@ i = getin (in); if (i < 0) return (-1); - mbi = mbi << 7 | i & 0x7f; + mbi = (mbi << 7) | (i & 0x7f); } while (i & 0x80); diff -ru libwmf-0.2.8.3.orig/src/font.c libwmf-0.2.8.3/src/font.c --- libwmf-0.2.8.3.orig/src/font.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/font.c 2004-09-01 09:42:41.000000000 +0100 @@ -1377,12 +1377,14 @@ * Checks XML Fontmap entry is valid before loading face. */ static FT_Face ipa_font_sys_face (wmfAPI* API,wmfFont* font,wmfXML_FontInfo* FI) -{ wmfFontmapData* font_data = (wmfFontmapData*) ((wmfFontData*) API->font_data)->user_data; +{ +#if 0 + wmfFontmapData* font_data = (wmfFontmapData*) ((wmfFontData*) API->font_data)->user_data; + struct stat stat_buf; +#endif FT_Face face = 0; - struct stat stat_buf; - if (FI == 0) return (0); if (FI->name == 0) @@ -1487,8 +1489,6 @@ FT_Face face = 0; - unsigned int i; - char* aalias = 0; if (FI == 0) return (0); diff -ru libwmf-0.2.8.3.orig/src/io-wmf.c libwmf-0.2.8.3/src/io-wmf.c --- libwmf-0.2.8.3.orig/src/io-wmf.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/io-wmf.c 2004-09-01 09:39:14.000000000 +0100 @@ -124,8 +124,9 @@ /* if needed, the natural width and height of the WMF */ unsigned int width, height; - +#if 0 double units_per_inch; +#endif double resolution_x, resolution_y; /* TODO: be smarter about getting the resolution from screen diff -ru libwmf-0.2.8.3.orig/src/ipa/fig/device.h libwmf-0.2.8.3/src/ipa/fig/device.h --- libwmf-0.2.8.3.orig/src/ipa/fig/device.h 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/ipa/fig/device.h 2004-09-01 10:19:47.403439001 +0100 @@ -20,7 +20,8 @@ /* This is called by wmf_play() the *first* time the meta file is played */ static void wmf_fig_device_open (wmfAPI* API) -{ wmf_fig_t* ddata = WMF_FIG_GetData (API); +{ +/* wmf_fig_t* ddata = WMF_FIG_GetData (API); */ WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]device_open"); @@ -30,7 +31,8 @@ /* This is called by wmf_api_destroy() */ static void wmf_fig_device_close (wmfAPI* API) -{ wmf_fig_t* ddata = WMF_FIG_GetData (API); +{ +/* wmf_fig_t* ddata = WMF_FIG_GetData (API); */ WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]device_close"); @@ -40,7 +42,8 @@ /* This is called from the beginning of each play for initial page setup */ static void wmf_fig_device_begin (wmfAPI* API) -{ wmf_fig_t* ddata = WMF_FIG_GetData (API); +{ + wmf_fig_t* ddata = WMF_FIG_GetData (API); wmfStream* out = ddata->out; @@ -53,24 +56,8 @@ float ratio_def; float ratio_page; - float Ox; - float Oy; - - float xScale; - float yScale; - - int i; - - int zero; - int colno; - - char clr[10]; - char c; - time_t t; - float fu; - WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]device_begin"); if (out == 0) return; diff -ru libwmf-0.2.8.3.orig/src/ipa/fig/draw.h libwmf-0.2.8.3/src/ipa/fig/draw.h --- libwmf-0.2.8.3.orig/src/ipa/fig/draw.h 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/ipa/fig/draw.h 2004-09-01 10:20:43.762169573 +0100 @@ -260,11 +260,6 @@ int a; int b; - int start_x; - int start_y; - int end_x; - int end_y; - WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]draw_ellipse"); wmf_stream_printf (API,out,"# wmf_[fig_]draw_ellipse\n"); @@ -389,8 +384,6 @@ U16 sub_length; U16 sub_count; - int npoints; - WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]poly_line"); if (out == 0) return; @@ -461,8 +454,6 @@ U16 i; - int npoints; - WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]draw_polygon"); if (out == 0) return; diff -ru libwmf-0.2.8.3.orig/src/ipa/fig/region.h libwmf-0.2.8.3/src/ipa/fig/region.h --- libwmf-0.2.8.3.orig/src/ipa/fig/region.h 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/ipa/fig/region.h 2004-09-01 10:21:02.301448589 +0100 @@ -125,8 +125,6 @@ static void wmf_fig_region_clip (wmfAPI* API,wmfPolyRectangle_t* poly_rect) { wmf_fig_t* ddata = WMF_FIG_GetData (API); - unsigned int i; - wmfStream* out = ddata->out; WMF_DEBUG (API,"~~~~~~~~wmf_[fig_]region_clip"); diff -ru libwmf-0.2.8.3.orig/src/ipa/xgd/device.h libwmf-0.2.8.3/src/ipa/xgd/device.h --- libwmf-0.2.8.3.orig/src/ipa/xgd/device.h 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/ipa/xgd/device.h 2004-09-01 10:17:49.769695539 +0100 @@ -20,9 +20,10 @@ /* This is called by wmf_play() the *first* time the meta file is played */ static void wmf_gd_device_open (wmfAPI* API) -{ wmf_gd_t* ddata = WMF_GD_GetData (API); - - /* gd_t* gd = (gd_t*) ddata->gd_data; */ +{ +#ifndef HAVE_LIBPNG + wmf_gd_t* ddata = WMF_GD_GetData (API); +#endif WMF_DEBUG (API,"wmf_[gd_]device_open"); diff -ru libwmf-0.2.8.3.orig/src/player/meta.h libwmf-0.2.8.3/src/player/meta.h --- libwmf-0.2.8.3.orig/src/player/meta.h 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/player/meta.h 2004-09-01 10:16:43.059665870 +0100 @@ -1011,7 +1011,7 @@ double x2; double y2; double r2; - double r2_min; + double r2_min = 0; if ((polyline->pt == 0) || (polypoly->pt == 0)) return; /* erk!! */ @@ -2383,7 +2383,7 @@ } if (API->flags & API_ENABLE_EDITING) - { if (value = wmf_attr_query (API, attrlist, "color")) + { if ((value = wmf_attr_query (API, attrlist, "color"))) { if ((*value) == '#') { if (sscanf (value+1, "%lx", &rgbhex) == 1) { par_U16_rg = (U16) ((rgbhex >> 8) & 0xffff); @@ -3104,7 +3104,7 @@ WMF_PEN_SET_HEIGHT (pen,(double) par_U16_w * ABS (P->dc->pixel_height)); if (API->flags & API_ENABLE_EDITING) - { if (value = wmf_attr_query (API, attrlist, "color")) + { if ((value = wmf_attr_query (API, attrlist, "color"))) { if ((*value) == '#') { if (sscanf (value+1, "%lx", &rgbhex) == 1) { par_U16_rg = (U16) ((rgbhex >> 8) & 0xffff); @@ -3206,7 +3206,7 @@ WMF_BRUSH_SET_STYLE (brush,ParU16 (API,Record,0)); if (API->flags & API_ENABLE_EDITING) - { if (value = wmf_attr_query (API, attrlist, "color")) + { if ((value = wmf_attr_query (API, attrlist, "color"))) { if ((*value) == '#') { if (sscanf (value+1, "%lx", &rgbhex) == 1) { par_U16_rg = (U16) ((rgbhex >> 8) & 0xffff); diff -ru libwmf-0.2.8.3.orig/src/recorder.c libwmf-0.2.8.3/src/recorder.c --- libwmf-0.2.8.3.orig/src/recorder.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/recorder.c 2004-09-01 09:27:06.000000000 +0100 @@ -764,7 +764,7 @@ if ((mode != ALTERNATE) && (mode != WINDING)) { WMF_ERROR (API, "Unexpected polygon fill mode! Expected one of ALTERNATE or WINDING"); - return; + return 0; } if (construct->polyfill == mode) return 0; @@ -974,9 +974,11 @@ unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2) { +#if 0 unsigned long Size = 3 + 2; wmfRecordBox rbox; +#endif wmfConstruct * construct = (wmfConstruct *) canvas; @@ -1577,7 +1579,7 @@ if ((construct == 0) || (str == 0)) return -1; length = (strlen (str) + 1) / 2; /* TODO: do conversion from UTF-8 to... ?? */ - if (length == 0) return; + if (length == 0) return 0; Size += length; diff -ru libwmf-0.2.8.3.orig/src/stream.c libwmf-0.2.8.3/src/stream.c --- libwmf-0.2.8.3.orig/src/stream.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/stream.c 2004-09-01 10:25:28.340340689 +0100 @@ -268,7 +268,7 @@ { char* more = 0; char* sptr = 0; - unsigned long max; + unsigned long max=0; wmfDefaultStream* defstr = (wmfDefaultStream*) context; @@ -310,11 +310,9 @@ * @internal */ int wmf_stream_rezet (void* context) -{ wmfDefaultZtream* defstr = (wmfDefaultZtream*) context; - - wmfAPI* API = defstr->API; - - WMF_DEBUG (API,"cannot reset ztream (compressed stream)"); +{ + WMF_DEBUG (((wmfDefaultZtream*) context)->API, + "cannot reset ztream (compressed stream)"); return (0); } diff -ru libwmf-0.2.8.3.orig/src/xml.c libwmf-0.2.8.3/src/xml.c --- libwmf-0.2.8.3.orig/src/xml.c 2004-09-01 09:19:28.000000000 +0100 +++ libwmf-0.2.8.3/src/xml.c 2004-09-01 10:12:54.430952441 +0100 @@ -451,9 +451,9 @@ memset ((void*) (&sax), 0, sizeof (xmlSAXHandler)); - sax.startElement = xml_start; - sax.endElement = xml_end; - sax.characters = xml_data; + sax.startElement = (startElementSAXFunc)xml_start; + sax.endElement = (endElementSAXFunc)xml_end; + sax.characters = (charactersSAXFunc)xml_data; ctxt = xmlCreateFileParserCtxt (wmfxml_filename);