use debhacks

This commit is contained in:
ehouse 2006-01-28 19:03:10 +00:00
parent 2ea8c2e0cd
commit 3f577181dd
6 changed files with 27 additions and 21 deletions

View file

@ -23,6 +23,7 @@
#include "ceclrsel.h" #include "ceclrsel.h"
#include "ceutil.h" #include "ceutil.h"
#include "debhacks.h"
#ifdef MY_COLOR_SEL #ifdef MY_COLOR_SEL
@ -224,7 +225,7 @@ myChooseColor( CEAppGlobals* globals, HWND hwnd, COLORREF* cref )
XP_LOGF( "setting up IDD_COLOREDITDLG" ); XP_LOGF( "setting up IDD_COLOREDITDLG" );
result = DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLOREDITDLG, hwnd, result = DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_COLOREDITDLG, hwnd,
(DLGPROC)EditColorsDlg, (long)&state ); (DLGPROC)EditColorsDlg, (long)&state );
XP_LOGF( "DialogBoxParam=>%d", result ); XP_LOGF( "DialogBoxParam=>%d", result );
@ -405,7 +406,7 @@ ceDoColorsEdit( HWND hwnd, CEAppGlobals* globals, COLORREF* colors )
state.globals = globals; state.globals = globals;
state.inColors = colors; state.inColors = colors;
(void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd, (void)DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd,
(DLGPROC)ColorsDlg, (long)&state ); (DLGPROC)ColorsDlg, (long)&state );
if ( !state.cancelled ) { if ( !state.cancelled ) {

View file

@ -21,6 +21,7 @@
#include "cecondlg.h" #include "cecondlg.h"
#include "ceutil.h" #include "ceutil.h"
#include "debhacks.h"
static void static void
ceControlsToAddrRec( HWND hDlg, CeConnDlgState* cState ) ceControlsToAddrRec( HWND hDlg, CeConnDlgState* cState )
@ -112,7 +113,7 @@ WrapConnsDlg( HWND hDlg, CEAppGlobals* globals, const CommsAddrRec* addrRec,
XP_MEMCPY( &state->addrRec, addrRec, sizeof(state->addrRec) ); XP_MEMCPY( &state->addrRec, addrRec, sizeof(state->addrRec) );
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg,
(DLGPROC)ConnsDlg, (long)state ); (DLGPROC)ConnsDlg, (long)state );
result = !state->userCancelled; result = !state->userCancelled;

View file

@ -24,6 +24,7 @@
#include "dictnryp.h" #include "dictnryp.h"
#include "strutils.h" #include "strutils.h"
#include "cedict.h" #include "cedict.h"
#include "debhacks.h"
typedef struct CEDictionaryCtxt { typedef struct CEDictionaryCtxt {
DictionaryCtxt super; DictionaryCtxt super;
@ -594,18 +595,18 @@ checkIfDictAndLegal( MPFORMAL wchar_t* path, XP_U16 pathLen,
static XP_Bool static XP_Bool
locateOneDir( MPFORMAL wchar_t* path, XP_U16* which ) locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
{ {
WIN32_FIND_DATA data; DH(WIN32_FIND_DATA) data;
HANDLE fileH; HANDLE fileH;
XP_Bool result = XP_FALSE; XP_Bool result = XP_FALSE;
XP_U16 startLen; XP_U16 startLen;
#if defined TARGET_OS_WINCE #if defined TARGET_OS_WINCE
lstrcat( path, L"\\" ); DH(lstrcat)( path, L"\\" );
#elif defined TARGET_OS_WIN32 #elif defined TARGET_OS_WIN32
lstrcat( path, L".\\" ); DH(lstrcat)( path, L".\\" );
#endif #endif
startLen = wcslen(path); /* record where we were so can back up */ startLen = wcslen(path); /* record where we were so can back up */
lstrcat( path, L"*" ); DH(lstrcat)( path, L"*" );
XP_MEMSET( &data, 0, sizeof(data) ); XP_MEMSET( &data, 0, sizeof(data) );
@ -621,7 +622,7 @@ locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0){ if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0){
#if defined TARGET_OS_WINCE #if defined TARGET_OS_WINCE
/* We don't do recursive search on Win32!!! */ /* We don't do recursive search on Win32!!! */
lstrcpy( path+startLen, data.cFileName ); DH(lstrcpy)( path+startLen, data.cFileName );
result = locateOneDir( MPPARM(mpool) path, which ); result = locateOneDir( MPPARM(mpool) path, which );
if ( result ) { if ( result ) {
break; break;
@ -632,7 +633,7 @@ locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
&data ) &data )
&& (*which-- == 0)) { && (*which-- == 0)) {
/* we're done! */ /* we're done! */
lstrcpy( path+startLen, data.cFileName ); DH(lstrcpy)( path+startLen, data.cFileName );
result = XP_TRUE; result = XP_TRUE;
break; break;
} }

View file

@ -31,6 +31,7 @@
#include "cemain.h" #include "cemain.h"
#include "cedict.h" #include "cedict.h"
#include "cedefines.h" #include "cedefines.h"
#include "debhacks.h"
static void ceClearToBkground( CEDrawCtx* dctx, XP_Rect* rect ); static void ceClearToBkground( CEDrawCtx* dctx, XP_Rect* rect );
static void ceDrawBitmapInRect( HDC hdc, const RECT* r, HBITMAP bitmap ); static void ceDrawBitmapInRect( HDC hdc, const RECT* r, HBITMAP bitmap );
@ -486,7 +487,7 @@ formatRemText( HDC hdc, wchar_t* buf, XP_S16 nTilesLeft, SIZE* size )
size->cx = size->cy = 0; size->cx = size->cy = 0;
} else { } else {
swprintf( buf, format, nTilesLeft ); swprintf( buf, format, nTilesLeft );
GetTextExtentPoint32( hdc, buf, wcslen(buf), size ); DH(GetTextExtentPoint32)( hdc, buf, wcslen(buf), size );
} }
} /* formatRemText */ } /* formatRemText */
@ -549,7 +550,7 @@ ceWidthAndText( HDC hdc, wchar_t* buf, DrawScoreInfo* dsi,
len = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, tbuf, -1, len = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, tbuf, -1,
buf, 10 ); buf, 10 );
GetTextExtentPoint32( hdc, buf, len, &size ); DH(GetTextExtentPoint32)( hdc, buf, len, &size );
*widthP = (XP_U16)size.cx; *widthP = (XP_U16)size.cx;
*heightP = (XP_U16)size.cy; *heightP = (XP_U16)size.cy;
} /* ceWidthAndText */ } /* ceWidthAndText */
@ -735,7 +736,7 @@ ce_draw_measureMiniWText( DrawCtx* p_dctx, XP_UCHAR* str,
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, len, MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, len,
widebuf, sizeof(widebuf)/sizeof(widebuf[0]) ); widebuf, sizeof(widebuf)/sizeof(widebuf[0]) );
widebuf[len] = 0; widebuf[len] = 0;
GetTextExtentPoint32( hdc, widebuf, wcslen(widebuf), &size ); DH(GetTextExtentPoint32)( hdc, widebuf, wcslen(widebuf), &size );
maxWidth = (XP_U16)XP_MAX( maxWidth, size.cx ); maxWidth = (XP_U16)XP_MAX( maxWidth, size.cx );
height += size.cy + CE_INTERLINE_SPACE; height += size.cy + CE_INTERLINE_SPACE;

