From cd2e9902426fd329d619a8103fed4c1a1fc452b2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 10 Jul 2009 00:23:44 +0000 Subject: [PATCH] 2009-07-10 02:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbgtcore.h * include/hbapigt.h * include/hbapi.h * source/rtl/scroll.c * source/rtl/maxrow.c * source/rtl/gtapi.c * source/rtl/saverest.c * source/rtl/console.c * source/rtl/oldclear.c * source/rtl/hbgtcore.c * source/rtl/scrrow.c * source/rtl/shadow.c * source/rtl/setcurs.c * source/rtl/mouse53.c * source/rtl/gx.c * source/rtl/mouseapi.c * contrib/hbct/cursor.c * contrib/hbct/ctwfunc.c * contrib/hbclipsm/gauge.c * Changed all USHORT to int in high-level GT API layer which already had an int representation on the low-level. Please review me. It's possible that some extra checks (or else) need to be added since signedness has changed. * Change mouse state buffer from char * to void *. ; TODO: Review remaining BYTE/USHORT usage for attr, color and char. Char is sometimes represented by UCHAR, sometimes by char and sometimes by USHORT. Color is represented by both int and BYTE. attr is BYTE, which can be changed to hbU8. --- harbour/ChangeLog | 31 +++++++ harbour/contrib/hbclipsm/gauge.c | 2 +- harbour/contrib/hbct/ctwfunc.c | 12 +-- harbour/contrib/hbct/cursor.c | 14 +-- harbour/include/hbapi.h | 2 +- harbour/include/hbapigt.h | 42 ++++----- harbour/include/hbgtcore.h | 4 +- harbour/source/rtl/console.c | 10 +-- harbour/source/rtl/gtapi.c | 144 ++++++++++++++++--------------- harbour/source/rtl/gx.c | 10 +-- harbour/source/rtl/hbgtcore.c | 4 +- harbour/source/rtl/maxrow.c | 12 +-- harbour/source/rtl/mouse53.c | 8 +- harbour/source/rtl/mouseapi.c | 4 +- harbour/source/rtl/oldclear.c | 8 +- harbour/source/rtl/saverest.c | 32 +++---- harbour/source/rtl/scroll.c | 8 +- harbour/source/rtl/scrrow.c | 12 +-- harbour/source/rtl/setcurs.c | 20 ++--- harbour/source/rtl/shadow.c | 16 ++-- 20 files changed, 212 insertions(+), 183 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7dcdfda4b2..18bab17871 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,37 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-10 02:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbgtcore.h + * include/hbapigt.h + * include/hbapi.h + * source/rtl/scroll.c + * source/rtl/maxrow.c + * source/rtl/gtapi.c + * source/rtl/saverest.c + * source/rtl/console.c + * source/rtl/oldclear.c + * source/rtl/hbgtcore.c + * source/rtl/scrrow.c + * source/rtl/shadow.c + * source/rtl/setcurs.c + * source/rtl/mouse53.c + * source/rtl/gx.c + * source/rtl/mouseapi.c + * contrib/hbct/cursor.c + * contrib/hbct/ctwfunc.c + * contrib/hbclipsm/gauge.c + * Changed all USHORT to int in high-level GT API layer which + already had an int representation on the low-level. + Please review me. It's possible that some extra checks (or else) + need to be added since signedness has changed. + * Change mouse state buffer from char * to void *. + ; TODO: Review remaining BYTE/USHORT usage for attr, color + and char. Char is sometimes represented by UCHAR, + sometimes by char and sometimes by USHORT. Color is + represented by both int and BYTE. attr is BYTE, which + can be changed to hbU8. + 2009-07-10 01:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbapigt.h * contrib/hbct/screen2.c diff --git a/harbour/contrib/hbclipsm/gauge.c b/harbour/contrib/hbclipsm/gauge.c index 1abfc6f726..2c2e298c5a 100644 --- a/harbour/contrib/hbclipsm/gauge.c +++ b/harbour/contrib/hbclipsm/gauge.c @@ -105,7 +105,7 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent ) hb_gtRepChar( hb_arrayGetNI( pArray, B_TOP ) + iRow, hb_arrayGetNI( pArray, B_LEFT ) + 1, * hb_arrayGetCPtr( pArray, B_BARCHAR ), - iCols ); + ( USHORT ) iCols ); } hb_gtSetColorStr( szOldColor ); diff --git a/harbour/contrib/hbct/ctwfunc.c b/harbour/contrib/hbct/ctwfunc.c index 6a18c11659..0cc912de0d 100644 --- a/harbour/contrib/hbct/ctwfunc.c +++ b/harbour/contrib/hbct/ctwfunc.c @@ -344,9 +344,9 @@ HB_FUNC( HBCT_MAXROW ) /* Return the maximum screen/window row number (zero orig { if( HB_ISLOG( 1 ) && hb_parl( 1 ) ) { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiRows - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iRows - 1 ); } else hb_retni( hb_gtMaxRow() ); @@ -356,9 +356,9 @@ HB_FUNC( HBCT_MAXCOL ) /* Return the maximum screen/window column number (zero o { if( HB_ISLOG( 1 ) && hb_parl( 1 ) ) { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiCols - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iCols - 1 ); } else hb_retni( hb_gtMaxCol() ); diff --git a/harbour/contrib/hbct/cursor.c b/harbour/contrib/hbct/cursor.c index 0c6e406a2b..47fbc779ed 100644 --- a/harbour/contrib/hbct/cursor.c +++ b/harbour/contrib/hbct/cursor.c @@ -58,15 +58,15 @@ HB_FUNC( SAVECURSOR ) { int iRow, iCol; - USHORT usCursor; + int iCursor; hb_gtGetPos( &iRow, &iCol ); - hb_gtGetCursor( &usCursor ); + hb_gtGetCursor( &iCursor ); #ifdef HB_C52_STRICT - usCursor = ( usCursor != 0 ); + iCursor = ( iCursor != 0 ); #endif - hb_retnl( ( long ) iCol | ( iRow << 8 ) | ( usCursor << 16 ) ); + hb_retnl( ( long ) iCol | ( iRow << 8 ) | ( iCursor << 16 ) ); } @@ -74,11 +74,11 @@ HB_FUNC( RESTCURSOR ) { long lCursor = hb_parnl( 1 ); - hb_gtSetPos( ( int ) ( ( lCursor >> 8 ) & 0xff ), ( int ) ( lCursor & 0xff ) ); + hb_gtSetPos( ( int ) ( ( lCursor >> 8 ) & 0xFF ), ( int ) ( lCursor & 0xFF ) ); #ifdef HB_C52_STRICT - hb_gtSetCursor( ( USHORT ) ( ( lCursor >> 16 ) & 0x01 ) ); + hb_gtSetCursor( ( int ) ( ( lCursor >> 16 ) & 0x01 ) ); #else - hb_gtSetCursor( ( USHORT ) ( ( lCursor >> 16 ) & 0xff ) ); + hb_gtSetCursor( ( int ) ( ( lCursor >> 16 ) & 0xFF ) ); #endif hb_retc_null(); diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 50acd51426..8bd6fe8d85 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -1046,7 +1046,7 @@ extern HB_EXPORT const char * hb_conNewLine( void ); /* retrieve a pointer to a extern HB_EXPORT void hb_conOutStd( const char * pStr, ULONG ulLen ); /* output an string to STDOUT */ extern HB_EXPORT void hb_conOutErr( const char * pStr, ULONG ulLen ); /* output an string to STDERR */ extern HB_EXPORT void hb_conOutAlt( const char * pStr, ULONG ulLen ); /* output an string to the screen and/or printer and/or alternate */ -extern HB_EXPORT USHORT hb_conSetCursor( BOOL bSetCursor, USHORT usNewCursor ); /* retrieve and optionally set cursor shape */ +extern HB_EXPORT int hb_conSetCursor( BOOL bSetCursor, int iNewCursor ); /* retrieve and optionally set cursor shape */ extern HB_EXPORT const char * hb_conSetColor( const char * szColor ); /* retrieve and optionally set console color */ /* compiler and macro compiler */ diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 50644006ca..f34f201bd3 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -175,48 +175,48 @@ extern HB_EXPORT HB_ERRCODE hb_gtBox( int iTop, int iLeft, int iBottom, int iRig extern HB_EXPORT HB_ERRCODE hb_gtBoxD( int iTop, int iLeft, int iBottom, int iRight ); extern HB_EXPORT HB_ERRCODE hb_gtBoxS( int iTop, int iLeft, int iBottom, int iRight ); extern HB_EXPORT HB_ERRCODE hb_gtDrawBox( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor ); -extern HB_EXPORT HB_ERRCODE hb_gtColorSelect( USHORT uiColorIndex ); +extern HB_EXPORT HB_ERRCODE hb_gtColorSelect( int iColorIndex ); extern HB_EXPORT int hb_gtColorToN( const char * szColorString ); extern HB_EXPORT HB_ERRCODE hb_gtColorsToString( int * pColors, int iColorCount, char * pszColorString, int iBufSize ); extern HB_EXPORT HB_ERRCODE hb_gtDispBegin( void ); -extern HB_EXPORT USHORT hb_gtDispCount( void ); +extern HB_EXPORT int hb_gtDispCount( void ); extern HB_EXPORT HB_ERRCODE hb_gtDispEnd( void ); -extern HB_EXPORT HB_ERRCODE hb_gtDrawShadow( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ); +extern HB_EXPORT HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, BYTE byAttr ); extern HB_EXPORT HB_ERRCODE hb_gtGetBlink( BOOL * pbBlink ); extern HB_EXPORT HB_ERRCODE hb_gtGetColorStr( char * pszColorString ); -extern HB_EXPORT HB_ERRCODE hb_gtGetCursor( USHORT * puiCursorShape ); +extern HB_EXPORT HB_ERRCODE hb_gtGetCursor( int * piCursorShape ); extern HB_EXPORT HB_ERRCODE hb_gtGetPos( int * piRow, int * piCol ); extern HB_EXPORT BOOL hb_gtIsColor( void ); -extern HB_EXPORT USHORT hb_gtMaxCol( void ); -extern HB_EXPORT USHORT hb_gtMaxRow( void ); +extern HB_EXPORT int hb_gtMaxCol( void ); +extern HB_EXPORT int hb_gtMaxRow( void ); extern HB_EXPORT HB_ERRCODE hb_gtPostExt( void ); extern HB_EXPORT HB_ERRCODE hb_gtPreExt( void ); extern HB_EXPORT HB_ERRCODE hb_gtSuspend( void ); /* prepare the reminal for shell output */ extern HB_EXPORT HB_ERRCODE hb_gtResume( void ); /* resume the terminal after the shell output */ extern HB_EXPORT int hb_gtReadKey( int iEventMask ); extern HB_EXPORT HB_ERRCODE hb_gtRectSize( int iTop, int iLeft, int iBottom, int iRight, ULONG * puiBuffSize ); -extern HB_EXPORT HB_ERRCODE hb_gtRepChar( USHORT uiRow, USHORT uiCol, USHORT usChar, USHORT uiCount ); -extern HB_EXPORT HB_ERRCODE hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * pScrBuff ); -extern HB_EXPORT HB_ERRCODE hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, const void * pScrBuff ); -extern HB_EXPORT HB_ERRCODE hb_gtGetChar( USHORT uiRow, USHORT uiCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ); -extern HB_EXPORT HB_ERRCODE hb_gtPutChar( USHORT uiRow, USHORT uiCol, BYTE bColor, BYTE bAttr, USHORT usChar ); +extern HB_EXPORT HB_ERRCODE hb_gtRepChar( int iRow, int iCol, USHORT usChar, USHORT uiCount ); +extern HB_EXPORT HB_ERRCODE hb_gtSave( int iTop, int iLeft, int iBottom, int iRight, void * pScrBuff ); +extern HB_EXPORT HB_ERRCODE hb_gtRest( int iTop, int iLeft, int iBottom, int iRight, const void * pScrBuff ); +extern HB_EXPORT HB_ERRCODE hb_gtGetChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ); +extern HB_EXPORT HB_ERRCODE hb_gtPutChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ); extern HB_EXPORT HB_ERRCODE hb_gtBeginWrite( void ); extern HB_EXPORT HB_ERRCODE hb_gtEndWrite( void ); -extern HB_EXPORT HB_ERRCODE hb_gtScrDim( USHORT * puiHeight, USHORT * puiWidth ); -extern HB_EXPORT HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, int iRows, int iCols ); -extern HB_EXPORT HB_ERRCODE hb_gtScrollUp( USHORT uiRows ); -extern HB_EXPORT HB_ERRCODE hb_gtSetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ); +extern HB_EXPORT HB_ERRCODE hb_gtScrDim( int * piHeight, int * piWidth ); +extern HB_EXPORT HB_ERRCODE hb_gtScroll( int iTop, int iLeft, int iBottom, int iRight, int iRows, int iCols ); +extern HB_EXPORT HB_ERRCODE hb_gtScrollUp( int uiRows ); +extern HB_EXPORT HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, BYTE byAttr ); extern HB_EXPORT HB_ERRCODE hb_gtSetBlink( BOOL bBlink ); extern HB_EXPORT HB_ERRCODE hb_gtSetColorStr( const char * pszColorString ); -extern HB_EXPORT HB_ERRCODE hb_gtSetCursor( USHORT uiCursorShape ); -extern HB_EXPORT HB_ERRCODE hb_gtSetMode( USHORT uiRows, USHORT uiCols ); +extern HB_EXPORT HB_ERRCODE hb_gtSetCursor( int iCursorShape ); +extern HB_EXPORT HB_ERRCODE hb_gtSetMode( int iRows, int iCols ); extern HB_EXPORT HB_ERRCODE hb_gtSetPos( int iRow, int iCol ); extern HB_EXPORT HB_ERRCODE hb_gtSetSnowFlag( BOOL bNoSnow ); extern HB_EXPORT HB_ERRCODE hb_gtTone( double dFrequency, double dDuration ); extern HB_EXPORT HB_ERRCODE hb_gtWrite( const char * szStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const char * szStr, ULONG ulLen ); +extern HB_EXPORT HB_ERRCODE hb_gtWriteAt( int iRow, int iCol, const char * szStr, ULONG ulLen ); extern HB_EXPORT HB_ERRCODE hb_gtWriteCon( const char * szStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, const char * szStr, ULONG ulLength, int iColor ); +extern HB_EXPORT HB_ERRCODE hb_gtPutText( int iRow, int iCol, const char * szStr, ULONG ulLength, int iColor ); extern HB_EXPORT const char * hb_gtVersion( int iType ); extern HB_EXPORT HB_ERRCODE hb_gtOutStd( const char * szStr, ULONG ulLen ); extern HB_EXPORT HB_ERRCODE hb_gtOutErr( const char * szStr, ULONG ulLen ); @@ -249,8 +249,8 @@ extern HB_EXPORT void hb_mouseSetPos( int iRow, int iCol ); extern HB_EXPORT void hb_mouseSetBounds( int iTop, int iLeft, int iBottom, int iRight ); extern HB_EXPORT void hb_mouseGetBounds( int * piTop, int * piLeft, int * piBottom, int * piRight ); extern HB_EXPORT int hb_mouseStorageSize( void ); -extern HB_EXPORT void hb_mouseSaveState( char * pBuffer ); -extern HB_EXPORT void hb_mouseRestoreState( const char * pBuffer ); +extern HB_EXPORT void hb_mouseSaveState( void * pBuffer ); +extern HB_EXPORT void hb_mouseRestoreState( const void * pBuffer ); extern HB_EXPORT int hb_mouseGetDoubleClickSpeed( void ); extern HB_EXPORT void hb_mouseSetDoubleClickSpeed( int iSpeed ); extern HB_EXPORT int hb_mouseCountButton( void ); diff --git a/harbour/include/hbgtcore.h b/harbour/include/hbgtcore.h index 14f95f20ff..3d4b246959 100644 --- a/harbour/include/hbgtcore.h +++ b/harbour/include/hbgtcore.h @@ -223,8 +223,8 @@ typedef struct void (* MouseSetBounds) ( HB_GT_PTR, int, int, int, int ); void (* MouseGetBounds) ( HB_GT_PTR, int *, int *, int *, int * ); int (* MouseStorageSize) ( HB_GT_PTR ); - void (* MouseSaveState) ( HB_GT_PTR, char * ); - void (* MouseRestoreState) ( HB_GT_PTR, const char * ); + void (* MouseSaveState) ( HB_GT_PTR, void * ); + void (* MouseRestoreState) ( HB_GT_PTR, const void * ); int (* MouseGetDoubleClickSpeed) ( HB_GT_PTR ); void (* MouseSetDoubleClickSpeed) ( HB_GT_PTR, int ); int (* MouseCountButton) ( HB_GT_PTR ); diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 400a948058..8cb09b92a5 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -576,7 +576,7 @@ HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position pszString = hb_itemStringCon( hb_param( 3, HB_IT_ANY ), &ulLen, &bFreeReq ); - hb_gtWriteAt( ( USHORT ) hb_parni( 1 ), ( USHORT ) hb_parni( 2 ), pszString, ulLen ); + hb_gtWriteAt( hb_parni( 1 ), hb_parni( 2 ), pszString, ulLen ); if( bFreeReq ) hb_xfree( pszString ); @@ -587,7 +587,7 @@ HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position { pszString = hb_itemStringCon( hb_param( 3, HB_IT_ANY ), &ulLen, &bFreeReq ); - hb_gtWriteAt( ( USHORT ) hb_parni( 1 ), ( USHORT ) hb_parni( 2 ), pszString, ulLen ); + hb_gtWriteAt( hb_parni( 1 ), hb_parni( 2 ), pszString, ulLen ); if( bFreeReq ) hb_xfree( pszString ); @@ -614,7 +614,7 @@ HB_FUNC( HB_DISPOUTAT ) else iColor = -1; - hb_gtPutText( ( USHORT ) hb_parni( 1 ), ( USHORT ) hb_parni( 2 ), pszString, ulLen, iColor ); + hb_gtPutText( hb_parni( 1 ), hb_parni( 2 ), pszString, ulLen, iColor ); if( bFreeReq ) hb_xfree( pszString ); @@ -625,8 +625,8 @@ HB_FUNC( HB_DISPOUTAT ) so we can use it to draw graphical elements. */ HB_FUNC( HB_DISPOUTATBOX ) { - SHORT nRow = ( SHORT ) hb_parni( 1 ); - SHORT nCol = ( SHORT ) hb_parni( 2 ); + int nRow = hb_parni( 1 ); + int nCol = hb_parni( 2 ); const char * pszString = hb_parcx( 3 ); ULONG nStringLen = hb_parclen( 3 ); int iColor; diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index e8cf5f7412..6b2bcbfcd4 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -239,16 +239,16 @@ HB_ERRCODE hb_gtDrawBox( int iTop, int iLeft, int iBottom, int iRight, const cha return HB_FAILURE; } -HB_ERRCODE hb_gtColorSelect( USHORT uiColorIndex ) +HB_ERRCODE hb_gtColorSelect( int iColorIndex ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtColorSelect(%hu)", uiColorIndex)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtColorSelect(%d)", iColorIndex)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_COLORSELECT( pGT, uiColorIndex ); + HB_GTSELF_COLORSELECT( pGT, iColorIndex ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; } @@ -271,9 +271,9 @@ HB_ERRCODE hb_gtDispBegin( void ) return HB_FAILURE; } -USHORT hb_gtDispCount( void ) +int hb_gtDispCount( void ) { - USHORT uiCount = 0; + int iCount = 0; PHB_GT pGT; HB_TRACE(HB_TR_DEBUG, ("hb_gtDispCount()")); @@ -281,10 +281,10 @@ USHORT hb_gtDispCount( void ) pGT = hb_gt_Base(); if( pGT ) { - uiCount = HB_GTSELF_DISPCOUNT( pGT ); + iCount = HB_GTSELF_DISPCOUNT( pGT ); hb_gt_BaseFree( pGT ); } - return uiCount; + return iCount; } HB_ERRCODE hb_gtDispEnd( void ) @@ -409,33 +409,33 @@ HB_ERRCODE hb_gtSetColorStr( const char * szColorString ) return HB_FAILURE; } -HB_ERRCODE hb_gtGetCursor( USHORT * uipCursorStyle ) +HB_ERRCODE hb_gtGetCursor( int * piCursorStyle ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtGetCursor(%p)", uipCursorStyle)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtGetCursor(%p)", piCursorStyle)); pGT = hb_gt_Base(); if( pGT ) { - *uipCursorStyle = HB_GTSELF_GETCURSORSTYLE( pGT ); + *piCursorStyle = HB_GTSELF_GETCURSORSTYLE( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; } - *uipCursorStyle = SC_NONE; + *piCursorStyle = SC_NONE; return HB_FAILURE; } -HB_ERRCODE hb_gtSetCursor( USHORT uiCursorStyle ) +HB_ERRCODE hb_gtSetCursor( int iCursorStyle ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gtSetCursor(%hu)", uiCursorStyle)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetCursor(%d)", iCursorStyle)); - if( uiCursorStyle <= SC_SPECIAL2 ) + if( iCursorStyle <= SC_SPECIAL2 ) { PHB_GT pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SETCURSORSTYLE( pGT, uiCursorStyle ); + HB_GTSELF_SETCURSORSTYLE( pGT, iCursorStyle ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -485,56 +485,58 @@ HB_ERRCODE hb_gtSetPos( int iRow, int iCol ) return HB_FAILURE; } -USHORT hb_gtMaxCol( void ) +int hb_gtMaxCol( void ) { - USHORT uiMaxCol = 79; PHB_GT pGT; + int iMaxCol; HB_TRACE(HB_TR_DEBUG, ("hb_gtMaxCol()")); pGT = hb_gt_Base(); if( pGT ) { - uiMaxCol = HB_GTSELF_MAXCOL( pGT ); + iMaxCol = HB_GTSELF_MAXCOL( pGT ); hb_gt_BaseFree( pGT ); } - return uiMaxCol; + else + iMaxCol = 79; + + return iMaxCol; } -USHORT hb_gtMaxRow( void ) +int hb_gtMaxRow( void ) { - USHORT uiMaxRow = 24; PHB_GT pGT; + int iMaxRow; HB_TRACE(HB_TR_DEBUG, ("hb_gtMaxRow()")); pGT = hb_gt_Base(); if( pGT ) { - uiMaxRow = HB_GTSELF_MAXROW( pGT ); + iMaxRow = HB_GTSELF_MAXROW( pGT ); hb_gt_BaseFree( pGT ); } - return uiMaxRow; + else + iMaxRow = 24; + + return iMaxRow; } -HB_ERRCODE hb_gtScrDim( USHORT * uipHeight, USHORT * uipWidth ) +HB_ERRCODE hb_gtScrDim( int * piHeight, int * piWidth ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtScrDim(%p, %p)", uipHeight, uipWidth)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtScrDim(%p, %p)", piHeight, piWidth)); pGT = hb_gt_Base(); if( pGT ) { - int iHeight, iWidth; - - HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth ); - *uipHeight = ( USHORT ) iHeight; - *uipWidth = ( USHORT ) iWidth; + HB_GTSELF_GETSIZE( pGT, piHeight, piWidth ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; } - *uipHeight = *uipWidth = 0; + *piHeight = *piWidth = 0; return HB_FAILURE; } @@ -587,16 +589,16 @@ BOOL hb_gtIsColor( void ) return fColor; } -HB_ERRCODE hb_gtRepChar( USHORT uiRow, USHORT uiCol, USHORT usChar, USHORT uiCount ) +HB_ERRCODE hb_gtRepChar( int iRow, int iCol, USHORT usChar, USHORT uiCount ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtRepChar(%hu, %hu, %hu, %hu)", uiRow, uiCol, usChar, uiCount)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtRepChar(%d, %d, %hu, %hu)", iRow, iCol, usChar, uiCount)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_REPLICATE( pGT, uiRow, uiCol, HB_GTSELF_GETCOLOR( pGT ), 0, + HB_GTSELF_REPLICATE( pGT, iRow, iCol, HB_GTSELF_GETCOLOR( pGT ), 0, usChar, uiCount ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -605,32 +607,32 @@ HB_ERRCODE hb_gtRepChar( USHORT uiRow, USHORT uiCol, USHORT usChar, USHORT uiCou return HB_FAILURE; } -HB_ERRCODE hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * pScrBuff ) +HB_ERRCODE hb_gtSave( int iTop, int iLeft, int iBottom, int iRight, void * pScrBuff ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtSave(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pScrBuff)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSave(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, pScrBuff)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SAVE( pGT, uiTop, uiLeft, uiBottom, uiRight, pScrBuff ); + HB_GTSELF_SAVE( pGT, iTop, iLeft, iBottom, iRight, pScrBuff ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; } return HB_FAILURE; } -HB_ERRCODE hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, const void * pScrBuff ) +HB_ERRCODE hb_gtRest( int iTop, int iLeft, int iBottom, int iRight, const void * pScrBuff ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtRest(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pScrBuff)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtRest(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, pScrBuff)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_REST( pGT, uiTop, uiLeft, uiBottom, uiRight, pScrBuff ); + HB_GTSELF_REST( pGT, iTop, iLeft, iBottom, iRight, pScrBuff ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -638,34 +640,34 @@ HB_ERRCODE hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRig return HB_FAILURE; } -HB_ERRCODE hb_gtGetChar( USHORT uiRow, USHORT uiCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) +HB_ERRCODE hb_gtGetChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtGetChar(%hu, %hu, %p, %p, %p)", uiRow, uiCol, pbColor, pbAttr, pusChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtGetChar(%d, %d, %p, %p, %p)", iRow, iCol, pbColor, pbAttr, pusChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_GETCHAR( pGT, uiRow, uiCol, pbColor, pbAttr, pusChar ) ) + if( HB_GTSELF_GETCHAR( pGT, iRow, iCol, pbColor, pbAttr, pusChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } return errCode; } -HB_ERRCODE hb_gtPutChar( USHORT uiRow, USHORT uiCol, BYTE bColor, BYTE bAttr, USHORT usChar ) +HB_ERRCODE hb_gtPutChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtPutChar(%hu, %hu, %hu, %hu, %hu)", uiRow, uiCol, bColor, bAttr, usChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtPutChar(%d, %d, %hu, %hu, %hu)", iRow, iCol, bColor, bAttr, usChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_PUTCHAR( pGT, uiRow, uiCol, bColor, bAttr, usChar ) ) + if( HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, bAttr, usChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } @@ -740,30 +742,30 @@ HB_ERRCODE hb_gtSetBlink( BOOL fBlink ) return HB_FAILURE; } -HB_ERRCODE hb_gtSetMode( USHORT uiRows, USHORT uiCols ) +HB_ERRCODE hb_gtSetMode( int iRows, int iCols ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtSetMode(%hu, %hu)", uiRows, uiCols)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetMode(%d, %d)", iRows, iCols)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_SETMODE( pGT, uiRows, uiCols ) ) + if( HB_GTSELF_SETMODE( pGT, iRows, iCols ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } return errCode; } -HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, - const char * szStr, ULONG ulLength, - int iColor ) +HB_ERRCODE hb_gtPutText( int iRow, int iCol, + const char * szStr, ULONG ulLength, + int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtPutText(%hu, %hu, %p, %lu, %d)", uiRow, uiCol, szStr, ulLength, iColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtPutText(%d, %d, %p, %lu, %d)", iRow, iCol, szStr, ulLength, iColor)); pGT = hb_gt_Base(); if( pGT ) @@ -771,7 +773,7 @@ HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, if( iColor == -1 ) iColor = HB_GTSELF_GETCOLOR( pGT ); - HB_GTSELF_PUTTEXT( pGT, uiRow, uiCol, iColor, szStr, ulLength ); + HB_GTSELF_PUTTEXT( pGT, iRow, iCol, iColor, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -780,16 +782,16 @@ HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, return HB_FAILURE; } -HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const char * szStr, ULONG ulLength ) +HB_ERRCODE hb_gtWriteAt( int iRow, int iCol, const char * szStr, ULONG ulLength ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteAt(%hu, %hu, %p, %lu)", uiRow, uiCol, szStr, ulLength)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteAt(%d, %d, %p, %lu)", iRow, iCol, szStr, ulLength)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_WRITEAT( pGT, uiRow, uiCol, szStr, ulLength ); + HB_GTSELF_WRITEAT( pGT, iRow, iCol, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -831,16 +833,16 @@ HB_ERRCODE hb_gtWriteCon( const char * szStr, ULONG ulLength ) return HB_FAILURE; } -HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, int iRows, int iCols ) +HB_ERRCODE hb_gtScroll( int iTop, int iLeft, int iBottom, int iRight, int iRows, int iCols ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gtScroll(%hu, %hu, %hu, %hu, %d, %d)", uiTop, uiLeft, uiBottom, uiRight, iRows, iCols)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtScroll(%d, %d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, iRows, iCols)); - if( uiTop <= uiBottom && uiLeft <= uiRight ) + if( iTop <= iBottom && iLeft <= iRight ) { PHB_GT pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SCROLL( pGT, uiTop, uiLeft, uiBottom, uiRight, + HB_GTSELF_SCROLL( pGT, iTop, iLeft, iBottom, iRight, HB_GTSELF_GETCOLOR( pGT ), ' ', iRows, iCols ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -850,16 +852,16 @@ HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiR return HB_FAILURE; } -HB_ERRCODE hb_gtScrollUp( USHORT uiRows ) +HB_ERRCODE hb_gtScrollUp( int iRows ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gtScrollUp(%hd)", uiRows)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtScrollUp(%d)", iRows)); - if( uiRows != 0 ) + if( iRows != 0 ) { PHB_GT pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SCROLLUP( pGT, uiRows, HB_GTSELF_GETCOLOR( pGT ), ' ' ); + HB_GTSELF_SCROLLUP( pGT, iRows, HB_GTSELF_GETCOLOR( pGT ), ' ' ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -868,16 +870,16 @@ HB_ERRCODE hb_gtScrollUp( USHORT uiRows ) return HB_FAILURE; } -HB_ERRCODE hb_gtDrawShadow( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) +HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, BYTE byAttr ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawShadow(%hu, %hu, %hu, %hu, %d)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawShadow(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, (int) byAttr)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_DRAWSHADOW( pGT, uiTop, uiLeft, uiBottom, uiRight, byAttr ); + HB_GTSELF_DRAWSHADOW( pGT, iTop, iLeft, iBottom, iRight, byAttr ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -917,16 +919,16 @@ const char * hb_gtVersion( int iType ) return szVersion; } -HB_ERRCODE hb_gtSetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) +HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, BYTE byAttr ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtSetAttribute(%hu, %hu, %hu, %hu, %d)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetAttribute(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, ( int ) byAttr)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SETATTRIBUTE( pGT, uiTop, uiLeft, uiBottom, uiRight, byAttr ); + HB_GTSELF_SETATTRIBUTE( pGT, iTop, iLeft, iBottom, iRight, byAttr ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; diff --git a/harbour/source/rtl/gx.c b/harbour/source/rtl/gx.c index db947de816..7a5cf56ee6 100644 --- a/harbour/source/rtl/gx.c +++ b/harbour/source/rtl/gx.c @@ -77,13 +77,13 @@ HB_FUNC( NOSNOW ) HB_FUNC( SETMODE ) { - USHORT uiRows, uiCols; + int iRows, iCols; - hb_gtScrDim( &uiRows, &uiCols ); + hb_gtScrDim( &iRows, &iCols ); if( HB_ISNUM( 1 ) ) - uiRows = ( USHORT ) hb_parni( 1 ); + iRows = hb_parni( 1 ); if( HB_ISNUM( 2 ) ) - uiCols = ( USHORT ) hb_parni( 2 ); + iCols = hb_parni( 2 ); - hb_retl( hb_gtSetMode( uiRows, uiCols ) == HB_SUCCESS ); + hb_retl( hb_gtSetMode( iRows, iCols ) == HB_SUCCESS ); } diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index 84e699978b..dd93b8f286 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -2686,7 +2686,7 @@ static int hb_gt_def_mouseStorageSize( PHB_GT pGT ) return sizeof( _HB_MOUSE_STORAGE ); } -static void hb_gt_def_mouseSaveState( PHB_GT pGT, char * pBuffer ) +static void hb_gt_def_mouseSaveState( PHB_GT pGT, void * pBuffer ) { _HB_MOUSE_STORAGE * pStore = ( _HB_MOUSE_STORAGE * ) pBuffer; int iRow, iCol, iTop, iLeft, iBottom, iRight; @@ -2703,7 +2703,7 @@ static void hb_gt_def_mouseSaveState( PHB_GT pGT, char * pBuffer ) pStore->iRight = iRight; } -static void hb_gt_def_mouseRestoreState( PHB_GT pGT, const char * pBuffer ) +static void hb_gt_def_mouseRestoreState( PHB_GT pGT, const void * pBuffer ) { _HB_MOUSE_STORAGE * pStore = ( _HB_MOUSE_STORAGE * ) pBuffer; diff --git a/harbour/source/rtl/maxrow.c b/harbour/source/rtl/maxrow.c index cc201f5c0b..e43d0ec84f 100644 --- a/harbour/source/rtl/maxrow.c +++ b/harbour/source/rtl/maxrow.c @@ -81,9 +81,9 @@ HB_FUNC( MAXROW ) /* Return the maximum screen/window row number (zero origin) * if( HB_ISLOG( 1 ) && hb_parl( 1 ) ) { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiRows - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iRows - 1 ); } else #endif @@ -96,9 +96,9 @@ HB_FUNC( MAXCOL ) /* Return the maximum screen/window column number (zero origin /* See notes about MaxRow(.T.) above */ if( HB_ISLOG( 1 ) && hb_parl( 1 ) ) { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiCols - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iCols - 1 ); } else #endif diff --git a/harbour/source/rtl/mouse53.c b/harbour/source/rtl/mouse53.c index 05b9791d05..69f42a10bf 100644 --- a/harbour/source/rtl/mouse53.c +++ b/harbour/source/rtl/mouse53.c @@ -130,9 +130,7 @@ HB_FUNC( MDBLCLK ) hb_retni( hb_mouseGetDoubleClickSpeed() ); if( HB_ISNUM( 1 ) ) - { hb_mouseSetDoubleClickSpeed( hb_parni( 1 ) ); - } } HB_FUNC( MSAVESTATE ) @@ -141,10 +139,10 @@ HB_FUNC( MSAVESTATE ) if( iLen > 0 ) { - char * pBuffer = ( char * ) hb_xgrab( iLen + 1 ); + void * pBuffer = hb_xgrab( iLen + 1 ); hb_mouseSaveState( pBuffer ); - hb_retclen_buffer( pBuffer, iLen ); + hb_retclen_buffer( ( char * ) pBuffer, iLen ); } else hb_retc_null(); @@ -153,9 +151,7 @@ HB_FUNC( MSAVESTATE ) HB_FUNC( MRESTSTATE ) { if( HB_ISCHAR( 1 ) && hb_parclen( 1 ) == ( ULONG ) hb_mouseStorageSize() ) - { hb_mouseRestoreState( hb_parc( 1 ) ); - } } HB_FUNC( MSETBOUNDS ) diff --git a/harbour/source/rtl/mouseapi.c b/harbour/source/rtl/mouseapi.c index 8db6a49322..6556248b04 100644 --- a/harbour/source/rtl/mouseapi.c +++ b/harbour/source/rtl/mouseapi.c @@ -220,7 +220,7 @@ int hb_mouseStorageSize( void ) return iSize; } -void hb_mouseSaveState( char * pBuffer ) +void hb_mouseSaveState( void * pBuffer ) { PHB_GT pGT; @@ -234,7 +234,7 @@ void hb_mouseSaveState( char * pBuffer ) } } -void hb_mouseRestoreState( const char * pBuffer ) +void hb_mouseRestoreState( const void * pBuffer ) { PHB_GT pGT; diff --git a/harbour/source/rtl/oldclear.c b/harbour/source/rtl/oldclear.c index 6e1395c583..a8dca21ed0 100644 --- a/harbour/source/rtl/oldclear.c +++ b/harbour/source/rtl/oldclear.c @@ -59,10 +59,10 @@ HB_FUNC( __ATCLEAR ) if( hb_pcount() == 4 ) { hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) ); - hb_gtScroll( ( USHORT ) hb_parni( 1 ), - ( USHORT ) hb_parni( 2 ), - ( USHORT ) hb_parni( 3 ), - ( USHORT ) hb_parni( 4 ), 0, 0 ); + hb_gtScroll( hb_parni( 1 ), + hb_parni( 2 ), + hb_parni( 3 ), + hb_parni( 4 ), 0, 0 ); } } diff --git a/harbour/source/rtl/saverest.c b/harbour/source/rtl/saverest.c index c824892dd4..123cd332be 100644 --- a/harbour/source/rtl/saverest.c +++ b/harbour/source/rtl/saverest.c @@ -53,7 +53,7 @@ #include "hbapi.h" #include "hbapigt.h" -static void hb_getScreenRange( USHORT * pusMin, USHORT * pusMax, +static void hb_getScreenRange( int * piMin, int * piMax, BOOL fNoCheck, BOOL fVertical ) { int iFrom, iTo, iMax; @@ -66,7 +66,7 @@ static void hb_getScreenRange( USHORT * pusMin, USHORT * pusMax, } else { - iMax = hb_gtMaxCol(); + iMax = hb_gtMaxCol(); iFrom = hb_parni( 2 ); iTo = HB_ISNUM( 4 ) ? hb_parni( 4 ) : iMax; } @@ -83,30 +83,30 @@ static void hb_getScreenRange( USHORT * pusMin, USHORT * pusMax, if( iFrom > iTo ) { - *pusMin = ( USHORT ) iTo; - *pusMax = ( USHORT ) iFrom; + *piMin = iTo; + *piMax = iFrom; } else { - *pusMin = ( USHORT ) iFrom; - *pusMax = ( USHORT ) iTo; + *piMin = iFrom; + *piMax = iTo; } } HB_FUNC( SAVESCREEN ) { - USHORT uiTop, uiLeft, uiBottom, uiRight; - ULONG ulSize; + int iTop, iLeft, iBottom, iRight; + ULONG ulSize; void * pBuffer; BOOL fNoCheck = FALSE; - hb_getScreenRange( &uiTop, &uiBottom, fNoCheck, TRUE ); - hb_getScreenRange( &uiLeft, &uiRight, fNoCheck, FALSE ); + hb_getScreenRange( &iTop, &iBottom, fNoCheck, TRUE ); + hb_getScreenRange( &iLeft, &iRight, fNoCheck, FALSE ); - hb_gtRectSize( uiTop, uiLeft, uiBottom, uiRight, &ulSize ); + hb_gtRectSize( iTop, iLeft, iBottom, iRight, &ulSize ); pBuffer = hb_xgrab( ulSize + 1 ); - hb_gtSave( uiTop, uiLeft, uiBottom, uiRight, pBuffer ); + hb_gtSave( iTop, iLeft, iBottom, iRight, pBuffer ); hb_retclen_buffer( ( char * ) pBuffer, ulSize ); } @@ -114,12 +114,12 @@ HB_FUNC( RESTSCREEN ) { if( HB_ISCHAR( 5 ) ) { - USHORT uiTop, uiLeft, uiBottom, uiRight; + int iTop, iLeft, iBottom, iRight; BOOL fNoCheck = FALSE; - hb_getScreenRange( &uiTop, &uiBottom, fNoCheck, TRUE ); - hb_getScreenRange( &uiLeft, &uiRight, fNoCheck, FALSE ); + hb_getScreenRange( &iTop, &iBottom, fNoCheck, TRUE ); + hb_getScreenRange( &iLeft, &iRight, fNoCheck, FALSE ); - hb_gtRest( uiTop, uiLeft, uiBottom, uiRight, ( const void * ) hb_parc( 5 ) ); + hb_gtRest( iTop, iLeft, iBottom, iRight, ( const void * ) hb_parc( 5 ) ); } } diff --git a/harbour/source/rtl/scroll.c b/harbour/source/rtl/scroll.c index 24177c1610..e087914265 100644 --- a/harbour/source/rtl/scroll.c +++ b/harbour/source/rtl/scroll.c @@ -101,10 +101,10 @@ HB_FUNC( SCROLL ) else iRight = iMaxCol; - hb_gtScroll( ( USHORT ) iTop, - ( USHORT ) iLeft, - ( USHORT ) iBottom, - ( USHORT ) iRight, + hb_gtScroll( iTop, + iLeft, + iBottom, + iRight, hb_parni( 5 ), /* Defaults to zero on bad type */ hb_parni( 6 ) ); /* Defaults to zero on bad type */ } diff --git a/harbour/source/rtl/scrrow.c b/harbour/source/rtl/scrrow.c index d9615a5b32..12a7e10528 100644 --- a/harbour/source/rtl/scrrow.c +++ b/harbour/source/rtl/scrrow.c @@ -65,14 +65,14 @@ HB_FUNC( HB_SCRMAXROW ) /* Return the maximum screen row number (zero origin) */ { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiRows - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iRows - 1 ); } HB_FUNC( HB_SCRMAXCOL ) /* Return the maximum screen column number (zero origin) */ { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiCols - 1 ); + int iRows, iCols; + hb_gtScrDim( &iRows, &iCols ); + hb_retni( iCols - 1 ); } diff --git a/harbour/source/rtl/setcurs.c b/harbour/source/rtl/setcurs.c index ef5029d685..02e3a0d67e 100644 --- a/harbour/source/rtl/setcurs.c +++ b/harbour/source/rtl/setcurs.c @@ -53,28 +53,28 @@ #include "hbapi.h" #include "hbapigt.h" -USHORT hb_conSetCursor( BOOL bSetCursor, USHORT uiNewCursor ) +int hb_conSetCursor( BOOL bSetCursor, int iNewCursor ) { - USHORT uiCursor; + int iCursor; - HB_TRACE(HB_TR_DEBUG, ("hb_conSetCursor(%d, %hu)", (int) bSetCursor, uiNewCursor)); + HB_TRACE(HB_TR_DEBUG, ("hb_conSetCursor(%d, %d)", (int) bSetCursor, iNewCursor)); - hb_gtGetCursor( &uiCursor ); + hb_gtGetCursor( &iCursor ); if( bSetCursor ) - hb_gtSetCursor( uiNewCursor ); + hb_gtSetCursor( iNewCursor ); - return uiCursor; + return iCursor; } HB_FUNC( SETCURSOR ) { - USHORT uiCursor; + int iCursor; - hb_gtGetCursor( &uiCursor ); + hb_gtGetCursor( &iCursor ); - hb_retni( uiCursor ); + hb_retni( iCursor ); if( HB_ISNUM( 1 ) ) - hb_gtSetCursor( ( USHORT ) hb_parni( 1 ) ); + hb_gtSetCursor( hb_parni( 1 ) ); } diff --git a/harbour/source/rtl/shadow.c b/harbour/source/rtl/shadow.c index a6a255207c..88c42fa515 100644 --- a/harbour/source/rtl/shadow.c +++ b/harbour/source/rtl/shadow.c @@ -56,19 +56,19 @@ HB_FUNC( HB_SHADOW ) { if( hb_pcount() >= 4 ) - hb_gtDrawShadow( ( USHORT ) hb_parni( 1 ), - ( USHORT ) hb_parni( 2 ), - ( USHORT ) hb_parni( 3 ), - ( USHORT ) hb_parni( 4 ), + hb_gtDrawShadow( hb_parni( 1 ), + hb_parni( 2 ), + hb_parni( 3 ), + hb_parni( 4 ), HB_ISNUM( 5 ) ? ( BYTE ) hb_parni( 5 ) : 7 ); } HB_FUNC( HB_CLRAREA ) { if( hb_pcount() > 4 ) - hb_gtSetAttribute( ( USHORT ) hb_parni( 1 ), - ( USHORT ) hb_parni( 2 ), - ( USHORT ) hb_parni( 3 ), - ( USHORT ) hb_parni( 4 ), + hb_gtSetAttribute( hb_parni( 1 ), + hb_parni( 2 ), + hb_parni( 3 ), + hb_parni( 4 ), ( BYTE ) hb_parni( 5 ) ); }