clean code for 64-bit

This commit is contained in:
Vincent Wei
2019-10-31 10:44:40 +08:00
parent 9bee00cf9f
commit 33b3ad0bd3
5 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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;
}
+6 -6
View File
@@ -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;
}
+6 -6
View File
@@ -44,7 +44,9 @@
#include <stdarg.h>
#include <ctype.h>
#if !defined(__NOUNIX__) && !defined(WIN32) && !defined(__RTEMS__)
#include "common.h"
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -54,8 +56,6 @@
#include <pthread.h>
#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