View file

@ -21,6 +21,7 @@
#include "cemain.h" #include "cemain.h"
#include "ceclrsel.h" #include "ceclrsel.h"
#include "ceutil.h" #include "ceutil.h"
#include "debhacks.h"
/* Stuff the strings for phonies. Why can't I put this in the resource? /* Stuff the strings for phonies. Why can't I put this in the resource?
*/ */
@ -332,7 +333,7 @@ WrapPrefsDialog( HWND hDlg, CEAppGlobals* globals, CePrefsDlgState* state,
state->isNewGame = isNewGame; state->isNewGame = isNewGame;
XP_MEMCPY( &state->prefsPrefs, prefsPrefs, sizeof( state->prefsPrefs ) ); XP_MEMCPY( &state->prefsPrefs, prefsPrefs, sizeof( state->prefsPrefs ) );
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg,
(DLGPROC)PrefsDlg, (long)state ); (DLGPROC)PrefsDlg, (long)state );
result = !state->userCancelled; result = !state->userCancelled;

View file

@ -20,6 +20,7 @@
#include "cesockwr.h" #include "cesockwr.h"
#include "cemain.h" #include "cemain.h"
#include "debhacks.h"
#include <winsock.h> #include <winsock.h>
@ -92,7 +93,7 @@ queue_packet( CeSocketWrapper* self, XP_U8* packet, XP_U16 len )
XP_LOGF( "there are now %d packets on send queue", self->nPackets ); XP_LOGF( "there are now %d packets on send queue", self->nPackets );
/* signal the writer thread */ /* signal the writer thread */
SetEvent( self->queueAddEvent ); DH(SetEvent)( self->queueAddEvent );
success = XP_TRUE; success = XP_TRUE;
} }
@ -216,7 +217,7 @@ connectSocket( CeSocketWrapper* self )
self->socket = sock; self->socket = sock;
/* Let the reader thread know there's now a socket to listen on */ /* Let the reader thread know there's now a socket to listen on */
SetEvent( self->socketConnEvent ); DH(SetEvent)( self->socketConnEvent );
} else { } else {
logLastError( "connect" ); logLastError( "connect" );
@ -246,7 +247,7 @@ closeConnection( CeSocketWrapper* self )
if ( self->connState >= CE_IP_UNCONNECTED ) { if ( self->connState >= CE_IP_UNCONNECTED ) {
if ( self->socket != -1 ) { if ( self->socket != -1 ) {
closesocket( self->socket ); MS(closesocket)( self->socket );
} }
self->socket = -1; self->socket = -1;
@ -279,7 +280,7 @@ WriterThreadProc( LPVOID lpParameter )
/* Should this happen sooner? What if other thread signals in the /* Should this happen sooner? What if other thread signals in the
meantime? */ meantime? */
ResetEvent( self->queueAddEvent ); DH(ResetEvent)( self->queueAddEvent );
} }
ExitThread(0); /* docs say to exit this way */ ExitThread(0); /* docs say to exit this way */