tune code for 64-bit and 32-bit

This commit is contained in:
WEI Yongming
2018-01-19 22:41:37 +08:00
parent ec35c3552a
commit 599c985146
9 changed files with 33 additions and 33 deletions

View File

@@ -87,7 +87,7 @@ use_debug="no"
trace_message="no"
message_string="no"
runtime_mode="ths"
runtime_mode="procs"
stand_alone="no"
@@ -299,7 +299,7 @@ AC_ARG_ENABLE(msgstr,
message_string=$enableval)
AC_ARG_WITH(runmode,
[ --with-runmode=ths/procs/sa the MiniGUI runtime mode <default=ths>],
[ --with-runmode=procs/ths/sa the MiniGUI runtime mode <default=procs>],
runtime_mode=$withval)
AC_ARG_ENABLE(standalone,
@@ -1389,11 +1389,11 @@ case "$with_libsuffix" in
sa)
MGLIB_SUFFIX="sa"
;;
procs)
MGLIB_SUFFIX="procs"
ths)
MGLIB_SUFFIX="ths"
;;
*)
MGLIB_SUFFIX="ths"
MGLIB_SUFFIX="procs"
;;
esac
;;
@@ -1610,13 +1610,13 @@ case "$runtime_mode" in
AC_DEFINE(_LITE_VERSION, 1,
[Define if build MiniGUI-Standalone (back-compatibility definition)])
;;
procs)
ths)
AC_DEFINE(_MGRM_PROCESSES, 1,
[Define if build MiniGUI-Processes])
AC_DEFINE(_LITE_VERSION, 1,
[Define if build MiniGUI-Processes (back-compatibility definition)])
;;
*)
procs)
AC_DEFINE(_MGRM_THREADS, 1,
[Define if build MiniGUI-Threads])
CFLAGS="$CFLAGS -D_REENTRANT"
@@ -2449,7 +2449,7 @@ if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -pipe"
fi
if test "$runtime_mode" = "ths"; then
if test "x$runtime_mode" = "xths"; then
DEP_LIBS="$DEP_LIBS -lpthread"
fi

View File

@@ -2466,7 +2466,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
unsigned char charBuffer [3];
int chars;
_MG_PRINTF("get char-----------------char----%lx\n", wParam);
_MG_PRINTF("get char-----------------char----%p\n", (PVOID)wParam);
if (wParam == 127) // BS
wParam = '\b';

View File

