diff --git a/src/font/devfont.c b/src/font/devfont.c index 64a01137..72b4ebdc 100644 --- a/src/font/devfont.c +++ b/src/font/devfont.c @@ -813,7 +813,7 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload) char *font_file_name = NULL; MEM_RES* memres = NULL; - char key[12]; + char key[32]; int added_num = 0; font_file_name = font_file; diff --git a/src/font/sysfont.c b/src/font/sysfont.c index c3ab46ce..37f40aa9 100644 --- a/src/font/sysfont.c +++ b/src/font/sysfont.c @@ -101,7 +101,7 @@ BOOL mg_InitSysFont (void) memset (sys_fonts, 0, nr_fonts * sizeof (PLOGFONT)); for (i = 0; i < nr_fonts; i++) { - char key [11]; + char key [32]; char type [LEN_FONT_NAME + 1]; char family [LEN_FONT_NAME + 1]; char style [LEN_FONT_NAME + 1]; diff --git a/src/gui/lf_manager.c b/src/gui/lf_manager.c index a75604fa..7528317c 100644 --- a/src/gui/lf_manager.c +++ b/src/gui/lf_manager.c @@ -259,7 +259,7 @@ BOOL GUIAPI SetWindowElementRenderer (HWND hWnd, const char* werdr_name, pwnd = MG_GET_WINDOW_PTR(hWnd); if (NULL == pwnd || - ((NULL == werdr_name || '\0' == werdr_name) && NULL == we_attrs)) + ((NULL == werdr_name || '\0' == *werdr_name) && NULL == we_attrs)) { return FALSE; } diff --git a/src/newgal/fbcon/pci_smi.c b/src/newgal/fbcon/pci_smi.c index 0abb1b39..e51deb17 100644 --- a/src/newgal/fbcon/pci_smi.c +++ b/src/newgal/fbcon/pci_smi.c @@ -709,8 +709,8 @@ static int SMI_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color int y = rect->y; if (this->screen->pixels != dst->pixels) { - y += ((UINT)dst->pixels - (UINT)this->screen->pixels)/this->screen->pitch; - x += (((UINT)dst->pixels - (UINT)this->screen->pixels)%this->screen->pitch)/pSmi->Bpp; + y += ((uintptr_t)dst->pixels - (uintptr_t)this->screen->pixels)/this->screen->pitch; + x += (((uintptr_t)dst->pixels - (uintptr_t)this->screen->pixels)%this->screen->pitch)/pSmi->Bpp; } SMI_SetupForSolidFill (color, GXcopy, ~0); @@ -767,15 +767,15 @@ static int SMI_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, int dsty = dstrect->y; if (pSmi->this->screen->pixels != src->pixels) { - srcy += ((UINT)src->pixels - (UINT)pSmi->this->screen->pixels) + srcy += ((uintptr_t)src->pixels - (uintptr_t)pSmi->this->screen->pixels) /pSmi->this->screen->pitch; - srcx += (((UINT)src->pixels - (UINT)pSmi->this->screen->pixels) + srcx += (((uintptr_t)src->pixels - (uintptr_t)pSmi->this->screen->pixels) %pSmi->this->screen->pitch)/pSmi->Bpp; } if (pSmi->this->screen->pixels != dst->pixels) { - dsty += ((UINT)dst->pixels - (UINT)pSmi->this->screen->pixels) + dsty += ((uintptr_t)dst->pixels - (uintptr_t)pSmi->this->screen->pixels) /pSmi->this->screen->pitch; - dstx += (((UINT)dst->pixels - (UINT)pSmi->this->screen->pixels) + dstx += (((uintptr_t)dst->pixels - (uintptr_t)pSmi->this->screen->pixels) %pSmi->this->screen->pitch)/pSmi->Bpp; } diff --git a/src/sysres/resmgr.c b/src/sysres/resmgr.c index 955ef67f..691831b8 100644 --- a/src/sysres/resmgr.c +++ b/src/sysres/resmgr.c @@ -44,7 +44,9 @@ #include #include -#if !defined(__NOUNIX__) && !defined(WIN32) && !defined(__RTEMS__) +#include "common.h" + +#ifdef HAVE_UNISTD_H #include #include #include @@ -54,8 +56,6 @@ #include #endif - -#include "common.h" #include "minigui.h" #include "gdi.h" #include "window.h" @@ -364,13 +364,13 @@ static void delete_entry_data(RES_ENTRY* entry) BOOL InitializeResManager(int hash_table_size) { char szpath[MAX_PATH+1]; -#if !defined(__NOUNIX__) || defined(WIN32) || !defined(__RTEMS__) +#if !defined(__NOUNIX__) || defined(WIN32) char* p = NULL; #endif pwd_res_path = strdup("./"); //initialize paths -#if !defined(__NOUNIX__) || defined(WIN32) || !defined(__RTEMS__) +#if !defined(__NOUNIX__) || defined(WIN32) if ((p = getenv ("MG_RES_PATH"))) { int len = strlen(p); if (p[len-1] == '/') @@ -516,7 +516,7 @@ int SetResPath(const char* path) } //test path is valid directory -#if !defined(__NOUNIX__) && !defined(WIN32) +#if !defined(__NOUNIX__) && !defined(WIN32) struct stat buf; if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) { # ifdef _DEBUG