diff --git a/src/dirwalk.c b/src/dirwalk.c index 967602bcc..711e7032e 100644 --- a/src/dirwalk.c +++ b/src/dirwalk.c @@ -64,6 +64,9 @@ #include "debug.h" +#ifdef WIN32 +extern char *strcasestr(const char *haystack, const char *needle); +#endif /* Directory walking callers and callbacks */ diff --git a/src/fonts.c b/src/fonts.c index ac320f94b..c2790b2cc 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -66,6 +66,7 @@ #ifdef WIN32 #include "win32_print.h" +extern char *strcasestr(const char *haystack, const char *needle); #endif #if defined(__MACOS__) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 90e78cb5b..b5a4e5f10 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -14611,10 +14611,10 @@ static void do_png_embed_data(png_structp png_ptr) #ifdef WIN32 iconv_t trans; wchar_t *wch; + char *ch; char *conv, *conv2; size_t in, out; - in = out = 1; conv = malloc(255); trans = iconv_open("UTF-8", "WCHAR_T"); @@ -14625,7 +14625,8 @@ static void do_png_embed_data(png_structp png_ptr) in = 2; out = 10; wch = ¤t_node->save_texttool_str[i]; - iconv(trans, (char **)&wch, &in, &conv, &out); + ch = (char *)wch; + iconv(trans, &ch, &in, &conv, &out); conv[0] = '\0'; fprintf(lfi, "%s", conv2); } diff --git a/src/win32_print.c b/src/win32_print.c index bb2c7a549..e83a81116 100644 --- a/src/win32_print.c +++ b/src/win32_print.c @@ -328,6 +328,7 @@ const char *SurfacePrint(SDL_Surface * surf, const char *printcfg, int showdialo int nError; SDL_SysWMinfo wminfo; BITMAPINFOHEADER bmih; + BITMAPINFO bmi; SDL_Surface *surf24 = NULL; RECT rcDst; float sX, sY; @@ -464,12 +465,13 @@ const char *SurfacePrint(SDL_Surface * surf, const char *printcfg, int showdialo { SetStretchBltMode(hDCprinter, COLORONCOLOR); + bmi.bmiHeader = bmih; nError = StretchDIBits(hDCprinter, rcDst.left, rcDst.top, rcDst.right - rcDst.left, rcDst.bottom - rcDst.top, 0, 0, bmih.biWidth, bmih.biHeight, - surf24->pixels, (BITMAPINFO *) & bmih, DIB_RGB_COLORS, SRCCOPY); - if (nError == GDI_ERROR) + surf24->pixels, &bmi, DIB_RGB_COLORS, SRCCOPY); + if (nError == (int) GDI_ERROR) { res = "win32_print: StretchDIBits() failed."; goto error; @@ -518,11 +520,13 @@ static HRESULT ReadRegistry(const char *key, const char *option, char *value, in { LONG res; HKEY hKey = NULL; + DWORD _size; + _size = size; res = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey); if (res != ERROR_SUCCESS) goto err_exit; - res = RegQueryValueEx(hKey, option, NULL, NULL, (LPBYTE) value, (LPDWORD) & size); + res = RegQueryValueEx(hKey, option, NULL, NULL, (LPBYTE) value, &_size); if (res != ERROR_SUCCESS) goto err_exit; res = ERROR_SUCCESS; @@ -603,6 +607,7 @@ char *GetSystemFontDir(void) * * @return user's image dir */ +char *GetUserImageDir(void); char *GetUserImageDir(void) { char path[MAX_PATH]; @@ -624,7 +629,7 @@ char *GetUserImageDir(void) */ static char *GetUserTempDir(void) { - char *temp = getenv("TEMP"); + const char *temp = getenv("TEMP"); if (!temp) { @@ -659,6 +664,7 @@ static int g_bWindowActive = 0; /** * FIXME */ +LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { int bEatKeystroke = 0;