tune code for 64 bits

This commit is contained in:
VincentWei
2018-01-18 19:01:29 +08:00
parent a2a5dcbc2a
commit 01bc3d7c42
8 changed files with 23 additions and 27 deletions
+2
View File
@@ -1885,8 +1885,10 @@ int init_minigui_printf (int (*output_char) (int ch),
#if defined(__GNUC__)
#ifdef _DEBUG
# define _MG_PRINTF(fmt...) fprintf (stderr, fmt)
# define _DBG_PRINTF(fmt...) fprintf (stdout, fmt)
#else
# define _MG_PRINTF(fmt...)
# define _DBG_PRINTF(fmt...)
#endif
#else /* __GNUC__ */
#include <stdio.h>
+3 -3
View File
@@ -2564,7 +2564,7 @@ MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, L
*
* \sa PostSyncMessage
*/
MG_EXPORT int GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
MG_EXPORT LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
#endif
/**
@@ -2728,7 +2728,7 @@ MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
WPARAM wParam, LPARAM lParam, WORD *ch);
/**
* \fn int DispatchMessage (PMSG pMsg)
* \fn LRESULT DispatchMessage (PMSG pMsg)
* \brief Dispatches a message to the window's callback procedure.
*
* This function dispatches the message pointed to by \a pMsg to the
@@ -2743,7 +2743,7 @@ MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
*
* \include getmessage.c
*/
MG_EXPORT int GUIAPI DispatchMessage (PMSG pMsg);
MG_EXPORT LRESULT GUIAPI DispatchMessage (PMSG pMsg);
/**
* \fn int ThrowAwayMessages (HWND pMainWnd)
+2 -1
View File
@@ -941,8 +941,9 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
case MSG_LBUTTONDOWN:
if (GetCapture () == hWnd)
break;
SetCapture (hWnd);
BUTTON_STATUS(pctrl) |= BST_FOCUS;
change_status_from_pose(pctrl, BST_PUSHED, TRUE, TRUE);
break;
+1 -1
View File
@@ -2761,7 +2761,7 @@ HWND GUIAPI SetCapture (HWND hWnd)
HWND GUIAPI GetCapture (void)
{
return (HWND) SendMessage (HWND_DESKTOP, MSG_GETCAPTURE, 0, 0);
return (HWND)SendMessage (HWND_DESKTOP, MSG_GETCAPTURE, 0, 0);
}
void GUIAPI ReleaseCapture (void)
-1
View File
@@ -870,7 +870,6 @@ static HWND DesktopSetCapture (HWND hwnd)
hTemp = __mg_capture_wnd;
__mg_capture_wnd = hwnd;
return hTemp;
}
+5 -5
View File
@@ -122,7 +122,7 @@ void* DesktopMain (void* data)
/* process messages of desktop thread */
while (GetMessage(&Msg, HWND_DESKTOP)) {
int iRet = 0;
LRESULT lRet = 0;
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s: hWnd: %p, wP: %#lx, lP: %#lx. %s\n",
@@ -133,19 +133,19 @@ void* DesktopMain (void* data)
Msg.pAdd?"Sync":"Normal");
#endif
iRet = DesktopWinProc (HWND_DESKTOP,
lRet = DesktopWinProc (HWND_DESKTOP,
Msg.message, Msg.wParam, Msg.lParam);
if (Msg.pAdd) /* this is a sync message. */
{
PSYNCMSG pSyncMsg = (PSYNCMSG)(Msg.pAdd);
pSyncMsg->retval = iRet;
pSyncMsg->retval = lRet;
sem_post(pSyncMsg->sem_handle);
}
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s done, return value: %#x\n",
Message2Str (Msg.message), iRet);
fprintf (stderr, "Message, %s done, return value: %lx\n",
Message2Str (Msg.message), lRet);
#endif
}
+10 -10
View File
@@ -1018,13 +1018,13 @@ int GUIAPI PostQuitMessage (HWND hWnd)
#include "license.h"
int GUIAPI DispatchMessage (PMSG pMsg)
LRESULT GUIAPI DispatchMessage (PMSG pMsg)
{
WNDPROC WndProc;
#ifdef _MGRM_THREADS
PSYNCMSG pSyncMsg;
#endif
int iRet;
LRESULT lRet;
LICENSE_MODIFY_MESSAGE(pMsg);
@@ -1059,23 +1059,23 @@ int GUIAPI DispatchMessage (PMSG pMsg)
if (!(WndProc = GetWndProc (pMsg->hwnd)))
return -1;
iRet = (*WndProc)(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam);
lRet = WndProc (pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam);
#ifdef _MGRM_THREADS
/* this is a sync message. */
if (pMsg->pAdd) {
pSyncMsg = (PSYNCMSG)pMsg->pAdd;
pSyncMsg->retval = iRet;
pSyncMsg->retval = lRet;
sem_post (pSyncMsg->sem_handle);
}
#endif
#ifdef _MGHAVE_TRACE_MSG
fprintf (stderr, "Message, %s done, return value: %x\n",
Message2Str (pMsg->message), iRet);
fprintf (stderr, "Message, %s done, return value: %lx\n",
Message2Str (pMsg->message), lRet);
#endif
return iRet;
return lRet;
}
/* define this to print debug info of ThrowAwayMessages */
@@ -1352,16 +1352,16 @@ LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
return SendSyncMessage (hWnd, msg, wParam, lParam);
}
int GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC WndProc;
MG_CHECK_RET (MG_IS_WINDOW(hWnd), -1);
if ( !(WndProc = GetWndProc(hWnd)) )
if (!(WndProc = GetWndProc(hWnd)))
return -1;
return (*WndProc)(hWnd, nMsg, wParam, lParam);
return WndProc (hWnd, nMsg, wParam, lParam);
}
#endif /* !LITE_VERSION */
-6
View File
@@ -135,12 +135,6 @@ static void* AboutDialogThread (void* data)
ShowWindow (hMainWnd, SW_SHOWNORMAL);
while (GetMessage(&Msg, hMainWnd)) {
printf ("AboutDialogBox Message, %s: hWnd: %p, wP: %lx, lP: %lx.\n",
Message2Str (Msg.message),
Msg.hwnd,
Msg.wParam,
Msg.lParam);
DispatchMessage(&Msg);
}