@@ -271,9 +271,9 @@ unsigned short font_GetBestScaleFactor (int height, int expect)
{ \
devfont = head; \
while (devfont) { \
fprintf (stderr, " %d: %s, charsetname: %s, style: %lx\n", \
fprintf (stderr, " %d: %s, charsetname: %s, style: %p\n", \
count, \
devfont->name, devfont->charset_ops->name, devfont->style); \
devfont->name, devfont->charset_ops->name, (PVOID)devfont->style); \
devfont = devfont->next; \
count++; \
} \

View File

@@ -102,8 +102,8 @@ static PLOGFONT gdiCreateLogFont (const char* type, const char* family,
log_font->sbc_scale = 1;
log_font->mbc_scale = 1;
_MG_PRINTF ("FONT>LogFont: requested info: type: %s, family: %s, style: %lx, charset: %s, size: %d.\n",
log_font->type, log_font->family, log_font->style, log_font->charset,
_MG_PRINTF ("FONT>LogFont: requested info: type: %s, family: %s, style: %p, charset: %s, size: %d.\n",
log_font->type, log_font->family, (PVOID)log_font->style, log_font->charset,
log_font->size);
sbc_devfont = font_GetMatchedSBDevFont (log_font);
@@ -223,8 +223,8 @@ static PLOGFONT gdiCreateLogFont (const char* type, const char* family,
log_font->style &= ~FS_FLIP_HORZVERT;
}
_MG_PRINTF ("FONT>LogFont: created info: type: %s, family: %s, style: %lx, charset: %s, size: %d.\n",
log_font->type, log_font->family, log_font->style, log_font->charset,
_MG_PRINTF ("FONT>LogFont: created info: type: %s, family: %s, style: %p, charset: %s, size: %d.\n",
log_font->type, log_font->family, (PVOID)log_font->style, log_font->charset,
log_font->size);
return log_font;

View File

@@ -600,7 +600,7 @@ void dump_window_element_data (HWND hwnd)
break;
case WE_ATTR_TYPE_COLOR:
_MG_PRINTF ("\tcolor in list: %lx.\n", wed->data);
_MG_PRINTF ("\tcolor in list: %p.\n", (PVOID)wed->data);
}
}
_MG_PRINTF ("GUI>DumpWED: Done\n");

View File

@@ -1199,12 +1199,12 @@ void mnuDumpMenuItem (PMENUITEM pmi)
printf ("\tmenu state: %#x\n", pmi->mnustate);
printf ("\tmenu id: %d\n", pmi->id);
printf ("\tchecked bitmap: 0x%p\n", pmi->checkedbmp);
printf ("\tunchecked bitmap: 0x%p\n", pmi->uncheckedbmp);
printf ("\titem data: %lu\n", pmi->itemdata);
printf ("\tunchecked bitmap:0x%p\n", pmi->uncheckedbmp);
printf ("\titem data: %p\n", (PVOID)pmi->itemdata);
if (pmi->mnutype == MFT_STRING)
printf ("\tstring: %s\n", (char*)pmi->typedata);
else
printf ("\ttype data: %lu\n", pmi->typedata);
printf ("\ttype data: %p\n", (PVOID)pmi->typedata);
printf ("\tnext item: 0x%p\n", pmi->next);
if (pmi->submenu) {

View File

@@ -93,12 +93,12 @@ Uint8* GetPixelUnderCursor (int x, int y, gal_pixel* pixel)
HCURSOR GUIAPI LoadCursorFromFile (const char* filename)
{
return __mgLoadCursorFromFile (filename);
return load_cursor_from_file (filename);
}
HCURSOR GUIAPI LoadCursorFromMem (const void* area)
{
return __mgLoadCursorFromMem (area);
return load_cursor_from_mem (area);
}
static BITMAP csr_bmp = {

View File

@@ -125,11 +125,11 @@ void* DesktopMain (void* data)
LRESULT lRet = 0;
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s: hWnd: %p, wP: %#lx, lP: %#lx. %s\n",
fprintf (stderr, "Message, %s: hWnd: %p, wP: %p, lP: %p. %s\n",
Message2Str (Msg.message),
Msg.hwnd,
Msg.wParam,
Msg.lParam,
(PVOID)Msg.wParam,
(PVOID)Msg.lParam,
Msg.pAdd?"Sync":"Normal");
#endif
@@ -144,8 +144,8 @@ void* DesktopMain (void* data)
}
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s done, return value: %lx\n",
Message2Str (Msg.message), lRet);
fprintf (stderr, "Message, %s done, return value: %p\n",
Message2Str (Msg.message), (PVOID)lRet);
#endif
}

View File

@@ -421,8 +421,8 @@ const char* GUIAPI Message2Str (int message)
void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
UINT nMsg, WPARAM wParam, LPARAM lParam)
{
fprintf (fp, "Message %s: hWnd: %p, wP: %lx, lP: %lx.\n",
Message2Str (nMsg), hWnd, wParam, lParam);
fprintf (fp, "Message %s: hWnd: %p, wP: %p, lP: %p.\n",
Message2Str (nMsg), hWnd, (PVOID)wParam, (PVOID)lParam);
}
#endif
@@ -1029,11 +1029,11 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
LICENSE_MODIFY_MESSAGE(pMsg);
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s: hWnd: %p, wP: %lx, lP: %lx. %s\n",
fprintf (stderr, "Message, %s: hWnd: %p, wP: %p, lP: %p. %s\n",
Message2Str (pMsg->message),
pMsg->hwnd,
pMsg->wParam,
pMsg->lParam,
(PVOID)pMsg->wParam,
(PVOID)pMsg->lParam,
SYNMSGNAME);
#endif
@@ -1071,8 +1071,8 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
#endif
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s done, return value: %lx\n",
Message2Str (pMsg->message), lRet);
fprintf (stderr, "Message, %s done, return value: %p\n",
Message2Str (pMsg->message), (PVOID)lRet);
#endif
return lRet;