diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0370c0334b..dee70b5a11 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,103 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-09 21:54 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbwhat32/hbwhat.h + * contrib/hbwhat32/whtcall.c + * contrib/hbwhat32/whtclpb.c + * contrib/hbwhat32/whtcomm.c + * contrib/hbwhat32/whtdll.c + * contrib/hbwhat32/whtgdi.c + * contrib/hbwhat32/whtilst.c + * contrib/hbwhat32/whtinet.c + * contrib/hbwhat32/whtini.c + * contrib/hbwhat32/whtmisc.c + * contrib/hbwhat32/whtmmcap.c + * contrib/hbwhat32/whtmsg.c + * contrib/hbwhat32/whtsock.c + * contrib/hbwhat32/whtsys.c + * contrib/hbwhat32/whttab.c + * contrib/hbwhat32/whttree.c + * contrib/hbwhat32/whtwnd.c + * contrib/hbwhat32/wincorec.c + ! Fixed remaining 64-bit problems. + ! Fixed to work as before, using numbers for pointers. + ! Fixed bugs in these internet related functions: + INTERNETREADFILE(), INTERNETWRITEFILE() + ; NOTE: Number of warnings went down from somewhere well + above a thousand to just a few ones, mostly common + in other parts of Harbour. If someone could help to + clear these remains, it'd be great. + Tested with MSVS2008 -W4 64/32-bit modes, BCC 5.8, + MinGW 4.31. + ; NOTE: I didn't do any real-life tests. Pls do if you're + interested or you're using this contrib. + ; NOTE: Remaining warnings: + - MSVS 2008 -W4 64-bit: + wincorec.c(689) : warning C4244: 'argument' : conversion from 'HB_PTRDIFF' to 'ULONG', possible loss of data + whtclpb.c(208) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'ULONG', possible loss of data + whtdll.c(298) : warning C4311: 'type cast' : pointer truncation from 'LPSTR' to 'DWORD' + whtdll.c(299) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'DWORD' + whtdll.c(306) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'DWORD' + whtlv.c(84) : warning C4267: 'argument' : conversion from 'size_t' to 'ULONG', possible loss of data + whtlv.c(109) : warning C4267: 'argument' : conversion from 'size_t' to 'ULONG', possible loss of data + whtmem.c(243) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'int', possible loss of data + whtmem.c(270) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'int', possible loss of data + whtmem.c(279) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'int', possible loss of data + whtreg.c(171) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data + whtshell.c(34) : warning C4267: 'argument' : conversion from 'size_t' to 'ULONG', possible loss of data + whtsys.c(1093) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'int', possible loss of data + whttext.c(127) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data + whttext.c(154) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data + whttext.c(190) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data + whttext.c(246) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data + whttext.c(299) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data + + - MSVS 2008 -W4 32-bit: + wincorec.c(434) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(438) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(442) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(446) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(450) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(454) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(458) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(462) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(466) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(470) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(486) : warning C4152: nonstandard extension, function/data pointer conversion in expression + wincorec.c(529) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'DLGPROC' + wincorec.c(543) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'DLGPROC' + wincorec.c(556) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'DLGPROC' + wincorec.c(569) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'DLGPROC' + whtsys.c(316) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'TIMERPROC' + whtwnd.c(197) : warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'WNDPROC' + + - MinGW 4.31 32-bit: + wincorec.c:94: warning: signed and unsigned type in conditional expression + wincorec.c:95: warning: signed and unsigned type in conditional expression + wincorec.c:96: warning: signed and unsigned type in conditional expression + wincorec.c:97: warning: signed and unsigned type in conditional expression + wincorec.c:119: warning: signed and unsigned type in conditional expression + wincorec.c:120: warning: signed and unsigned type in conditional expression + wincorec.c:121: warning: signed and unsigned type in conditional expression + wincorec.c:122: warning: signed and unsigned type in conditional expression + whtcdlg.c:180: warning: signed and unsigned type in conditional expression + whtdate.c:61: warning: passing argument 1 of 'hb_retptr' makes pointer from integer without a cast + whtdlg.c:169: warning: signed and unsigned type in conditional expression + whtmisc.c:95: warning: signed and unsigned type in conditional expression + whtmisc.c:349: warning: signed and unsigned type in conditional expression + whtseria.c:343: warning: signed and unsigned type in conditional expression + whtsock.c:43: warning: signed and unsigned type in conditional expression + whtsock.c:108: warning: signed and unsigned type in conditional expression + whtsock.c:124: warning: signed and unsigned type in conditional expression + whtsock.c:226: warning: signed and unsigned type in conditional expression + whtsock.c:246: warning: signed and unsigned type in conditional expression + whtsock.c:249: warning: signed and unsigned type in conditional expression + whtsock.c:318: warning: signed and unsigned type in conditional expression + whtsock.c:331: warning: signed and unsigned type in conditional expression + whtsock.c:338: warning: signed and unsigned type in conditional expression + whtsys.c:1091: warning: comparison between signed and unsigned + 2008-09-09 13:14 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbwhat32/whthead.c * contrib/hbwhat32/whtmmcap.c diff --git a/harbour/contrib/hbwhat32/hbwhat.h b/harbour/contrib/hbwhat32/hbwhat.h index cab06150e3..fdc82daed0 100644 --- a/harbour/contrib/hbwhat32/hbwhat.h +++ b/harbour/contrib/hbwhat32/hbwhat.h @@ -2,10 +2,18 @@ * $Id$ */ -//#define HB_PARWH( x ) hb_parnl( x ) -//#define HB_RETWH( x ) hb_retnl( ( LONG ) x ) -//#define HB_STORWH( x, y ) hb_stornl( ( LONG ) x, y ) +//#define HB_PARWH( x ) hb_parnl( x ) +//#define HB_RETWH( x ) hb_retnl( ( LONG ) x ) +//#define HB_STORWH( x, y ) hb_stornl( ( LONG ) x, y ) +//#define HB_ARRAYSETWH( x, y, z ) hb_arraySetNL( x, y, ( LONG ) z ) +//#define HB_PARWI( x ) hb_parni( x ) +//#define HB_RETWI( x ) hb_retni( x ) +//#define HB_STORWI( x, y ) hb_storni( ( HB_PTRDIFF ) x, y ) -#define HB_PARWH( x ) hb_parptr( x ) -#define HB_RETWH( x ) hb_retptr( x ) -#define HB_STORWH( x, y ) hb_storptr( x, y ) +#define HB_PARWH( x ) ( ISPOINTER( x ) ? hb_parptr( x ) : ( void * ) ( HB_PTRDIFF ) hb_parnint( x ) ) +#define HB_RETWH( x ) hb_retptr( x ) +#define HB_STORWH( x, y ) hb_storptr( x, y ) +#define HB_ARRAYSETWH( x, y, z ) hb_arraySetPtr( x, y, z ) +#define HB_PARWI( x ) ( ( HB_PTRDIFF ) hb_parnint( x ) ) +#define HB_RETWI( x ) hb_retnint( ( HB_PTRDIFF ) x ) +#define HB_STORWI( x, y ) hb_stornint( ( HB_PTRDIFF ) x, y ) diff --git a/harbour/contrib/hbwhat32/whtcall.c b/harbour/contrib/hbwhat32/whtcall.c index dedc5a640d..456bdd799a 100644 --- a/harbour/contrib/hbwhat32/whtcall.c +++ b/harbour/contrib/hbwhat32/whtcall.c @@ -100,7 +100,7 @@ typedef struct DYNAPARM //------------------------------------------------------------------ -RESULT DynaCall(int Flags, DWORD lpFunction, +RESULT DynaCall(int Flags, LPVOID lpFunction, int nArgs, DYNAPARM Parm[], LPVOID pRet, int nRetSiz) { diff --git a/harbour/contrib/hbwhat32/whtclpb.c b/harbour/contrib/hbwhat32/whtclpb.c index b4e1327c10..f61abe944b 100644 --- a/harbour/contrib/hbwhat32/whtclpb.c +++ b/harbour/contrib/hbwhat32/whtclpb.c @@ -275,10 +275,9 @@ HB_FUNC( SETCLIPBOARDDATA ) case CF_BITMAP: if( IsClipboardFormatAvailable( CF_BITMAP ) ) - hb_retl( ( BOOL ) SetClipboardData( CF_BITMAP, - DuplicateBitmap( ( HBITMAP ) HB_PARWH( 2 ) ) ) ); + hb_retl( SetClipboardData( CF_BITMAP, DuplicateBitmap( ( HBITMAP ) HB_PARWH( 2 ) ) ) != NULL ); else - hb_retnl( 0 ); + hb_retl( FALSE ); break; default: @@ -289,11 +288,11 @@ HB_FUNC( SETCLIPBOARDDATA ) pMem = GlobalLock( hMem ); memcpy( pMem, hb_parcx( 2 ), dwLen ); GlobalUnlock( hMem ); - hb_retnl( ( ULONG ) SetClipboardData( ( UINT ) hb_parni( 1 ), hMem ) ); + HB_RETWH( SetClipboardData( ( UINT ) hb_parni( 1 ), hMem ) ); } else { - hb_retnl( 0 ); + HB_RETWH( 0 ); } break; } diff --git a/harbour/contrib/hbwhat32/whtcomm.c b/harbour/contrib/hbwhat32/whtcomm.c index a8c183fcef..bb73d860bc 100644 --- a/harbour/contrib/hbwhat32/whtcomm.c +++ b/harbour/contrib/hbwhat32/whtcomm.c @@ -273,8 +273,8 @@ HB_FUNC( INITLISTVIEW ) hbutton = CreateWindowEx(WS_EX_CLIENTEDGE,"SysListView32","", LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_BORDER | LVS_REPORT, - hb_parni(3), hb_parni(4) , hb_parni(5), hb_parni(6) , - hwnd,(HMENU)hb_parni(2) , GetModuleHandle(NULL) , NULL ); + hb_parni(3), hb_parni(4), hb_parni(5), hb_parni(6) , + hwnd, ( HMENU ) HB_PARWH(2), GetModuleHandle(NULL) , NULL ); SendMessage(hbutton,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP ); diff --git a/harbour/contrib/hbwhat32/whtdll.c b/harbour/contrib/hbwhat32/whtdll.c index 2f825f302f..8425ed3746 100644 --- a/harbour/contrib/hbwhat32/whtdll.c +++ b/harbour/contrib/hbwhat32/whtdll.c @@ -243,7 +243,7 @@ typedef struct DYNAPARM { // #define CTYPE_STRUCTURE 1000 #define CTYPE_STRUCTURE_PTR 10000 -extern RESULT DynaCall(int Flags, DWORD lpFunction, +extern RESULT DynaCall(int Flags, LPVOID lpFunction, int nArgs, DYNAPARM Parm[], LPVOID pRet, int nRetSiz); @@ -262,13 +262,13 @@ HB_FUNC( CALLDLL ) double DblParms[15]; DYNAPARM Parm[15]; HINSTANCE hInst = (HINSTANCE) HB_PARWH( 1 ); - DWORD lpFunction = (DWORD) HB_PARWH( 2 ); + LPVOID lpFunction = ( LPVOID ) HB_PARWH( 2 ); RESULT rc; if ( hInst == NULL ) return; - if ((LPVOID)lpFunction == NULL) + if ( lpFunction == NULL ) return; if ( ISNIL(3) ) @@ -294,16 +294,16 @@ HB_FUNC( CALLDLL ) { case CTYPE_CHAR_PTR : Parm[iCnt].nWidth = sizeof( char * ); - if ( ISNIL(i) ) Parm[iCnt].numargs.pArg = NULL; + if( ISNIL(i) ) Parm[iCnt].numargs.pArg = NULL; else if (ISNUM(i) ) Parm[iCnt].numargs.dwArg = (DWORD) MAKEINTRESOURCE( hb_parni( i ) ); - else Parm[iCnt].numargs.dwArg = ( DWORD ) hb_parc ( i ); + else Parm[iCnt].numargs.dwArg = ( DWORD ) hb_parc( i ); iCnt++; break; case CTYPE_STRUCTURE_PTR : case CTYPE_UNSIGNED_CHAR_PTR : Parm[iCnt].nWidth = sizeof( unsigned char * ); if ( ISNIL(i) ) Parm[iCnt].numargs.pArg = NULL; - else Parm[iCnt].numargs.dwArg = ( DWORD ) hb_parc ( i ); + else Parm[iCnt].numargs.dwArg = ( DWORD ) hb_parc( i ); iCnt++; break; case CTYPE_BOOL : diff --git a/harbour/contrib/hbwhat32/whtgdi.c b/harbour/contrib/hbwhat32/whtgdi.c index a3a277cc44..97c826831d 100644 --- a/harbour/contrib/hbwhat32/whtgdi.c +++ b/harbour/contrib/hbwhat32/whtgdi.c @@ -806,13 +806,13 @@ HB_FUNC( GETDRAWITEMSTRUCT ) hb_arraySetNL( arrDis, 3, dis->itemID ); hb_arraySetNL( arrDis, 4, dis->itemAction ); hb_arraySetNL( arrDis, 5, dis->itemState ); - hb_arraySetNL( arrDis, 6, ( LONG ) dis->hwndItem ); - hb_arraySetNL( arrDis, 7, ( LONG ) dis->hDC ); + HB_ARRAYSETWH( arrDis, 6, dis->hwndItem ); + HB_ARRAYSETWH( arrDis, 7, dis->hDC ); hb_arraySetNL( arrDis, 8, dis->rcItem.left ); hb_arraySetNL( arrDis, 9, dis->rcItem.top ); hb_arraySetNL( arrDis, 10, dis->rcItem.right ); hb_arraySetNL( arrDis, 11, dis->rcItem.bottom ); - hb_arraySetNL( arrDis, 12, dis->itemData ); + hb_arraySetNInt( arrDis, 12, ( HB_PTRDIFF ) dis->itemData ); hb_itemReturnRelease( arrDis ); } diff --git a/harbour/contrib/hbwhat32/whtilst.c b/harbour/contrib/hbwhat32/whtilst.c index 232d9759da..1e9287aafc 100644 --- a/harbour/contrib/hbwhat32/whtilst.c +++ b/harbour/contrib/hbwhat32/whtilst.c @@ -25,7 +25,7 @@ HB_FUNC( IMAGELIST_CREATE ) { HIMAGELIST ilist; ilist = ImageList_Create( hb_parni(1), hb_parni(2), hb_parnl(3), hb_parni(4), hb_parni(5)); - hb_retnl((LONG) ilist); + HB_RETWH( ilist ); } //----------------------------------------------------------------------------- diff --git a/harbour/contrib/hbwhat32/whtinet.c b/harbour/contrib/hbwhat32/whtinet.c index 47ceb7b16d..418acd2f66 100644 --- a/harbour/contrib/hbwhat32/whtinet.c +++ b/harbour/contrib/hbwhat32/whtinet.c @@ -115,7 +115,7 @@ HB_FUNC( INTERNETOPEN ) LPCTSTR lpszProxyBypass = ISNIL( 4 ) ? NULL : hb_parcx( 4 ); DWORD dwFlags = ISNIL( 5 ) ? 0 : hb_parnl( 5 ); - hb_retnl( ( ULONG ) InternetOpen( lpszAgent, dwAccessType, lpszProxyName, lpszProxyBypass, dwFlags ) ); + HB_RETWH( InternetOpen( lpszAgent, dwAccessType, lpszProxyName, lpszProxyBypass, dwFlags ) ); } //---------------------------------------------------------------------// @@ -147,9 +147,9 @@ HB_FUNC( INTERNETCONNECT ) DWORD dwFlags = ISNIL( 7 ) ? 0 : hb_parnl( 7 ); DWORD_PTR dwContext = ISNIL( 8 ) ? 0 : hb_parnl( 8 ); - hb_retnl( ( ULONG ) InternetConnect( hInternet, lpszServerName, - nServerPort, lpszUserName, lpszPassword, - dwService, dwFlags, dwContext ) ); + HB_RETWH( InternetConnect( hInternet, lpszServerName, + nServerPort, lpszUserName, lpszPassword, + dwService, dwFlags, dwContext ) ); } //---------------------------------------------------------------------// @@ -197,13 +197,13 @@ HB_FUNC( INTERNETWRITEFILE ) HINTERNET hFile = ( HINTERNET ) HB_PARWH( 1 ); LPCVOID lpBuffer = hb_parcx( 2 ); DWORD dwNumberOfBytesToWrite = ( DWORD ) hb_parnl( 3 ); - LPDWORD lpdwNumberOfBytesWritten = ( LPDWORD ) 0 ; + DWORD dwNumberOfBytesWritten = ( DWORD ) 0 ; hb_retl( InternetWriteFile( hFile, lpBuffer, dwNumberOfBytesToWrite, - lpdwNumberOfBytesWritten ) ); + &dwNumberOfBytesWritten ) ); if ISBYREF( 4 ) - hb_stornl( ( ULONG ) lpdwNumberOfBytesWritten, 4 ); + hb_stornl( ( ULONG ) dwNumberOfBytesWritten, 4 ); } //---------------------------------------------------------------------// @@ -225,11 +225,11 @@ HB_FUNC( INTERNETREADFILE ) HINTERNET hFile = ( HINTERNET ) HB_PARWH( 1 ); LPVOID lpBuffer = hb_parcx( 2 ); DWORD dwNumberOfBytesToRead = ( DWORD ) hb_parnl( 3 ); - LPDWORD lpdwNumberOfBytesRead = ( LPDWORD ) 0 ; - BOOL bRet ; + DWORD dwNumberOfBytesRead = ( DWORD ) 0; + BOOL bRet; bRet = InternetReadFile( hFile, &lpBuffer, - dwNumberOfBytesToRead, lpdwNumberOfBytesRead ); + dwNumberOfBytesToRead, &dwNumberOfBytesRead ); hb_retl( bRet ); @@ -237,9 +237,9 @@ HB_FUNC( INTERNETREADFILE ) { if ISBYREF( 4 ) { - hb_stornl( ( ULONG ) lpdwNumberOfBytesRead, 4 ); + hb_stornl( ( ULONG ) dwNumberOfBytesRead, 4 ); } - hb_storclen( ( char * ) lpBuffer, ( ULONG ) lpdwNumberOfBytesRead, 2 ); + hb_storclen( ( char * ) lpBuffer, ( ULONG ) dwNumberOfBytesRead, 2 ); } } @@ -276,7 +276,7 @@ HB_FUNC( FTPCOMMAND ) if ( bRet ) { if ( ISBYREF( 6 ) ) - hb_stornl( ( ULONG ) phFtpCommand, 6 ); + HB_STORWH( phFtpCommand, 6 ); } } //---------------------------------------------------------------------// @@ -365,7 +365,7 @@ HB_FUNC( FTPFINDFIRSTFILE ) if ( ISBYREF( 3 ) ) hb_storclen( (char *) &FindFileData , sizeof( WIN32_FIND_DATA ), 3 ); - hb_retnl( ( ULONG ) hResult ); + HB_RETWH( hResult ); } //---------------------------------------------------------------------// diff --git a/harbour/contrib/hbwhat32/whtini.c b/harbour/contrib/hbwhat32/whtini.c index 1cdf9858c4..d9abdb14a2 100644 --- a/harbour/contrib/hbwhat32/whtini.c +++ b/harbour/contrib/hbwhat32/whtini.c @@ -77,7 +77,7 @@ HB_FUNC( GETPROFILESTRING ) char * lpEntry = ISNIL( 2 ) ? NULL : hb_parcx( 2 ); char * lpDefault = hb_parc ( 3 ); - while ( TRUE ) + for( ;; ) { dwLen = GetProfileString( lpSection , lpEntry ,lpDefault , bBuffer, nSize ); if ( ( ( ( lpSection == NULL ) || ( lpEntry == NULL ) ) && ( nSize - dwLen == 2 ) ) || ( ( lpSection && lpEntry ) && ( nSize - dwLen == 1 ) ) ) @@ -88,7 +88,6 @@ HB_FUNC( GETPROFILESTRING ) } else break ; - } if( dwLen ) @@ -111,7 +110,7 @@ HB_FUNC( GETPRIVATEPROFILESTRING ) char * lpDefault = hb_parcx( 3 ); char * lpFileName = hb_parcx( 4 ); - while ( TRUE ) + for( ;; ) { dwLen = GetPrivateProfileString( lpSection , lpEntry ,lpDefault , bBuffer, nSize , lpFileName); if ( ( ( ( lpSection == NULL ) || ( lpEntry == NULL ) ) && ( nSize - dwLen == 2 ) ) || ( ( lpSection && lpEntry ) && ( nSize - dwLen == 1 ) ) ) @@ -124,6 +123,7 @@ HB_FUNC( GETPRIVATEPROFILESTRING ) break ; } + if( dwLen ) hb_retclen( ( char * ) bBuffer, dwLen ); else diff --git a/harbour/contrib/hbwhat32/whtmisc.c b/harbour/contrib/hbwhat32/whtmisc.c index 7c2e1c3263..d25b42358c 100644 --- a/harbour/contrib/hbwhat32/whtmisc.c +++ b/harbour/contrib/hbwhat32/whtmisc.c @@ -28,43 +28,43 @@ HB_FUNC( STR2PTR ) { - char *cStr = hb_parcx( 1 ) ; - hb_retnl( ( LONG_PTR ) cStr ); + char *cStr = hb_parcx( 1 ); + HB_RETWI( cStr ); } //----------------------------------------------------------------------------- HB_FUNC( PEEKW ) { - hb_retni( * ( LPWORD ) hb_parnint( 1 ) ); + hb_retni( ( int ) ( * ( LPWORD ) HB_PARWI( 1 ) ) ); } //----------------------------------------------------------------------------- HB_FUNC( PEEKL ) { - hb_retnl( * (LPDWORD) hb_parnint( 1 ) ); + hb_retnl( ( long ) ( * (LPDWORD) HB_PARWI( 1 ) ) ); } //----------------------------------------------------------------------------- HB_FUNC( PEEKB ) { - hb_retni( * ( LPBYTE ) hb_parnint( 1 ) ); + hb_retni( ( int ) ( * ( LPBYTE ) HB_PARWI( 1 ) ) ); } //----------------------------------------------------------------------------- HB_FUNC( POKEW ) { - * ( LPWORD ) hb_parnint( 1 ) = (WORD) hb_parni( 2 ); + * ( LPWORD ) HB_PARWI( 1 ) = (WORD) hb_parni( 2 ); } //----------------------------------------------------------------------------- HB_FUNC( POKEL ) { - * ( LPLONG ) hb_parnint( 1 ) = (DWORD) hb_parnl( 2 ); + * ( LPLONG ) HB_PARWI( 1 ) = (DWORD) hb_parnl( 2 ); } @@ -72,7 +72,7 @@ HB_FUNC( POKEL ) HB_FUNC( POKEB ) { - * ( LPBYTE ) hb_parnint( 1 ) = ( BYTE ) hb_parni( 2 ); + * ( LPBYTE ) HB_PARWI( 1 ) = ( BYTE ) hb_parni( 2 ); } @@ -82,9 +82,9 @@ HB_FUNC( POKEB ) HB_FUNC( PEEK ) { if ( hb_pcount()==2 ) - hb_retclen( (char *) hb_parnint( 1 ), hb_parnl( 2 ) ); + hb_retclen( (char *) HB_PARWI( 1 ), hb_parnl( 2 ) ); else - hb_retc( (char *) hb_parnint( 1 ) ); + hb_retc( (char *) HB_PARWI( 1 ) ); } //----------------------------------------------------------------------------- @@ -92,10 +92,7 @@ HB_FUNC( PEEK ) HB_FUNC( POKE ) { - if( hb_pcount() ==3 ) - hb_xmemcpy( (char *) hb_parnint(1), hb_parcx( 2 ), hb_parnl( 3 ) ); - else - hb_xmemcpy( (char *) hb_parnint(1), hb_parcx( 2 ), hb_parclen( 2 ) ); + hb_xmemcpy( (char *) HB_PARWI(1), hb_parcx( 2 ), hb_pcount() == 3 ? hb_parnl( 3 ) : hb_parclen( 2 ) ); } @@ -378,8 +375,7 @@ HB_FUNC( CHECKBIT ) HB_FUNC( GETENVIRONMENTSTRINGS ) { - // TOFIX - hb_retnl( (LONG) GetEnvironmentStrings( ) ); + HB_RETWI( GetEnvironmentStrings() ); } @@ -389,8 +385,7 @@ HB_FUNC( GETENVIRONMENTSTRINGS ) HB_FUNC( FREEENVIRONMENTSTRINGS ) { - // TOFIX - hb_retl( (LONG) FreeEnvironmentStrings( (LPTSTR) hb_parnl(1) ) ); + hb_retl( (LONG) FreeEnvironmentStrings( (LPTSTR) HB_PARWI( 1 ) ) ); } @@ -457,14 +452,13 @@ HB_FUNC( WINEXEC ) // Helper routine. Take an input pointer, return closest // pointer that is aligned on a DWORD (4 byte) boundary. -LPWORD lpwAlign ( LPWORD lpIn) +LPWORD lpwAlign( LPWORD lpIn ) { - ULONG ul; - ul = (ULONG) lpIn; - ul +=3; - ul >>=2; - ul <<=2; - return (LPWORD) ul; + HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn; + ul += 3; + ul >>=2; + ul <<=2; + return ( LPWORD ) ul; } //----------------------------------------------------------------------------- @@ -516,7 +510,7 @@ HB_FUNC( CREATEMUTEX ) sa = (SECURITY_ATTRIBUTES *) hb_parc( 1 ); //hb_param( 1, HB_IT_STRING )->item.asString.value; } - hb_retnl( (ULONG) CreateMutex( ISNIL( 1 ) ? NULL : sa, hb_parnl( 2 ), hb_parcx( 3 ) ) ); + HB_RETWH( CreateMutex( ISNIL( 1 ) ? NULL : sa, hb_parnl( 2 ), hb_parcx( 3 ) ) ); } //---------------------------------------------------------------------------- @@ -524,7 +518,7 @@ HB_FUNC( CREATEMUTEX ) HB_FUNC( OPENMUTEX ) { - hb_retnl( (ULONG) OpenMutex( hb_parnl( 1 ), hb_parl( 2 ), hb_parcx( 3 ) ) ); + HB_RETWH( OpenMutex( hb_parnl( 1 ), hb_parl( 2 ), hb_parcx( 3 ) ) ); } //---------------------------------------------------------------------------- diff --git a/harbour/contrib/hbwhat32/whtmmcap.c b/harbour/contrib/hbwhat32/whtmmcap.c index ee919867e9..ff478929dc 100644 --- a/harbour/contrib/hbwhat32/whtmmcap.c +++ b/harbour/contrib/hbwhat32/whtmmcap.c @@ -629,7 +629,7 @@ HB_FUNC( CAPGETMCIDEVICENAME ) /* To check: the return must be a LONG */ HB_FUNC( CAPGETUSERDATA ) { - hb_retl( capGetUserData( (HWND) HB_PARWH(1) ) ); + hb_retl( capGetUserData( (HWND) HB_PARWH(1) ) != 0 ); } /* ------------------------------------------------------------------------ */ diff --git a/harbour/contrib/hbwhat32/whtmsg.c b/harbour/contrib/hbwhat32/whtmsg.c index 63f35b4f7c..806d554c5b 100644 --- a/harbour/contrib/hbwhat32/whtmsg.c +++ b/harbour/contrib/hbwhat32/whtmsg.c @@ -50,7 +50,7 @@ HB_FUNC( TRANSLATEMESSAGE ) HB_FUNC( DISPATCHMESSAGE ) { - hb_retnl(DispatchMessage( (MSG*) hb_parcx(1))); + HB_RETWI( DispatchMessage( ( MSG * ) hb_parcx( 1 ) ) ); } //----------------------------------------------------------------------------- @@ -373,7 +373,7 @@ HB_FUNC( INSENDMESSAGEEX ) HB_FUNC( MSGWAITFORMULTIPLEOBJECTS ) { hb_retnl( (LONG) MsgWaitForMultipleObjects( (DWORD) hb_parnl( 1 ) , - (HANDLE *) hb_parnl( 2 ), + (HANDLE *) HB_PARWI( 2 ), hb_parl( 3 ) , (DWORD) hb_parnl( 4 ) , (DWORD) hb_parnl( 5 ) @@ -387,7 +387,7 @@ HB_FUNC( MSGWAITFORMULTIPLEOBJECTS ) HB_FUNC( MSGWAITFORMULTIPLEOBJECTSEX ) { hb_retnl( (LONG) MsgWaitForMultipleObjectsEx( (DWORD) hb_parnl( 1 ) , - (HANDLE *) hb_parnl( 2 ), + (HANDLE *) HB_PARWI( 2 ), (DWORD) hb_parnl( 3 ) , (DWORD) hb_parnl( 4 ) , (DWORD) hb_parnl( 5 ) diff --git a/harbour/contrib/hbwhat32/whtsock.c b/harbour/contrib/hbwhat32/whtsock.c index 1fae273346..59079c8cf3 100644 --- a/harbour/contrib/hbwhat32/whtsock.c +++ b/harbour/contrib/hbwhat32/whtsock.c @@ -767,13 +767,14 @@ int _stdcall _WSACondFunc( LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS lp hb_vmPushSymbol( (HB_SYMB *) dwCallbackData ); // Harbour function pointer hb_vmPushNil(); - hb_vmPushLong( (LONG ) lpCallerId ); - hb_vmPushLong( (LONG ) lpCallerData ); - hb_vmPushLong( (LONG ) lpSQOS ); - hb_vmPushLong( (LONG ) lpGQOS ); - hb_vmPushLong( (LONG ) lpCalleeId ); - hb_vmPushLong( (LONG ) lpCalleeData ); - hb_vmPushLong( (LONG ) g ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpCallerId ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpCallerId ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpCallerData ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpSQOS ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpGQOS ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpCalleeId ); + hb_vmPushNumInt( ( HB_PTRDIFF ) lpCalleeData ); + hb_vmPushNumInt( ( HB_PTRDIFF ) g ); hb_vmDo(7); res = hb_itemGetNI( (PHB_ITEM) hb_param( -1, HB_IT_ANY ) ); @@ -826,7 +827,7 @@ HB_FUNC( WSAACCEPT ) HB_FUNC( WSACLOSEEVENT ) { - hb_retl( ( BOOL ) WSACloseEvent( (WSAEVENT) hb_parnl( 1 ) ) ); + hb_retl( ( BOOL ) WSACloseEvent( (WSAEVENT) HB_PARWH( 1 ) ) ); } @@ -889,7 +890,7 @@ HB_FUNC( WSACONNECT ) HB_FUNC( WSACREATEEVENT ) { - hb_retnl( ( ULONG) WSACreateEvent( ) ); + HB_RETWH( WSACreateEvent( ) ); } @@ -964,8 +965,8 @@ HB_FUNC( WSAENUMPROTOCOLS ) HB_FUNC( WSAEVENTSELECT ) { - hb_retni( (int ) WSAEventSelect( (SOCKET) hb_parnl( 1 ) , - (WSAEVENT) hb_parnl( 2 ) , + hb_retni( (int ) WSAEventSelect( (SOCKET) hb_parnl( 1 ), + (WSAEVENT) HB_PARWH( 2 ), (long) hb_parnl( 3 ) ) ); } @@ -1235,7 +1236,7 @@ HB_FUNC( WSARECVFROM ) HB_FUNC( WSARESETEVENT ) { - hb_retl( WSAResetEvent( (WSAEVENT) hb_parnl( 1 ) ) ); + hb_retl( WSAResetEvent( (WSAEVENT) HB_PARWH( 1 ) ) ); } @@ -1322,7 +1323,7 @@ HB_FUNC( WSASENDTO ) HB_FUNC( WSASETEVENT ) { - hb_retl( WSASetEvent( (WSAEVENT) hb_parnl( 1 ) ) ); + hb_retl( WSASetEvent( (WSAEVENT) HB_PARWH( 1 ) ) ); } diff --git a/harbour/contrib/hbwhat32/whtsys.c b/harbour/contrib/hbwhat32/whtsys.c index 42ed8dc1db..a86c6f56c1 100644 --- a/harbour/contrib/hbwhat32/whtsys.c +++ b/harbour/contrib/hbwhat32/whtsys.c @@ -309,8 +309,8 @@ HB_FUNC( GETSYSTEMMETRICS ) // HB_FUNC( SETTIMER ) { - hb_retni( SetTimer( (HWND) HB_PARWH( 1 ), - (UINT) hb_parni( 2 ), + HB_RETWI( SetTimer( (HWND) HB_PARWH( 1 ), + ( UINT_PTR ) HB_PARWI( 2 ), (UINT) hb_parni( 3 ), ISNIL(4) ? NULL : (TIMERPROC) HB_PARWH(4) ) ); @@ -1038,7 +1038,7 @@ DWORD GetCurrentProcess( VOID ) */ HB_FUNC( GETCURRENTPROCESS ) { - hb_retnl( (LONG) GetCurrentProcess() ); + hb_retptr( GetCurrentProcess() ); } //-------------------------------------------------------------------// diff --git a/harbour/contrib/hbwhat32/whttab.c b/harbour/contrib/hbwhat32/whttab.c index 0ee6591837..bf1e606163 100644 --- a/harbour/contrib/hbwhat32/whttab.c +++ b/harbour/contrib/hbwhat32/whttab.c @@ -25,7 +25,7 @@ HB_FUNC( TABCTRL_CREATE ) { HWND hwnd; HWND hbutton; - LONG hFont; + LRESULT hFont; LONG style; style = ISNIL(6) ? 0 : (LONG) hb_parnl(6); hwnd = (HWND) HB_PARWH (1); @@ -136,7 +136,7 @@ HB_FUNC( TABCTRL_GETIMAGELIST ) HB_FUNC( TABCTRL_SETIMAGELIST ) { HB_RETWH( TabCtrl_SetImageList( (HWND) HB_PARWH( 1 ), - (LPARAM)(HIMAGELIST) hb_parnl( 2 ) ) ); + (LPARAM)(HIMAGELIST) HB_PARWH( 2 ) ) ); } diff --git a/harbour/contrib/hbwhat32/whttree.c b/harbour/contrib/hbwhat32/whttree.c index 7d06504339..4718925939 100644 --- a/harbour/contrib/hbwhat32/whttree.c +++ b/harbour/contrib/hbwhat32/whttree.c @@ -31,7 +31,7 @@ HB_FUNC( TVINSERTITEM ) is.item.iSelectedImage = hb_parnl( 4 ); #endif - hb_retnl( SendMessage( ( HWND ) HB_PARWH( 1 ), TVM_INSERTITEM, 0, + HB_RETWI( SendMessage( ( HWND ) HB_PARWH( 1 ), TVM_INSERTITEM, 0, ( LPARAM )( LPTV_INSERTSTRUCT )( &is ) ) ); } @@ -45,7 +45,7 @@ HB_FUNC( TVDELETEITEM ) HB_FUNC( TVSETIMAGELIST ) // ( hWnd, hImageList, nType ) { - hb_retnl( ( LONG ) TreeView_SetImageList( ( HWND ) HB_PARWH( 1 ), + HB_RETWH( TreeView_SetImageList( ( HWND ) HB_PARWH( 1 ), ( HIMAGELIST ) HB_PARWH( 2 ), hb_parnl( 3 ) ) ); } @@ -74,7 +74,7 @@ HB_FUNC( TVGETSELTEXT ) // ( hWnd ) --> cText HB_FUNC( TVGETSELECTED ) // ( hWnd ) --> hItem { - hb_retnl( ( LONG ) TreeView_GetSelection( ( HWND ) HB_PARWH( 1 ) ) ); + HB_RETWH( TreeView_GetSelection( ( HWND ) HB_PARWH( 1 ) ) ); } //-------------------------------------------------------------------------// diff --git a/harbour/contrib/hbwhat32/whtwnd.c b/harbour/contrib/hbwhat32/whtwnd.c index a060fbf4f7..34ff542e85 100644 --- a/harbour/contrib/hbwhat32/whtwnd.c +++ b/harbour/contrib/hbwhat32/whtwnd.c @@ -65,7 +65,7 @@ HB_FUNC( CLOSEWINDOW ) HB_FUNC( FINDWINDOW ) { - hb_retnl((ULONG) FindWindow( (LPCSTR) hb_parcx(1), ISCHAR(2) ? hb_parcx(2):NULL ) ); + HB_RETWH( FindWindow( (LPCSTR) hb_parcx(1), ISCHAR(2) ? hb_parcx(2):NULL ) ); } //----------------------------------------------------------------------------- @@ -165,28 +165,28 @@ HB_FUNC( MOVEWINDOW ) HB_FUNC( DEFWINDOWPROC ) { - hb_retnl( DefWindowProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); + HB_RETWI( DefWindowProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); } //----------------------------------------------------------------------------- HB_FUNC( DEFDLGPROC ) { - hb_retnl( DefDlgProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); + HB_RETWI( DefDlgProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); } //----------------------------------------------------------------------------- HB_FUNC( DEFMDICHILDPROC ) { - hb_retnl( DefMDIChildProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); + HB_RETWI( DefMDIChildProc( (HWND) HB_PARWH(1), hb_parnl(2), hb_parnl(3), hb_parnl(4))); } //----------------------------------------------------------------------------- HB_FUNC( DEFFRAMEPROC ) { - hb_retnl( DefFrameProc( (HWND) HB_PARWH(1), (HWND) HB_PARWH(2), hb_parnl(3), hb_parnl(4), hb_parnl(5))); + HB_RETWI( DefFrameProc( (HWND) HB_PARWH(1), (HWND) HB_PARWH(2), hb_parnl(3), hb_parnl(4), hb_parnl(5))); } @@ -194,7 +194,7 @@ HB_FUNC( DEFFRAMEPROC ) HB_FUNC( CALLWINDOWPROC ) { - hb_retnl( CallWindowProc( (WNDPROC) hb_parptr(1), (HWND) HB_PARWH(2), hb_parni(3), hb_parnl(4), hb_parnl(5))); + HB_RETWI( CallWindowProc( (WNDPROC) HB_PARWH(1), (HWND) HB_PARWH(2), hb_parni(3), hb_parnl(4), hb_parnl(5))); } //----------------------------------------------------------------------------- @@ -1017,7 +1017,7 @@ HB_FUNC( SETWINDOWLONGPTR ) { hb_retnl( (LONG) SetWindowLongPtr( (HWND) HB_PARWH( 1 ), hb_parni( 2 ) , - ISPOINTER( 3 ) ? (LONG_PTR) hb_parptr( 3 ) : (LONG_PTR) hb_parnl( 3 ) + (LONG_PTR) HB_PARWH( 3 ) ) ); } @@ -1026,7 +1026,7 @@ HB_FUNC( SETWINDOWLONGPTR ) #ifndef __WATCOMC__ HB_FUNC( GETCLASSLONGPTR ) { - hb_retnl((ULONG_PTR) GetClassLongPtr( (HWND) HB_PARWH( 1 ), hb_parni( 2 ) ) ); + HB_RETWI( GetClassLongPtr( (HWND) HB_PARWH( 1 ), hb_parni( 2 ) ) ); } //----------------------------------------------------------------------------- @@ -1034,7 +1034,7 @@ HB_FUNC( GETCLASSLONGPTR ) HB_FUNC( SETCLASSLONGPTR ) { - hb_retnl( (ULONG_PTR) SetClassLongPtr( (HWND) HB_PARWH( 1 ), hb_parni( 2 ), (LONG_PTR) hb_parnl(3) ) ); + HB_RETWI( SetClassLongPtr( (HWND) HB_PARWH( 1 ), hb_parni( 2 ), (LONG_PTR) hb_parnl(3) ) ); } #endif diff --git a/harbour/contrib/hbwhat32/wincorec.c b/harbour/contrib/hbwhat32/wincorec.c index bca13a4f5e..dd5af30038 100644 --- a/harbour/contrib/hbwhat32/wincorec.c +++ b/harbour/contrib/hbwhat32/wincorec.c @@ -146,10 +146,10 @@ LRESULT CALLBACK __WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 1 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -175,10 +175,10 @@ LRESULT CALLBACK __WndProc2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 2 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -204,10 +204,10 @@ LRESULT CALLBACK __WndProc3 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 3 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -233,10 +233,10 @@ LRESULT CALLBACK __WndProc4 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 4 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -262,10 +262,10 @@ LRESULT CALLBACK __WndProc5 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 5 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -290,10 +290,10 @@ LRESULT CALLBACK __WndProc6 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 6 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -319,10 +319,10 @@ LRESULT CALLBACK __WndProc7 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 7 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -348,10 +348,10 @@ LRESULT CALLBACK __WndProc8 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 8 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -377,10 +377,10 @@ LRESULT CALLBACK __WndProc9 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 9 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -406,10 +406,10 @@ LRESULT CALLBACK __WndProc10 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmPushLong( 10 ); hb_vmDo( 5 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -501,10 +501,10 @@ BOOL CALLBACK __DlgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) //hb_vmPushSymbol( pSymTest->pSymbol ); hb_vmPushSymbol( hb_itemGetSymbol( pSymTest ) ); hb_vmPushNil(); - hb_vmPushLong( (LONG ) hWnd ); + hb_vmPushNumInt( ( HB_PTRDIFF ) hWnd ); hb_vmPushLong( (LONG ) message ); - hb_vmPushLong( (LONG ) wParam ); - hb_vmPushLong( (LONG ) lParam ); + hb_vmPushNumInt( ( HB_LONG ) wParam ); + hb_vmPushNumInt( ( HB_LONG ) lParam ); hb_vmDo( 4 ); res = hb_itemGetNL( hb_param( -1, HB_IT_ANY ) ); @@ -522,10 +522,10 @@ HB_FUNC( _DIALOGBOX ) { - hb_retni( DialogBox( (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ) , + HB_RETWI( DialogBox( (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ) , (hb_parinfo(2)==HB_IT_STRING ? hb_parc(2) : MAKEINTRESOURCE( (WORD) hb_parni(2))) , (ISNIL(3) ? NULL : (HWND) HB_PARWH(3) ) , - (DLGPROC) hb_parptr(4) + (DLGPROC) HB_PARWH(4) )); } @@ -536,10 +536,10 @@ HB_FUNC( _DIALOGBOX ) HB_FUNC( _DIALOGBOXINDIRECT ) { - hb_retni( DialogBoxIndirect( (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ), + HB_RETWI( DialogBoxIndirect( (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ), (LPDLGTEMPLATE) hb_parc(2), (ISNIL(3) ? NULL : (HWND) HB_PARWH(3) ), - (DLGPROC) hb_parptr(4) + (DLGPROC) HB_PARWH(4) )); } @@ -552,7 +552,7 @@ HB_FUNC( _CREATEDIALOG ) HB_RETWH( CreateDialog( (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ), (hb_parinfo(2)==HB_IT_STRING ? hb_parc(2) : MAKEINTRESOURCE( (WORD) hb_parni(2))), (ISNIL(3) ? NULL : (HWND) HB_PARWH(3) ), - (DLGPROC) hb_parptr(4) + (DLGPROC) HB_PARWH(4) ) ); } @@ -565,7 +565,7 @@ HB_FUNC( _CREATEDIALOGINDIRECT ) (ISNIL(1) ? GetModuleHandle(NULL) : (HINSTANCE) HB_PARWH(1) ), (LPDLGTEMPLATE) hb_parc(2), (ISNIL(3) ? NULL : (HWND) HB_PARWH(3) ), - (DLGPROC) hb_parptr(4) + (DLGPROC) HB_PARWH(4) )); } @@ -686,7 +686,7 @@ HB_FUNC( _MAKEDLGTEMPLATE ) p = lpwAlign (p) ; - hb_retclen( (LPSTR) pdlgtemplate, ( (ULONG) p - (ULONG) pdlgtemplate ) ); + hb_retclen( (LPSTR) pdlgtemplate, ( ( HB_PTRDIFF ) p - ( HB_PTRDIFF ) pdlgtemplate ) ); LocalFree (LocalHandle (pdlgtemplate) ); }