From 98beaff2c51ac6c4f61ddf4c80338c89537bb8af Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 8 Aug 2005 15:03:42 +0000 Subject: [PATCH] Warning fixes for gcc 4.0. --- dlls/gdi/driver.c | 4 ++-- dlls/gdi/font.c | 12 ++++++------ dlls/gdi/freetype.c | 11 ++++++----- dlls/gdi/tests/metafile.c | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dlls/gdi/driver.c b/dlls/gdi/driver.c index dfeee8bc9f6..7d4ad44478d 100644 --- a/dlls/gdi/driver.c +++ b/dlls/gdi/driver.c @@ -410,14 +410,14 @@ DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA) dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra); if (!dmW) return NULL; - MultiByteToWideChar(CP_ACP, 0, dmA->dmDeviceName, CCHDEVICENAME, + MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, CCHDEVICENAME, dmW->dmDeviceName, CCHDEVICENAME); /* copy slightly more, to avoid long computations */ memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA->dmSize - CCHDEVICENAME); if (dmA->dmSize >= (const char *)dmA->dmFormName - (const char *)dmA + CCHFORMNAME) { - MultiByteToWideChar(CP_ACP, 0, dmA->dmFormName, CCHFORMNAME, + MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, CCHFORMNAME, dmW->dmFormName, CCHFORMNAME); if (dmA->dmSize > (const char *)&dmA->dmLogPixels - (const char *)dmA) memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA->dmSize - ((const char *)&dmA->dmLogPixels - (const char *)dmA)); diff --git a/dlls/gdi/font.c b/dlls/gdi/font.c index ea0033a4498..ae6bbaf7bd7 100644 --- a/dlls/gdi/font.c +++ b/dlls/gdi/font.c @@ -229,13 +229,13 @@ static void FONT_EnumLogFontExWTo16( const ENUMLOGFONTEXW *fontW, LPENUMLOGFONTE FONT_LogFontWTo16( (LPLOGFONTW)fontW, (LPLOGFONT16)font16); WideCharToMultiByte( CP_ACP, 0, fontW->elfFullName, -1, - font16->elfFullName, LF_FULLFACESIZE, NULL, NULL ); + (LPSTR) font16->elfFullName, LF_FULLFACESIZE, NULL, NULL ); font16->elfFullName[LF_FULLFACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfStyle, -1, - font16->elfStyle, LF_FACESIZE, NULL, NULL ); + (LPSTR) font16->elfStyle, LF_FACESIZE, NULL, NULL ); font16->elfStyle[LF_FACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfScript, -1, - font16->elfScript, LF_FACESIZE, NULL, NULL ); + (LPSTR) font16->elfScript, LF_FACESIZE, NULL, NULL ); font16->elfScript[LF_FACESIZE-1] = '\0'; } @@ -244,13 +244,13 @@ static void FONT_EnumLogFontExWToA( const ENUMLOGFONTEXW *fontW, LPENUMLOGFONTEX FONT_LogFontWToA( (LPLOGFONTW)fontW, (LPLOGFONTA)fontA); WideCharToMultiByte( CP_ACP, 0, fontW->elfFullName, -1, - fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL ); + (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL ); fontA->elfFullName[LF_FULLFACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfStyle, -1, - fontA->elfStyle, LF_FACESIZE, NULL, NULL ); + (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL ); fontA->elfStyle[LF_FACESIZE-1] = '\0'; WideCharToMultiByte( CP_ACP, 0, fontW->elfScript, -1, - fontA->elfScript, LF_FACESIZE, NULL, NULL ); + (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL ); fontA->elfScript[LF_FACESIZE-1] = '\0'; } diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 04a2de23295..2d5342f268b 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -848,7 +848,7 @@ static void load_fontconfig_fonts(void) FcFontSet *fontset; FcValue v; int i, len; - const char *ext; + const char *file, *ext; fc_handle = wine_dlopen(SONAME_LIBFONTCONFIG, RTLD_NOW, NULL, 0); if(!fc_handle) { @@ -881,16 +881,17 @@ LOAD_FUNCPTR(FcPatternGet); if(pFcPatternGet(fontset->fonts[i], FC_FILE, 0, &v) != FcResultMatch) continue; if(v.type != FcTypeString) continue; - TRACE("fontconfig: %s\n", v.u.s); + file = (LPCSTR) v.u.s; + TRACE("fontconfig: %s\n", file); /* We're just interested in OT/TT fonts for now, so this hack just picks up the standard extensions to save time loading every other font */ - len = strlen(v.u.s); + len = strlen( file ); if(len < 4) continue; - ext = v.u.s + len - 3; + ext = &file[ len - 3 ]; if(!strcasecmp(ext, "ttf") || !strcasecmp(ext, "ttc") || !strcasecmp(ext, "otf")) - AddFontFileToList(v.u.s, NULL, ADDFONT_EXTERNAL_FONT); + AddFontFileToList(file, NULL, ADDFONT_EXTERNAL_FONT); } pFcFontSetDestroy(fontset); pFcObjectSetDestroy(os); diff --git a/dlls/gdi/tests/metafile.c b/dlls/gdi/tests/metafile.c index 17f0138c803..3d19268e942 100644 --- a/dlls/gdi/tests/metafile.c +++ b/dlls/gdi/tests/metafile.c @@ -295,10 +295,10 @@ static void dump_mf_bits (const HMETAFILE mf, const char *desc) * otherwise returns the number of non-matching bytes. */ -static int compare_mf_bits (const HMETAFILE mf, const char *bits, UINT bsize, +static int compare_mf_bits (const HMETAFILE mf, const unsigned char *bits, UINT bsize, const char *desc) { - char buf[MF_BUFSIZE]; + unsigned char buf[MF_BUFSIZE]; UINT mfsize, i; int diff;