diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7ac2d1e801..c39e19f527 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,38 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-09 17:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbgtcore.h + * include/hbapigt.h + * source/rtl/oldbox.c + * source/rtl/box.c + * source/rtl/gtstd/gtstd.c + * source/rtl/gtcgi/gtcgi.c + * source/rtl/gtapi.c + * source/rtl/console.c + * source/rtl/gtos2/gtos2.c + * source/rtl/hbgtcore.c + * source/rtl/gtpca/gtpca.c + * contrib/hbct/screen2.c + * contrib/hbct/ctwin.c + * contrib/hbct/ctwin.h + * contrib/hbct/ctwfunc.c + * contrib/hbclipsm/status.c + * contrib/hbclipsm/gauge.c + * examples/hbmake/hbmakec.c + * BYTE * -> char * for GT API functions. + * hb_gtRepChar() character parameter BYTE -> USHORT. + % Unnecessary casts deleted. + ; TODO: Screen save/restore buffer kept as BYTE, but it also should be + converted to something else. void * probably. + ; QUESTION: Single chars are represented as USHORT. Shouldn't we + change it to 'char'? + + * contrib/hbtip/thtml.prg + * contrib/hbtip/sendmail.prg + * contrib/hbtip/httpcln.prg + * Minor formatting. + 2009-07-09 15:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtip/utils.c - contrib/hbtip/base64x.c diff --git a/harbour/contrib/hbclipsm/gauge.c b/harbour/contrib/hbclipsm/gauge.c index 09dc5bbff0..62aea7ce3b 100644 --- a/harbour/contrib/hbclipsm/gauge.c +++ b/harbour/contrib/hbclipsm/gauge.c @@ -90,21 +90,21 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent ) hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 ); hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), iCenter + 2, - ( const BYTE * ) szPct, 4 ); + szPct, 4 ); } hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1, ( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1, ( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1, ( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1, - ( const BYTE * ) szStr ); + szStr ); iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 ); for( iRow = 1; iRow <= iMax; iRow++ ) { hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ), ( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ), - ( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ), + * hb_arrayGetCPtr( pArray, B_BARCHAR ), iCols ); } @@ -161,18 +161,18 @@ HB_FUNC( GAUGEDISPLAY ) ( SHORT) hb_arrayGetNI( pArray, B_LEFT ), ( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ), ( SHORT) hb_arrayGetNI( pArray, B_RIGHT ), - ( const BYTE * ) szStr ); + szStr ); hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), ( SHORT ) hb_arrayGetNI( pArray, B_LEFT ), ( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ), ( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ), - ( const BYTE * ) B_BOXLINES ); + B_BOXLINES ); if( hb_arrayGetL( pArray, B_DISPLAYNUM ) ) hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), iCenter, - ( const BYTE * ) "[ ]", 8 ); + "[ ]", 8 ); hb_gtSetColorStr( szOldColor ); diff --git a/harbour/contrib/hbclipsm/status.c b/harbour/contrib/hbclipsm/status.c index 6736839c10..98711ce123 100644 --- a/harbour/contrib/hbclipsm/status.c +++ b/harbour/contrib/hbclipsm/status.c @@ -91,13 +91,13 @@ HB_FUNC( STATUSUPDATE ) lCurrent = ( ++lCurrent > 4 ? 1 : lCurrent ); hb_itemArrayPut( pArray, ST_CURRENT, hb_itemPutNL( pCurrent, lCurrent ) ); - hb_gtGetColorStr( (char*) szOldColor ); + hb_gtGetColorStr( ( char * ) szOldColor ); hb_gtSetColorStr( hb_arrayGetCPtr( pArray, ST_COLOR ) ); - hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, ST_ROW ), - (USHORT) hb_arrayGetNL( pArray, ST_COL ), - ( BYTE * ) szDisplay + lCurrent - 1, 1 ); + hb_gtWriteAt( ( USHORT ) hb_arrayGetNL( pArray, ST_ROW ), + ( USHORT ) hb_arrayGetNL( pArray, ST_COL ), + szDisplay + lCurrent - 1, 1 ); - hb_gtSetColorStr( (char*) szOldColor ); + hb_gtSetColorStr( ( char * ) szOldColor ); hb_itemRelease( pCurrent ); } } diff --git a/harbour/contrib/hbct/ctwfunc.c b/harbour/contrib/hbct/ctwfunc.c index f45f52f089..6a18c11659 100644 --- a/harbour/contrib/hbct/ctwfunc.c +++ b/harbour/contrib/hbct/ctwfunc.c @@ -207,13 +207,13 @@ HB_FUNC( WBOX ) "олнннлоо", /* 14 WB_FULL_HALF */ "лллллллл" }; /* 15 WB_FULL */ - const BYTE * szBox; - BYTE szBoxBuf[ 10 ]; + const char * szBox; + char szBoxBuf[ 10 ]; int iColor; if( HB_ISCHAR( 1 ) ) { - szBox = ( const BYTE * ) hb_parc( 1 ); + szBox = hb_parc( 1 ); } else { diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index 56dbe0e035..6461f9a334 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -1024,7 +1024,7 @@ static int hb_ctw_GetFormatCords( PHB_GTCTW pCTW, int iWindow, BOOL fRelative, i return -1; } -static int hb_ctw_AddWindowBox( PHB_GTCTW pCTW, int iWindow, const BYTE * szBox, int iColor ) +static int hb_ctw_AddWindowBox( PHB_GTCTW pCTW, int iWindow, const char * szBox, int iColor ) { int iMaxRow, iMaxCol; @@ -1310,13 +1310,13 @@ static int hb_ctw_gt_MaxRow( PHB_GT pGT ) */ #define WRITECON_BUFFER_SIZE 512 -static void hb_ctw_gt_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) +static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * pText, ULONG ulLength ) { int iLen = 0; BOOL bDisp = FALSE; BOOL bBell = FALSE; int iRow, iCol, iMaxRow, iMaxCol; - BYTE szString[ WRITECON_BUFFER_SIZE ]; + char szString[ WRITECON_BUFFER_SIZE ]; HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_WriteCon(%p,%p,%lu)", pGT, pText, ulLength)); @@ -1960,7 +1960,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, iPrevWnd = hb_ctw_CurrentWindow( pCTW ); iWnd = hb_ctw_CreateWindow( pCTW, iTop, iLeft, iBottom, iRight, TRUE, iClrNorm, TRUE ); - hb_ctw_AddWindowBox( pCTW, iWnd, ( const BYTE * ) _B_SINGLE, iClrNorm ); + hb_ctw_AddWindowBox( pCTW, iWnd, _B_SINGLE, iClrNorm ); HB_GTSELF_SETCURSORSTYLE( pGT, SC_NONE ); ulLast = 0; i = 0; @@ -1974,7 +1974,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( ul2 > ulWidth ) ul2 = ulWidth; HB_GTSELF_PUTTEXT( pGT, i, ( ( ulWidth - ul2 + 1 ) >> 1 ) + 1, ( BYTE ) iClrNorm, - ( const BYTE * ) szMessage + ulLast, ul2 ); + szMessage + ulLast, ul2 ); } ulLast = ul + 1; if( ++i >= iLines ) @@ -1987,7 +1987,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( ul2 > ulWidth ) ul2 = ulWidth; HB_GTSELF_PUTTEXT( pGT, i, ( ( ulWidth - ul2 + 1 ) >> 1 ) + 1, ( BYTE ) iClrNorm, - ( const BYTE * ) szMessage + ulLast, ul2 ); + szMessage + ulLast, ul2 ); } iPos = 1; @@ -2000,7 +2000,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, iClr = i == iPos ? iClrHigh : iClrNorm; ulLen = hb_arrayGetCLen( pOptions, i ); HB_GTSELF_PUTTEXT( pGT, iLines + 1, iMnuCol, ( BYTE ) iClr, - ( const BYTE * ) hb_arrayGetCPtr( pOptions, i ), ulLen ); + hb_arrayGetCPtr( pOptions, i ), ulLen ); iMnuCol += ulLen + 3; } while( HB_GTSELF_DISPCOUNT( pGT ) ) @@ -2410,7 +2410,7 @@ int hb_ctwCenterWindow( int iWindow, BOOL fCenter ) return iResult; } -int hb_ctwAddWindowBox( int iWindow, const BYTE * szBox, int iColor ) +int hb_ctwAddWindowBox( int iWindow, const char * szBox, int iColor ) { int iResult = -1; PHB_GTCTW pCTW = hb_ctw_base(); diff --git a/harbour/contrib/hbct/ctwin.h b/harbour/contrib/hbct/ctwin.h index bae458bdde..c6e89adc1e 100644 --- a/harbour/contrib/hbct/ctwin.h +++ b/harbour/contrib/hbct/ctwin.h @@ -89,7 +89,7 @@ extern int hb_ctwGetWindowCords( int iWindow, BOOL fCenter, int * piTop, int * extern int hb_ctwGetFormatCords( int iWindow, BOOL fRelative, int * piTop, int * piLeft, int * piBottom, int * piRight ); extern int hb_ctwMoveWindow( int iWindow, int iRow, int iCol ); extern int hb_ctwCenterWindow( int iWindow, BOOL fCenter ); -extern int hb_ctwAddWindowBox( int iWindow, const BYTE * szBox, int iColor ); +extern int hb_ctwAddWindowBox( int iWindow, const char * szBox, int iColor ); extern int hb_ctwSwapWindows( int iWindow1, int iWindow2 ); extern int hb_ctwGetPosWindow( int iRow, int iCol ); extern int hb_ctwLastKey( void ); diff --git a/harbour/contrib/hbct/screen2.c b/harbour/contrib/hbct/screen2.c index dd8c05a380..0c10895bf0 100644 --- a/harbour/contrib/hbct/screen2.c +++ b/harbour/contrib/hbct/screen2.c @@ -249,11 +249,11 @@ HB_FUNC( CLEARSLOW ) if( iTop >= 0 && iLeft >= 0 && iTop <= iBottom && iLeft <= iRight ) { - BYTE pbFrame[2], bColor = ( BYTE ) hb_gtGetCurrColor(); + char pszFrame[2], bColor = ( BYTE ) hb_gtGetCurrColor(); double dX, dY, dXX, dYY; - pbFrame[0] = ucChar; - pbFrame[1] = '\0'; + pszFrame[0] = ( char ) ucChar; + pszFrame[1] = '\0'; dX = iRight - iLeft + 1; dY = iBottom - iTop + 1; @@ -272,7 +272,7 @@ HB_FUNC( CLEARSLOW ) hb_gtBeginWrite(); for( ;; ) { - hb_gtBoxEx( iTop, iLeft, iBottom, iRight, pbFrame, bColor ); + hb_gtBoxEx( iTop, iLeft, iBottom, iRight, pszFrame, bColor ); if( lDelay ) { hb_gtEndWrite(); @@ -442,5 +442,5 @@ HB_FUNC( _HB_CTDSPTIME ) if( szTime[0] == '0' ) szTime[0] = ' '; - hb_gtPutText( sRow, sCol, ( const BYTE * ) szTime, iLen, iColor ); + hb_gtPutText( sRow, sCol, szTime, iLen, iColor ); } diff --git a/harbour/contrib/hbtip/httpcln.prg b/harbour/contrib/hbtip/httpcln.prg index f699b9c035..6815a46499 100644 --- a/harbour/contrib/hbtip/httpcln.prg +++ b/harbour/contrib/hbtip/httpcln.prg @@ -4,7 +4,7 @@ /* * xHarbour Project source code: - * TIP Class oriented Internet protocol library + * TIP Class oriented Internet protocol library (HTTP) * * Copyright 2003 Giancarlo Niccolai * www - http://www.harbour-project.org @@ -57,10 +57,6 @@ #include "tip.ch" -/** -* Inet service manager: http -*/ - CREATE CLASS tIPClientHTTP FROM tIPClient VAR cMethod @@ -124,7 +120,6 @@ METHOD Get( cQuery ) CLASS tIPClientHTTP RETURN .F. - METHOD Post( xPostData, cQuery ) CLASS tIPClientHTTP LOCAL cData, nI, cTmp, y @@ -170,7 +165,7 @@ METHOD Post( xPostData, cQuery ) CLASS tIPClientHTTP ENDIF ::InetSendall( ::SocketCon, "Content-Length: " + ; - hb_NToS( Len( cData ) ) + ::cCRLF ) + hb_ntos( Len( cData ) ) + ::cCRLF ) // End of header ::InetSendall( ::SocketCon, ::cCRLF ) diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index 173e4fec42..9a0d42c780 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -227,7 +227,7 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF cMimeText := "text/html ; charset=ISO-8859-1" oAttach:hHeaders[ "Content-Type" ] := cMimeText cBodyTemp := cBody - cBody := MemoRead( cBodyTemp ) + chr( 13 ) + chr( 10 ) + cBody := MemoRead( cBodyTemp ) + Chr( 13 ) + Chr( 10 ) ELSE oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851" diff --git a/harbour/contrib/hbtip/thtml.prg b/harbour/contrib/hbtip/thtml.prg index 4950378784..cf65114065 100644 --- a/harbour/contrib/hbtip/thtml.prg +++ b/harbour/contrib/hbtip/thtml.prg @@ -1052,14 +1052,14 @@ METHOD toString( nIndent ) CLASS THtmlNode FOR i := 1 TO imax oNode := ::htmlContent[ i ] IF ! oNode:isInline() .OR. oNode:htmlTagName == "!--" - cHtml += chr( 13 ) + Chr( 10 ) + cHtml += Chr( 13 ) + Chr( 10 ) ENDIF cHtml += oNode:toString( nIndent + 1 ) NEXT #else FOR EACH oNode IN ::htmlContent IF ! oNode:isInline() .OR. oNode:htmlTagName == "!--" - cHtml += chr( 13 ) + Chr( 10 ) + cHtml += Xhr( 13 ) + Chr( 10 ) ENDIF cHtml += oNode:toString( nIndent + 1 ) NEXT diff --git a/harbour/examples/hbmake/hbmakec.c b/harbour/examples/hbmake/hbmakec.c index 0a662b5847..9bac73e437 100644 --- a/harbour/examples/hbmake/hbmakec.c +++ b/harbour/examples/hbmake/hbmakec.c @@ -97,21 +97,21 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent ) hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 ); hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), iCenter + 2, - ( const BYTE * ) szPct, 4 ); + szPct, 4 ); } hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1, ( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1, ( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1, ( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1, - ( const BYTE * ) szStr ); + szStr ); iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 ); for( iRow = 1; iRow <= iMax; iRow++ ) { hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ), ( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ), - ( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ), + * hb_arrayGetCPtr( pArray, B_BARCHAR ), iCols ); } @@ -168,18 +168,18 @@ HB_FUNC( GAUGEDISPLAY ) ( SHORT) hb_arrayGetNI( pArray, B_LEFT ), ( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ), ( SHORT) hb_arrayGetNI( pArray, B_RIGHT ), - ( const BYTE * ) szStr ); + szStr ); hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), ( SHORT ) hb_arrayGetNI( pArray, B_LEFT ), ( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ), ( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ), - ( const BYTE * ) B_BOXLINES ); + B_BOXLINES ); if( hb_arrayGetL( pArray, B_DISPLAYNUM ) ) hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ), iCenter, - ( const BYTE * ) "[ ]", 8 ); + "[ ]", 8 ); hb_gtSetColorStr( szOldColor ); diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 7067c1f704..b6e3aeaf85 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -171,10 +171,10 @@ extern HB_EXPORT HB_ERRCODE hb_gtInit( HB_FHANDLE hFilenoStdin, HB_FHANDLE hFile extern HB_EXPORT HB_ERRCODE hb_gtExit( void ); extern HB_EXPORT HB_ERRCODE hb_gtLock( void ); extern HB_EXPORT HB_ERRCODE hb_gtUnlock( void ); -extern HB_EXPORT HB_ERRCODE hb_gtBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const BYTE * pbyFrame ); +extern HB_EXPORT HB_ERRCODE hb_gtBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const char * szFrame ); extern HB_EXPORT HB_ERRCODE hb_gtBoxD( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight ); extern HB_EXPORT HB_ERRCODE hb_gtBoxS( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight ); -extern HB_EXPORT HB_ERRCODE hb_gtDrawBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const BYTE * pbyFrame, int iColor ); +extern HB_EXPORT HB_ERRCODE hb_gtDrawBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const char * szFrame, int iColor ); extern HB_EXPORT HB_ERRCODE hb_gtColorSelect( USHORT uiColorIndex ); extern HB_EXPORT int hb_gtColorToN( const char * szColorString ); extern HB_EXPORT HB_ERRCODE hb_gtColorsToString( int * pColors, int iColorCount, char * pszColorString, int iBufSize ); @@ -195,7 +195,7 @@ extern HB_EXPORT HB_ERRCODE hb_gtSuspend( void ); /* prepare the reminal for she 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, BYTE byChar, USHORT uiCount ); +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 ); @@ -213,13 +213,13 @@ extern HB_EXPORT HB_ERRCODE hb_gtSetMode( USHORT uiRows, USHORT uiCols ); extern HB_EXPORT HB_ERRCODE hb_gtSetPos( SHORT iRow, SHORT 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 BYTE * pbyStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const BYTE * pbyStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtWriteCon( const BYTE * pbyStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, const BYTE * pStr, ULONG ulLength, int iColor ); +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_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 const char * hb_gtVersion( int iType ); -extern HB_EXPORT HB_ERRCODE hb_gtOutStd( const BYTE * pbyStr, ULONG ulLen ); -extern HB_EXPORT HB_ERRCODE hb_gtOutErr( const BYTE * pbyStr, ULONG ulLen ); +extern HB_EXPORT HB_ERRCODE hb_gtOutStd( const char * szStr, ULONG ulLen ); +extern HB_EXPORT HB_ERRCODE hb_gtOutErr( const char * szStr, ULONG ulLen ); extern HB_EXPORT HB_ERRCODE hb_gtSetDispCP( const char * pszTermCDP, const char * pszHostCDP, BOOL fBox ); extern HB_EXPORT HB_ERRCODE hb_gtSetKeyCP( const char * pszTermCDP, const char * pszHostCDP ); extern HB_EXPORT HB_ERRCODE hb_gtInfo( int iType, PHB_GT_INFO pInfo ); @@ -235,7 +235,7 @@ extern HB_EXPORT HB_ERRCODE hb_gtPutScrChar( int iRow, int iCol, BYTE bColor, BY extern HB_EXPORT HB_ERRCODE hb_gtFlush( void ); extern HB_EXPORT HB_ERRCODE hb_gtGetPosEx( int * piRow, int * piCol ); extern HB_EXPORT HB_ERRCODE hb_gtScrollEx( int iTop, int iLeft, int iBottom, int iRight, int iColor, int iChar, int iRows, int iCols ); -extern HB_EXPORT HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const BYTE * pbyFrame, int iColor ); +extern HB_EXPORT HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor ); extern HB_EXPORT int hb_gtGfxPrimitive( int iType, int iTop, int iLeft, int iBottom, int iRight, int iColor ); extern HB_EXPORT HB_ERRCODE hb_gtGfxText( int iTop, int iLeft, const char * szText, int iColor, int iSize, int iWidth ); diff --git a/harbour/include/hbgtcore.h b/harbour/include/hbgtcore.h index 5271797375..25812bbb70 100644 --- a/harbour/include/hbgtcore.h +++ b/harbour/include/hbgtcore.h @@ -160,18 +160,18 @@ typedef struct long (* RectSize) ( HB_GT_PTR, int, int, int, int ); void (* Save) ( HB_GT_PTR, int, int, int, int, BYTE * ); void (* Rest) ( HB_GT_PTR, int, int, int, int, const BYTE * ); - void (* PutText) ( HB_GT_PTR, int, int, BYTE, const BYTE *, ULONG ); + void (* PutText) ( HB_GT_PTR, int, int, BYTE, const char *, ULONG ); void (* Replicate) ( HB_GT_PTR, int, int, BYTE, BYTE, USHORT, ULONG ); - void (* WriteAt) ( HB_GT_PTR, int, int, const BYTE *, ULONG ); - void (* Write) ( HB_GT_PTR, const BYTE *, ULONG ); - void (* WriteCon) ( HB_GT_PTR, const BYTE *, ULONG ); + void (* WriteAt) ( HB_GT_PTR, int, int, const char *, ULONG ); + void (* Write) ( HB_GT_PTR, const char *, ULONG ); + void (* WriteCon) ( HB_GT_PTR, const char *, ULONG ); void (* SetAttribute) ( HB_GT_PTR, int, int, int, int, BYTE ); void (* DrawShadow) ( HB_GT_PTR, int, int, int, int, BYTE ); void (* Scroll) ( HB_GT_PTR, int, int, int, int, BYTE, BYTE, int, int ); void (* ScrollUp) ( HB_GT_PTR, int, BYTE, BYTE ); - void (* Box) ( HB_GT_PTR, int, int, int, int, const BYTE *, BYTE ); - void (* BoxD) ( HB_GT_PTR, int, int, int, int, const BYTE *, BYTE ); - void (* BoxS) ( HB_GT_PTR, int, int, int, int, const BYTE *, BYTE ); + void (* Box) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); + void (* BoxD) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); + void (* BoxS) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); void (* HorizLine) ( HB_GT_PTR, int, int, int, BYTE, BYTE ); void (* VertLine) ( HB_GT_PTR, int, int, int, BYTE, BYTE ); BOOL (* GetBlink) ( HB_GT_PTR ); @@ -182,8 +182,8 @@ typedef struct BOOL (* Resume) ( HB_GT_PTR ); BOOL (* PreExt) ( HB_GT_PTR ); BOOL (* PostExt) ( HB_GT_PTR ); - void (* OutStd) ( HB_GT_PTR, const BYTE *, ULONG ); - void (* OutErr) ( HB_GT_PTR, const BYTE *, ULONG ); + void (* OutStd) ( HB_GT_PTR, const char *, ULONG ); + void (* OutErr) ( HB_GT_PTR, const char *, ULONG ); void (* Tone) ( HB_GT_PTR, double, double ); void (* Bell) ( HB_GT_PTR ); BOOL (* Info) ( HB_GT_PTR, int, PHB_GT_INFO ); diff --git a/harbour/source/rtl/box.c b/harbour/source/rtl/box.c index 02751bb5b1..d9aefaf0d0 100644 --- a/harbour/source/rtl/box.c +++ b/harbour/source/rtl/box.c @@ -80,7 +80,7 @@ HB_FUNC( DISPBOX ) hb_itemGetNI( pLeft), hb_itemGetNI( pBottom ), hb_itemGetNI( pRight ), - ( const BYTE * ) ( *pszBox ? pszBox : " " ), + *pszBox ? pszBox : " ", iColor ); } else @@ -135,7 +135,7 @@ HB_FUNC( HB_DISPBOX ) ( SHORT ) hb_itemGetNI( pLeft), ( SHORT ) hb_itemGetNI( pBottom ), ( SHORT ) hb_itemGetNI( pRight ), - ( const BYTE * ) ( *pszBox ? pszBox : " " ), + *pszBox ? pszBox : " ", iColor ); } } diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index c2c0293b9f..0ddd27c7c4 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -200,75 +200,75 @@ HB_FUNC( HB_OSNEWLINE ) } /* Output an item to STDOUT */ -void hb_conOutStd( const char * pStr, ULONG ulLen ) +void hb_conOutStd( const char * szStr, ULONG ulLen ) { - HB_TRACE(HB_TR_DEBUG, ("hb_conOutStd(%s, %lu)", pStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_conOutStd(%s, %lu)", szStr, ulLen)); if( ulLen == 0 ) - ulLen = strlen( pStr ); + ulLen = strlen( szStr ); if( ulLen > 0 ) - hb_gtOutStd( ( const BYTE * ) pStr, ulLen ); + hb_gtOutStd( szStr, ulLen ); } /* Output an item to STDERR */ -void hb_conOutErr( const char * pStr, ULONG ulLen ) +void hb_conOutErr( const char * szStr, ULONG ulLen ) { - HB_TRACE(HB_TR_DEBUG, ("hb_conOutErr(%s, %lu)", pStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_conOutErr(%s, %lu)", szStr, ulLen)); if( ulLen == 0 ) - ulLen = strlen( pStr ); + ulLen = strlen( szStr ); if( ulLen > 0 ) - hb_gtOutErr( ( const BYTE * ) pStr, ulLen ); + hb_gtOutErr( szStr, ulLen ); } /* Output an item to the screen and/or printer and/or alternate */ -void hb_conOutAlt( const char * pStr, ULONG ulLen ) +void hb_conOutAlt( const char * szStr, ULONG ulLen ) { HB_FHANDLE hFile; - HB_TRACE(HB_TR_DEBUG, ("hb_conOutAlt(%s, %lu)", pStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_conOutAlt(%s, %lu)", szStr, ulLen)); if( hb_setGetConsole() ) - hb_gtWriteCon( ( const BYTE * ) pStr, ulLen ); + hb_gtWriteCon( szStr, ulLen ); if( hb_setGetAlternate() && ( hFile = hb_setGetAltHan() ) != FS_ERROR ) { /* Print to alternate file if SET ALTERNATE ON and valid alternate file */ - hb_fsWriteLarge( hFile, pStr, ulLen ); + hb_fsWriteLarge( hFile, szStr, ulLen ); } if( ( hFile = hb_setGetExtraHan() ) != FS_ERROR ) { /* Print to extra file if valid alternate file */ - hb_fsWriteLarge( hFile, pStr, ulLen ); + hb_fsWriteLarge( hFile, szStr, ulLen ); } if( ( hFile = hb_setGetPrinterHandle( HB_SET_PRN_CON ) ) != FS_ERROR ) { /* Print to printer if SET PRINTER ON and valid printer file */ - hb_fsWriteLarge( hFile, pStr, ulLen ); + hb_fsWriteLarge( hFile, szStr, ulLen ); hb_prnPos()->col += ( USHORT ) ulLen; } } /* Output an item to the screen and/or printer */ -static void hb_conOutDev( const char * pStr, ULONG ulLen ) +static void hb_conOutDev( const char * szStr, ULONG ulLen ) { HB_FHANDLE hFile; - HB_TRACE(HB_TR_DEBUG, ("hb_conOutDev(%s, %lu)", pStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_conOutDev(%s, %lu)", szStr, ulLen)); if( ( hFile = hb_setGetPrinterHandle( HB_SET_PRN_DEV ) ) != FS_ERROR ) { /* Display to printer if SET DEVICE TO PRINTER and valid printer file */ - hb_fsWriteLarge( hFile, pStr, ulLen ); + hb_fsWriteLarge( hFile, szStr, ulLen ); hb_prnPos()->col += ( USHORT ) ulLen; } else /* Otherwise, display to console */ - hb_gtWrite( ( const BYTE * ) pStr, ulLen ); + hb_gtWrite( szStr, ulLen ); } static char * hb_itemStringCon( PHB_ITEM pItem, ULONG * pulLen, BOOL * pfFreeReq ) @@ -362,7 +362,7 @@ HB_FUNC( QOUT ) { if( pPrnPos->col > sizeof( buf ) ) { - BYTE * pBuf = ( BYTE * ) hb_xgrab( pPrnPos->col ); + char * pBuf = ( char * ) hb_xgrab( pPrnPos->col ); memset( pBuf, ' ', pPrnPos->col ); hb_fsWrite( hFile, pBuf, pPrnPos->col ); hb_xfree( pBuf ); @@ -539,7 +539,7 @@ HB_FUNC( DISPOUT ) /* writes a single value to the screen, but is not affected b pszString = hb_itemStringCon( hb_param( 1, HB_IT_ANY ), &ulLen, &bFreeReq ); - hb_gtWrite( ( const BYTE * ) pszString, ulLen ); + hb_gtWrite( pszString, ulLen ); if( bFreeReq ) hb_xfree( pszString ); @@ -550,7 +550,7 @@ HB_FUNC( DISPOUT ) /* writes a single value to the screen, but is not affected b { pszString = hb_itemStringCon( hb_param( 1, HB_IT_ANY ), &ulLen, &bFreeReq ); - hb_gtWrite( ( const BYTE * ) pszString, ulLen ); + hb_gtWrite( pszString, ulLen ); if( bFreeReq ) hb_xfree( pszString ); @@ -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 ), ( const BYTE * ) pszString, ulLen ); + hb_gtWriteAt( ( USHORT ) hb_parni( 1 ), ( USHORT ) 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 ), ( const BYTE * ) pszString, ulLen ); + hb_gtWriteAt( ( USHORT ) hb_parni( 1 ), ( USHORT ) 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 ), ( const BYTE * ) pszString, ulLen, iColor ); + hb_gtPutText( ( USHORT ) hb_parni( 1 ), ( USHORT ) hb_parni( 2 ), pszString, ulLen, iColor ); if( bFreeReq ) hb_xfree( pszString ); diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index a04acf14d9..7f5a7e4bd7 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -165,16 +165,16 @@ int hb_gtReadKey( int iEventMask ) return iKey; } -HB_ERRCODE hb_gtBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const BYTE * pbyFrame ) +HB_ERRCODE hb_gtBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const char * szFrame ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtBox(%hd, %hd, %hd, %hd, %p)", Top, Left, Bottom, Right, pbyFrame)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtBox(%hd, %hd, %hd, %hd, %p)", Top, Left, Bottom, Right, szFrame)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, pbyFrame, HB_GTSELF_GETCOLOR( pGT ) ); + HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, szFrame, HB_GTSELF_GETCOLOR( pGT ) ); HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -192,7 +192,7 @@ HB_ERRCODE hb_gtBoxD( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right ) pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, ( const BYTE * ) _B_DOUBLE, HB_GTSELF_GETCOLOR( pGT ) ); + HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, _B_DOUBLE, HB_GTSELF_GETCOLOR( pGT ) ); HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -210,7 +210,7 @@ HB_ERRCODE hb_gtBoxS( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right ) pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, ( const BYTE * ) _B_SINGLE, HB_GTSELF_GETCOLOR( pGT ) ); + HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, _B_SINGLE, HB_GTSELF_GETCOLOR( pGT ) ); HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -219,11 +219,11 @@ HB_ERRCODE hb_gtBoxS( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right ) return HB_FAILURE; } -HB_ERRCODE hb_gtDrawBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const BYTE * pbyFrame, int iColor ) +HB_ERRCODE hb_gtDrawBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const char * szFrame, int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawBox(%hd, %hd, %hd, %hd, %p, %d)", Top, Left, Bottom, Right, pbyFrame, iColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawBox(%hd, %hd, %hd, %hd, %p, %d)", Top, Left, Bottom, Right, szFrame, iColor)); pGT = hb_gt_Base(); if( pGT ) @@ -231,7 +231,7 @@ HB_ERRCODE hb_gtDrawBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const if( iColor == -1 ) iColor = HB_GTSELF_GETCOLOR( pGT ); - HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, pbyFrame, iColor ); + HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, szFrame, iColor ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -587,17 +587,17 @@ BOOL hb_gtIsColor( void ) return fColor; } -HB_ERRCODE hb_gtRepChar( USHORT uiRow, USHORT uiCol, BYTE byChar, USHORT uiCount ) +HB_ERRCODE hb_gtRepChar( USHORT uiRow, USHORT uiCol, USHORT usChar, USHORT uiCount ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtRepChar(%hu, %hu, %d, %hu)", uiRow, uiCol, (int) byChar, uiCount)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtRepChar(%hu, %hu, %hu, %hu)", uiRow, uiCol, usChar, uiCount)); pGT = hb_gt_Base(); if( pGT ) { HB_GTSELF_REPLICATE( pGT, uiRow, uiCol, HB_GTSELF_GETCOLOR( pGT ), 0, - byChar, uiCount ); + usChar, uiCount ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -758,12 +758,12 @@ HB_ERRCODE hb_gtSetMode( USHORT uiRows, USHORT uiCols ) } HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, - const BYTE * pStr, ULONG ulLength, + const char * szStr, ULONG ulLength, int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtPutText(%hu, %hu, %p, %lu, %d)", uiRow, uiCol, pStr, ulLength, iColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtPutText(%hu, %hu, %p, %lu, %d)", uiRow, uiCol, szStr, ulLength, iColor)); pGT = hb_gt_Base(); if( pGT ) @@ -771,7 +771,7 @@ HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, if( iColor == -1 ) iColor = HB_GTSELF_GETCOLOR( pGT ); - HB_GTSELF_PUTTEXT( pGT, uiRow, uiCol, iColor, pStr, ulLength ); + HB_GTSELF_PUTTEXT( pGT, uiRow, uiCol, iColor, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); @@ -780,16 +780,16 @@ HB_ERRCODE hb_gtPutText( USHORT uiRow, USHORT uiCol, return HB_FAILURE; } -HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const BYTE * pStr, ULONG ulLength ) +HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const char * szStr, ULONG ulLength ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteAt(%hu, %hu, %p, %lu)", uiRow, uiCol, pStr, ulLength)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteAt(%hu, %hu, %p, %lu)", uiRow, uiCol, szStr, ulLength)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_WRITEAT( pGT, uiRow, uiCol, pStr, ulLength ); + HB_GTSELF_WRITEAT( pGT, uiRow, uiCol, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -797,16 +797,16 @@ HB_ERRCODE hb_gtWriteAt( USHORT uiRow, USHORT uiCol, const BYTE * pStr, ULONG ul return HB_FAILURE; } -HB_ERRCODE hb_gtWrite( const BYTE * pStr, ULONG ulLength ) +HB_ERRCODE hb_gtWrite( const char * szStr, ULONG ulLength ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtWrite(%p, %lu)", pStr, ulLength)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtWrite(%p, %lu)", szStr, ulLength)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_WRITE( pGT, pStr, ulLength ); + HB_GTSELF_WRITE( pGT, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -814,16 +814,16 @@ HB_ERRCODE hb_gtWrite( const BYTE * pStr, ULONG ulLength ) return HB_FAILURE; } -HB_ERRCODE hb_gtWriteCon( const BYTE * pStr, ULONG ulLength ) +HB_ERRCODE hb_gtWriteCon( const char * szStr, ULONG ulLength ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteCon(%p, %lu)", pStr, ulLength)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtWriteCon(%p, %lu)", szStr, ulLength)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_WRITECON( pGT, pStr, ulLength ); + HB_GTSELF_WRITECON( pGT, szStr, ulLength ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -969,38 +969,38 @@ HB_ERRCODE hb_gtResume( void ) return errCode; } -HB_ERRCODE hb_gtOutStd( const BYTE * pbyStr, ULONG ulLen ) +HB_ERRCODE hb_gtOutStd( const char * szStr, ULONG ulLen ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtOutStd(%p, %lu)", pbyStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtOutStd(%p, %lu)", szStr, ulLen)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_OUTSTD( pGT, pbyStr, ulLen ); + HB_GTSELF_OUTSTD( pGT, szStr, ulLen ); hb_gt_BaseFree( pGT ); } else - hb_fsWriteLarge( ( HB_FHANDLE ) HB_STDOUT_HANDLE, pbyStr, ulLen ); + hb_fsWriteLarge( ( HB_FHANDLE ) HB_STDOUT_HANDLE, szStr, ulLen ); return HB_SUCCESS; } -HB_ERRCODE hb_gtOutErr( const BYTE * pbyStr, ULONG ulLen ) +HB_ERRCODE hb_gtOutErr( const char * szStr, ULONG ulLen ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtOutErr(%p, %lu)", pbyStr, ulLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtOutErr(%p, %lu)", szStr, ulLen)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_OUTERR( pGT, pbyStr, ulLen ); + HB_GTSELF_OUTERR( pGT, szStr, ulLen ); hb_gt_BaseFree( pGT ); } else - hb_fsWriteLarge( ( HB_FHANDLE ) HB_STDERR_HANDLE, pbyStr, ulLen ); + hb_fsWriteLarge( ( HB_FHANDLE ) HB_STDERR_HANDLE, szStr, ulLen ); return HB_SUCCESS; } @@ -1260,18 +1260,18 @@ HB_ERRCODE hb_gtScrollEx( int iTop, int iLeft, int iBottom, int iRight, int iCol return HB_FAILURE; } -HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const BYTE * pbyFrame, int iColor ) +HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxEx(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, pbyFrame, iColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxEx(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, szFrame, iColor)); pGT = hb_gt_Base(); if( pGT ) { if( iColor == -1 ) iColor = HB_GTSELF_GETCOLOR( pGT ); - HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, pbyFrame, iColor ); + HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, szFrame, iColor ); HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); diff --git a/harbour/source/rtl/gtcgi/gtcgi.c b/harbour/source/rtl/gtcgi/gtcgi.c index 7966c8755b..3c59751217 100644 --- a/harbour/source/rtl/gtcgi/gtcgi.c +++ b/harbour/source/rtl/gtcgi/gtcgi.c @@ -90,7 +90,7 @@ typedef struct _HB_GTCGI int iCol; int iLastCol; int iLineBufSize; - BYTE * sLineBuf; + char * sLineBuf; char * szCrLf; ULONG ulCrLf; BOOL fDispTrans; @@ -98,14 +98,14 @@ typedef struct _HB_GTCGI PHB_CODEPAGE cdpHost; } HB_GTCGI, * PHB_GTCGI; -static void hb_gt_cgi_termOut( PHB_GTCGI pGTCGI, const BYTE * pStr, ULONG ulLen ) +static void hb_gt_cgi_termOut( PHB_GTCGI pGTCGI, const char * szStr, ULONG ulLen ) { - hb_fsWriteLarge( pGTCGI->hStdout, pStr, ulLen ); + hb_fsWriteLarge( pGTCGI->hStdout, szStr, ulLen ); } static void hb_gt_cgi_newLine( PHB_GTCGI pGTCGI ) { - hb_gt_cgi_termOut( pGTCGI, ( const BYTE * ) pGTCGI->szCrLf, pGTCGI->ulCrLf ); + hb_gt_cgi_termOut( pGTCGI, pGTCGI->szCrLf, pGTCGI->ulCrLf ); } static void hb_gt_cgi_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr ) @@ -176,7 +176,7 @@ static BOOL hb_gt_cgi_IsColor( PHB_GT pGT ) static void hb_gt_cgi_Bell( PHB_GT pGT ) { - static const BYTE s_szBell[] = { HB_CHAR_BEL, 0 }; + static const char s_szBell[] = { HB_CHAR_BEL, 0 }; PHB_GTCGI pGTCGI; HB_TRACE(HB_TR_DEBUG, ("hb_gt_cgi_Bell(%p)", pGT)); @@ -254,25 +254,25 @@ static BOOL hb_gt_cgi_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char #ifdef HB_GT_CGI_RAWOUTPUT -static void hb_gt_cgi_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) +static void hb_gt_cgi_WriteCon( PHB_GT pGT, const char * szText, ULONG ulLength ) { - BYTE * buffer = NULL; + char * buffer = NULL; PHB_GTCGI pGTCGI = HB_GTCGI_GET( pGT ); #ifndef HB_CDP_SUPPORT_OFF if( pGTCGI->fDispTrans ) { - buffer = ( BYTE * ) hb_xgrab( ulLength ); - memcpy( buffer, pText, ulLength ); - hb_cdpnTranslate( ( char * ) buffer, pGTCGI->cdpHost, pGTCGI->cdpTerm, ulLength ); - pText = buffer; + buffer = ( char * ) hb_xgrab( ulLength ); + memcpy( buffer, szText, ulLength ); + hb_cdpnTranslate( buffer, pGTCGI->cdpHost, pGTCGI->cdpTerm, ulLength ); + szText = buffer; } #endif - hb_gt_cgi_termOut( pGTCGI, pText, ulLength ); + hb_gt_cgi_termOut( pGTCGI, szText, ulLength ); while( ulLength-- ) { - switch( *pText++ ) + switch( *szText++ ) { case HB_CHAR_BEL: break; @@ -300,7 +300,7 @@ static void hb_gt_cgi_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) hb_xfree( buffer ); } -static void hb_gt_cgi_WriteAt( PHB_GT pGT, int iRow, int iCol, const BYTE * pText, ULONG ulLength ) +static void hb_gt_cgi_WriteAt( PHB_GT pGT, int iRow, int iCol, const char * szText, ULONG ulLength ) { int iLineFeed = 0, iSpace = 0; PHB_GTCGI pGTCGI = HB_GTCGI_GET( pGT ); @@ -321,7 +321,7 @@ static void hb_gt_cgi_WriteAt( PHB_GT pGT, int iRow, int iCol, const BYTE * pTex if( iSpace > 0 ) { - BYTE * buffer = ( BYTE * ) hb_xgrab( iSpace ); + char * buffer = ( char * ) hb_xgrab( iSpace ); memset( buffer, ' ', iSpace ); hb_gt_cgi_termOut( pGTCGI, buffer, iSpace ); hb_xfree( buffer ); @@ -331,7 +331,7 @@ static void hb_gt_cgi_WriteAt( PHB_GT pGT, int iRow, int iCol, const BYTE * pTex pGTCGI->iRow = iRow; pGTCGI->iCol = iCol; - hb_gt_cgi_WriteCon( pGT, pText, ulLength ); + hb_gt_cgi_WriteCon( pGT, szText, ulLength ); } #else /* HB_GT_CGI_RAWOUTPUT */ @@ -385,7 +385,7 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) break; - pGTCGI->sLineBuf[ iLen++ ] = ( BYTE ) usChar; + pGTCGI->sLineBuf[ iLen++ ] = ( char ) usChar; ++iCol; } if( iLen ) @@ -413,12 +413,12 @@ static void hb_gt_cgi_Refresh( PHB_GT pGT ) HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth ); if( pGTCGI->iLineBufSize == 0 ) { - pGTCGI->sLineBuf = ( BYTE * ) hb_xgrab( iWidth ); + pGTCGI->sLineBuf = ( char * ) hb_xgrab( iWidth ); pGTCGI->iLineBufSize = iWidth; } else if( pGTCGI->iLineBufSize < iWidth ) { - pGTCGI->sLineBuf = ( BYTE * ) hb_xrealloc( pGTCGI->sLineBuf, iWidth ); + pGTCGI->sLineBuf = ( char * ) hb_xrealloc( pGTCGI->sLineBuf, iWidth ); pGTCGI->iLineBufSize = iWidth; } HB_GTSUPER_REFRESH( pGT ); diff --git a/harbour/source/rtl/gtos2/gtos2.c b/harbour/source/rtl/gtos2/gtos2.c index 510c5eae99..7968a2d612 100644 --- a/harbour/source/rtl/gtos2/gtos2.c +++ b/harbour/source/rtl/gtos2/gtos2.c @@ -136,7 +136,7 @@ static int s_iCursorStyle; /* buffer for single screen line */ static int s_iLineBufSize = 0; -static BYTE * s_sLineBuf; +static char * s_sLineBuf; /* Code page ID of active codepage at the time harbour program was start */ static USHORT s_usOldCodePage; @@ -491,7 +491,7 @@ static void hb_gt_os2_SetCursorStyle( int iStyle ) static void hb_gt_os2_GetScreenContents( PHB_GT pGT ) { int iRow, iCol; - BYTE * pBufPtr; + char * pBufPtr; HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_GetScreenContents(%p)", pGT)); @@ -719,7 +719,7 @@ static BOOL hb_gt_os2_Resize( PHB_GT pGT, int iRows, int iCols ) if( s_iLineBufSize != 0 ) DosFreeMem( ( PVOID ) s_sLineBuf ); if( iRows ) - s_sLineBuf = ( BYTE * ) hb_gt_os2_allocMem( iRows ); + s_sLineBuf = ( char * ) hb_gt_os2_allocMem( iRows ); s_iLineBufSize = iRows; } return TRUE; @@ -786,7 +786,7 @@ static BOOL hb_gt_os2_Resume( PHB_GT pGT ) static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { - BYTE *pBufPtr = s_sLineBuf, bColor, bAttr; + char * pBufPtr = s_sLineBuf, bColor, bAttr; USHORT usChar; int iLen = 0; @@ -797,7 +797,7 @@ static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) break; - *pBufPtr++ = ( BYTE ) usChar; + *pBufPtr++ = ( char ) usChar; *pBufPtr++ = bColor; ++iLen; } diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 144df6e705..9fc919ae65 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -93,7 +93,7 @@ static HB_GT_FUNCS SuperTable; #define HB_GTSUPER (&SuperTable) #define HB_GTID_PTR (&s_GtId) -static const BYTE s_szBell[] = { HB_CHAR_BEL, 0 }; +static const char s_szBell[] = { HB_CHAR_BEL, 0 }; static const int s_AnsiColors[] = { 0, 4, 2, 6, 1, 5, 3, 7 }; static HB_FHANDLE s_hFilenoStdin; @@ -102,8 +102,8 @@ static HB_FHANDLE s_hFilenoStderr; static int s_iRow; static int s_iCol; static int s_iLineBufSize = 0; -static BYTE * s_sLineBuf; -static BYTE * s_szCrLf; +static char * s_sLineBuf; +static const char * s_szCrLf; static ULONG s_ulCrLf; static int s_iCurrentSGR, s_iFgColor, s_iBgColor, s_iBold, s_iBlink, s_iAM; static int s_iCursorStyle; @@ -117,7 +117,7 @@ static BYTE s_keyTransTbl[ 256 ]; static int s_iOutBufSize = 0; static int s_iOutBufIndex = 0; -static BYTE * s_sOutBuf; +static char * s_sOutBuf; #if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) @@ -181,7 +181,7 @@ static void hb_gt_pca_termFlush( void ) } } -static void hb_gt_pca_termOut( const BYTE * pStr, int iLen ) +static void hb_gt_pca_termOut( const char * szStr, int iLen ) { if( s_iOutBufSize ) { @@ -193,8 +193,8 @@ static void hb_gt_pca_termOut( const BYTE * pStr, int iLen ) i = s_iOutBufSize - s_iOutBufIndex; if( i > iLen ) i = iLen; - memcpy( s_sOutBuf + s_iOutBufIndex, pStr, i ); - pStr += i; + memcpy( s_sOutBuf + s_iOutBufIndex, szStr, i ); + szStr += i; s_iOutBufIndex += i; iLen -= i; } @@ -213,9 +213,9 @@ static void hb_gt_pca_AnsiSetAutoMargin( int iAM ) */ #if 0 if( iAM != 0 ) - hb_gt_pca_termOut( ( BYTE * ) "\x1B[=7h", 5 ); + hb_gt_pca_termOut( "\x1B[=7h", 5 ); else - hb_gt_pca_termOut( ( BYTE * ) "\x1B[=7l", 5 ); + hb_gt_pca_termOut( "\x1B[=7l", 5 ); #endif s_iAM = iAM; } @@ -233,7 +233,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol ) int i, j, n, d, y, x; HB_ULONG end_timer, time; - hb_gt_pca_termOut( ( BYTE * ) "\x1B[6n", 4 ); + hb_gt_pca_termOut( "\x1B[6n", 4 ); hb_gt_pca_termFlush(); n = j = x = y = 0; @@ -326,9 +326,9 @@ static void hb_gt_pca_AnsiSetCursorPos( int iRow, int iCol ) if( s_iRow != iRow || s_iCol != iCol ) { - char buff[16]; + char buff[ 16 ]; hb_snprintf( buff, sizeof( buff ), "\x1B[%d;%dH", iRow + 1, iCol + 1 ); - hb_gt_pca_termOut( ( BYTE * ) buff, strlen( buff ) ); + hb_gt_pca_termOut( buff, strlen( buff ) ); s_iRow = iRow; s_iCol = iCol; } @@ -340,8 +340,8 @@ static void hb_gt_pca_AnsiSetCursorStyle( int iStyle ) if( s_iCursorStyle != iStyle ) { - hb_gt_pca_termOut( ( BYTE * ) ( iStyle == SC_NONE ? "\x1B[?25l" : - "\x1B[?25h" ), 6 ); + hb_gt_pca_termOut( ( iStyle == SC_NONE ? "\x1B[?25l" : + "\x1B[?25h" ), 6 ); s_iCursorStyle = iStyle; } } @@ -353,7 +353,7 @@ static void hb_gt_pca_AnsiSetAttributes( int iAttr ) if( s_iCurrentSGR != iAttr ) { int i, bg, fg, bold, blink; - BYTE buff[16]; + char buff[ 16 ]; i = 2; buff[ 0 ] = 0x1b; @@ -379,10 +379,10 @@ static void hb_gt_pca_AnsiSetAttributes( int iAttr ) buff[ i++ ] = ';'; } buff[ i++ ] = '3'; - buff[ i++ ] = '0' + ( BYTE ) fg; + buff[ i++ ] = '0' + ( char ) fg; buff[ i++ ] = ';'; buff[ i++ ] = '4'; - buff[ i++ ] = '0' + ( BYTE ) bg; + buff[ i++ ] = '0' + ( char ) bg; buff[ i++ ] = 'm'; s_iBold = bold; s_iBlink = blink; @@ -410,14 +410,14 @@ static void hb_gt_pca_AnsiSetAttributes( int iAttr ) if( s_iFgColor != fg ) { buff[ i++ ] = '3'; - buff[ i++ ] = '0' + ( BYTE ) fg; + buff[ i++ ] = '0' + ( char ) fg; buff[ i++ ] = ';'; s_iFgColor = fg; } if( s_iBgColor != bg ) { buff[ i++ ] = '4'; - buff[ i++ ] = '0' + ( BYTE ) bg; + buff[ i++ ] = '0' + ( char ) bg; buff[ i++ ] = ';'; s_iBgColor = bg; } @@ -436,14 +436,14 @@ static void hb_gt_pca_AnsiInit( void ) s_iCurrentSGR = s_iRow = s_iCol = s_iCursorStyle = s_iAM = -1; } -static void hb_gt_pca_AnsiPutStr( int iRow, int iCol, BYTE bAttr, BYTE *pStr, int iLen ) +static void hb_gt_pca_AnsiPutStr( int iRow, int iCol, BYTE bAttr, char * szStr, int iLen ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_pca_AnsiPutStr(%d,%d,%hu,%p,%d)", iRow, iCol, bAttr, pStr, iLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_pca_AnsiPutStr(%d,%d,%hu,%p,%d)", iRow, iCol, bAttr, szStr, iLen)); hb_gt_pca_AnsiSetAttributes( bAttr ); hb_gt_pca_AnsiSetCursorPos( iRow, iCol ); hb_gt_pca_AnsiSetAutoMargin( 0 ); - hb_gt_pca_termOut( pStr, iLen ); + hb_gt_pca_termOut( szStr, iLen ); s_iCol += iLen; } @@ -480,8 +480,8 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil s_fDispTrans = FALSE; hb_gt_pca_setKeyTrans( NULL, NULL ); - s_szCrLf = (BYTE *) hb_conNewLine(); - s_ulCrLf = strlen( (char *) s_szCrLf ); + s_szCrLf = hb_conNewLine(); + s_ulCrLf = strlen( s_szCrLf ); hb_fsSetDevMode( s_hFilenoStdout, FD_BINARY ); @@ -546,7 +546,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil { s_iOutBufIndex = 0; s_iOutBufSize = 16384; - s_sOutBuf = ( BYTE * ) hb_xgrab( s_iOutBufSize ); + s_sOutBuf = ( char * ) hb_xgrab( s_iOutBufSize ); } HB_GTSELF_RESIZE( pGT, iRows, iCols ); @@ -866,7 +866,7 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) } if( usChar < 32 || usChar == 127 ) usChar = '.'; - s_sLineBuf[ iLen++ ] = ( BYTE ) usChar; + s_sLineBuf[ iLen++ ] = ( char ) usChar; } if( iLen ) { @@ -888,12 +888,12 @@ static void hb_gt_pca_Refresh( PHB_GT pGT ) if( s_iLineBufSize == 0 ) { - s_sLineBuf = ( BYTE * ) hb_xgrab( iWidth ); + s_sLineBuf = ( char * ) hb_xgrab( iWidth ); s_iLineBufSize = iWidth; } else if( s_iLineBufSize != iWidth ) { - s_sLineBuf = ( BYTE * ) hb_xrealloc( s_sLineBuf, iWidth ); + s_sLineBuf = ( char * ) hb_xrealloc( s_sLineBuf, iWidth ); s_iLineBufSize = iWidth; } diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index a47657863a..8fb2a15404 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -87,7 +87,7 @@ static HB_GT_FUNCS SuperTable; #define HB_GTSTD_GET(p) ( ( PHB_GTSTD ) HB_GTLOCAL( p ) ) -static const BYTE s_szBell[] = { HB_CHAR_BEL, 0 }; +static const char s_szBell[] = { HB_CHAR_BEL, 0 }; typedef struct _HB_GTSTD { @@ -103,7 +103,7 @@ typedef struct _HB_GTSTD int iLastCol; int iLineBufSize; - BYTE * sLineBuf; + char * sLineBuf; BOOL fFullRedraw; char * szCrLf; ULONG ulCrLf; @@ -189,14 +189,14 @@ static void hb_gt_std_setKeyTrans( PHB_GTSTD pGTSTD, char * pSrcChars, char * pD } } -static void hb_gt_std_termOut( PHB_GTSTD pGTSTD, const BYTE * pStr, ULONG ulLen ) +static void hb_gt_std_termOut( PHB_GTSTD pGTSTD, const char * szStr, ULONG ulLen ) { - hb_fsWriteLarge( pGTSTD->hStdout, pStr, ulLen ); + hb_fsWriteLarge( pGTSTD->hStdout, szStr, ulLen ); } static void hb_gt_std_newLine( PHB_GTSTD pGTSTD ) { - hb_gt_std_termOut( pGTSTD, ( BYTE * ) pGTSTD->szCrLf, pGTSTD->ulCrLf ); + hb_gt_std_termOut( pGTSTD, pGTSTD->szCrLf, pGTSTD->ulCrLf ); } @@ -609,7 +609,7 @@ static void hb_gt_std_DispLine( PHB_GT pGT, int iRow ) break; if( usChar < 32 || usChar == 127 ) usChar = '.'; - pGTSTD->sLineBuf[ iCol ] = ( BYTE ) usChar; + pGTSTD->sLineBuf[ iCol ] = ( char ) usChar; if( usChar != ' ' ) iMin = iCol + 1; } @@ -708,7 +708,7 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) break; if( usChar < 32 || usChar == 127 ) usChar = '.'; - pGTSTD->sLineBuf[ iLen ] = ( BYTE ) usChar; + pGTSTD->sLineBuf[ iLen ] = ( char ) usChar; ++iCol; } @@ -738,12 +738,12 @@ static void hb_gt_std_Refresh( PHB_GT pGT ) pGTSTD = HB_GTSTD_GET( pGT ); if( pGTSTD->iLineBufSize == 0 ) { - pGTSTD->sLineBuf = ( BYTE * ) hb_xgrab( iWidth ); + pGTSTD->sLineBuf = ( char * ) hb_xgrab( iWidth ); pGTSTD->iLineBufSize = iWidth; } else if( pGTSTD->iLineBufSize != iWidth ) { - pGTSTD->sLineBuf = ( BYTE * ) hb_xrealloc( pGTSTD->sLineBuf, iWidth ); + pGTSTD->sLineBuf = ( char * ) hb_xrealloc( pGTSTD->sLineBuf, iWidth ); pGTSTD->iLineBufSize = iWidth; } pGTSTD->fFullRedraw = FALSE; diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index 87df3d3905..acc311256d 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -657,51 +657,49 @@ static BOOL hb_gt_def_Resume( PHB_GT pGT ) return HB_GTSELF_POSTEXT( pGT ); } -static void hb_gt_def_OutStd( PHB_GT pGT, const BYTE * pbyStr, ULONG ulLen ) +static void hb_gt_def_OutStd( PHB_GT pGT, const char * szStr, ULONG ulLen ) { if( ulLen ) { if( pGT->fStdOutCon ) - HB_GTSELF_WRITECON( pGT, pbyStr, ulLen ); + HB_GTSELF_WRITECON( pGT, szStr, ulLen ); else { HB_GTSELF_PREEXT( pGT ); if( pGT->fDispTrans ) { - BYTE * pbyStrBuff = ( BYTE * ) hb_xgrab( ulLen ); - memcpy( pbyStrBuff, pbyStr, ulLen ); - hb_cdpnTranslate( ( char * ) pbyStrBuff, - pGT->cdpHost, pGT->cdpTerm, ulLen ); - hb_fsWriteLarge( pGT->hStdOut, pbyStrBuff, ulLen ); - hb_xfree( pbyStrBuff ); + char * szStrBuff = ( char * ) hb_xgrab( ulLen ); + memcpy( szStrBuff, szStr, ulLen ); + hb_cdpnTranslate( szStrBuff, pGT->cdpHost, pGT->cdpTerm, ulLen ); + hb_fsWriteLarge( pGT->hStdOut, szStrBuff, ulLen ); + hb_xfree( szStrBuff ); } else - hb_fsWriteLarge( pGT->hStdOut, pbyStr, ulLen ); + hb_fsWriteLarge( pGT->hStdOut, szStr, ulLen ); HB_GTSELF_POSTEXT( pGT ); } } } -static void hb_gt_def_OutErr( PHB_GT pGT, const BYTE * pbyStr, ULONG ulLen ) +static void hb_gt_def_OutErr( PHB_GT pGT, const char * szStr, ULONG ulLen ) { if( ulLen ) { if( pGT->fStdErrCon ) - HB_GTSELF_WRITECON( pGT, pbyStr, ulLen ); + HB_GTSELF_WRITECON( pGT, szStr, ulLen ); else { HB_GTSELF_PREEXT( pGT ); if( pGT->fDispTrans ) { - BYTE * pbyStrBuff = ( BYTE * ) hb_xgrab( ulLen ); - memcpy( pbyStrBuff, pbyStr, ulLen ); - hb_cdpnTranslate( ( char * ) pbyStrBuff, - pGT->cdpHost, pGT->cdpTerm, ulLen ); - hb_fsWriteLarge( pGT->hStdErr, pbyStrBuff, ulLen ); - hb_xfree( pbyStrBuff ); + char * szStrBuff = ( char * ) hb_xgrab( ulLen ); + memcpy( szStrBuff, szStr, ulLen ); + hb_cdpnTranslate( szStrBuff, pGT->cdpHost, pGT->cdpTerm, ulLen ); + hb_fsWriteLarge( pGT->hStdErr, szStrBuff, ulLen ); + hb_xfree( szStrBuff ); } else - hb_fsWriteLarge( pGT->hStdErr, pbyStr, ulLen ); + hb_fsWriteLarge( pGT->hStdErr, szStr, ulLen ); HB_GTSELF_POSTEXT( pGT ); } } @@ -763,11 +761,11 @@ static BOOL hb_gt_def_PutChar( PHB_GT pGT, int iRow, int iCol, return FALSE; } -static void hb_gt_def_PutText( PHB_GT pGT, int iRow, int iCol, BYTE bColor, const BYTE * pText, ULONG ulLen ) +static void hb_gt_def_PutText( PHB_GT pGT, int iRow, int iCol, BYTE bColor, const char * szText, ULONG ulLen ) { while( ulLen-- ) { - if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, 0, *pText++ ) ) + if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, 0, *szText++ ) ) break; ++iCol; } @@ -792,36 +790,36 @@ static void hb_gt_def_Replicate( PHB_GT pGT, int iRow, int iCol, BYTE bColor, } } -static void hb_gt_def_WriteAt( PHB_GT pGT, int iRow, int iCol, const BYTE * pText, ULONG ulLength ) +static void hb_gt_def_WriteAt( PHB_GT pGT, int iRow, int iCol, const char * szText, ULONG ulLength ) { int iMaxCol = HB_GTSELF_MAXCOL( pGT ); /* Truncate the text if the cursor will end up off the right edge */ - HB_GTSELF_PUTTEXT( pGT, iRow, iCol, HB_GTSELF_GETCOLOR( pGT ), pText, + HB_GTSELF_PUTTEXT( pGT, iRow, iCol, HB_GTSELF_GETCOLOR( pGT ), szText, HB_MIN( ulLength, ( ULONG ) ( iMaxCol - iCol + 1 ) ) ); /* Finally, save the new cursor position, even if off-screen */ HB_GTSELF_SETPOS( pGT, iRow, iCol + ( int ) ulLength ); } -static void hb_gt_def_Write( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) +static void hb_gt_def_Write( PHB_GT pGT, const char * szText, ULONG ulLength ) { int iRow, iCol; HB_GTSELF_GETPOS( pGT, &iRow, &iCol ); - HB_GTSELF_WRITEAT( pGT, iRow, iCol, pText, ulLength ); + HB_GTSELF_WRITEAT( pGT, iRow, iCol, szText, ulLength ); } #define WRITECON_BUFFER_SIZE 512 -static void hb_gt_def_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) +static void hb_gt_def_WriteCon( PHB_GT pGT, const char * szText, ULONG ulLength ) { int iLen = 0; BOOL bDisp = FALSE; BOOL bBell = FALSE; BOOL bNewLine = FALSE; int iRow, iCol, iMaxRow, iMaxCol; - BYTE szString[ WRITECON_BUFFER_SIZE ]; + char szString[ WRITECON_BUFFER_SIZE ]; iMaxRow = HB_GTSELF_MAXROW( pGT ); iMaxCol = HB_GTSELF_MAXCOL( pGT ); @@ -842,7 +840,7 @@ static void hb_gt_def_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) while( ulLength-- ) { - BYTE ch = *pText++; + char ch = *szText++; switch( ch ) { @@ -883,11 +881,11 @@ static void hb_gt_def_WriteCon( PHB_GT pGT, const BYTE * pText, ULONG ulLength ) case HB_CHAR_CR: iCol = 0; - if( *pText == HB_CHAR_LF ) + if( *szText == HB_CHAR_LF ) { if( iRow >= 0 ) ++iRow; bNewLine = TRUE; - ++pText; + ++szText; --ulLength; } bDisp = TRUE; @@ -1269,7 +1267,7 @@ static void hb_gt_def_ScrollUp( PHB_GT pGT, int iRows, BYTE bColor, BYTE bChar ) } static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const BYTE * pbyFrame, BYTE bColor ) + const char * szFrame, BYTE bColor ) { int iMaxRow, iMaxCol, iRows, iCols, iFirst, i; @@ -1292,10 +1290,10 @@ static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi BYTE szBox[ 10 ]; BYTE bPadCh = HB_GTSELF_GETCLEARCHAR( pGT ); - if( pbyFrame ) + if( szFrame ) { - for( i = 0; *pbyFrame && i < 9; ++i ) - bPadCh = szBox[ i ] = *pbyFrame++; + for( i = 0; *szFrame && i < 9; ++i ) + bPadCh = szBox[ i ] = *szFrame++; } else i = 0; @@ -1352,17 +1350,17 @@ static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi } static void hb_gt_def_BoxS( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const BYTE * pbyFrame, BYTE bColor ) + const char * szFrame, BYTE bColor ) { HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, - pbyFrame ? pbyFrame : ( const BYTE * ) _B_SINGLE, bColor ); + szFrame ? szFrame : _B_SINGLE, bColor ); } static void hb_gt_def_BoxD( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const BYTE * pbyFrame, BYTE bColor ) + const char * szFrame, BYTE bColor ) { HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, - pbyFrame ? pbyFrame : ( const BYTE * ) _B_DOUBLE, bColor ); + szFrame ? szFrame : _B_DOUBLE, bColor ); } static void hb_gt_def_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, @@ -1773,7 +1771,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, HB_GTSELF_SAVE( pGT, iTop, iLeft, iBottom, iRight, pBuffer ); } HB_GTSELF_BOXS( pGT, iTop, iLeft, iBottom, iRight, NULL, iClrNorm ); - HB_GTSELF_BOXS( pGT, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1, ( const BYTE * ) " ", iClrNorm ); + HB_GTSELF_BOXS( pGT, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1, " ", iClrNorm ); ulLast = 0; i = iTop + 1; for( ul = 0; ul < ulDst; ++ul ) @@ -1786,7 +1784,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( ulLen > ulWidth ) ulLen = ulWidth; HB_GTSELF_PUTTEXT( pGT, i, iLeft + ( ( ulWidth - ulLen + 1 ) >> 1 ) + 2, - iClrNorm, ( const BYTE * ) szMsgDsp + ulLast, ulLen ); + iClrNorm, szMsgDsp + ulLast, ulLen ); } ulLast = ul + 1; if( ++i >= iBottom - 1 ) @@ -1799,7 +1797,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( ulLen > ulWidth ) ulLen = ulWidth; HB_GTSELF_PUTTEXT( pGT, i, iLeft + ( ( ulWidth - ulLen + 1 ) >> 1 ) + 2, - iClrNorm, ( const BYTE * ) szMsgDsp + ulLast, ulLen ); + iClrNorm, szMsgDsp + ulLast, ulLen ); } iPos = 1; @@ -1811,10 +1809,10 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, { iClr = i == iPos ? iClrHigh : iClrNorm; ulLen = hb_arrayGetCLen( pOptions, i ); - HB_GTSELF_PUTTEXT( pGT, iBottom - 1, iMnuCol, iClr, ( const BYTE * ) " ", 1 ); + HB_GTSELF_PUTTEXT( pGT, iBottom - 1, iMnuCol, iClr, " ", 1 ); HB_GTSELF_PUTTEXT( pGT, iBottom - 1, iMnuCol + 1, iClr, - ( const BYTE * ) hb_arrayGetCPtr( pOptions, i ), ulLen ); - HB_GTSELF_PUTTEXT( pGT, iBottom - 1, iMnuCol + 1 + ulLen, iClr, ( const BYTE * ) " ", 1 ); + hb_arrayGetCPtr( pOptions, i ), ulLen ); + HB_GTSELF_PUTTEXT( pGT, iBottom - 1, iMnuCol + 1 + ulLen, iClr, " ", 1 ); iMnuCol += ulLen + 4; } while( HB_GTSELF_DISPCOUNT( pGT ) ) @@ -1899,22 +1897,22 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, if( szMessage[ ul ] == '\n' ) { if( ul > ulStart ) - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) szMessage + ulStart, ul - ulStart ); - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) szEol, strlen( szEol ) ); + HB_GTSELF_WRITECON( pGT, szMessage + ulStart, ul - ulStart ); + HB_GTSELF_WRITECON( pGT, szEol, strlen( szEol ) ); ulStart = ul + 1; } } if( ul > ulStart ) - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) szMessage + ulStart, ul - ulStart ); - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) " (", 2 ); + HB_GTSELF_WRITECON( pGT, szMessage + ulStart, ul - ulStart ); + HB_GTSELF_WRITECON( pGT, " (", 2 ); for( i = 1; i <= iOptions; ++i ) { if( i > 1 ) - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) ", ", 2 ); - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) hb_arrayGetCPtr( pOptions, i ), - hb_arrayGetCLen( pOptions, i ) ); + HB_GTSELF_WRITECON( pGT, ", ", 2 ); + HB_GTSELF_WRITECON( pGT, hb_arrayGetCPtr( pOptions, i ), + hb_arrayGetCLen( pOptions, i ) ); } - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) ") ", 2 ); + HB_GTSELF_WRITECON( pGT, ") ", 2 ); while( iRet == 0 ) { iKey = fKeyBoard ? HB_GTSELF_INKEYGET( pGT, TRUE, dDelay, INKEY_ALL ) : 0; @@ -1941,7 +1939,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, char szVal[2]; szVal[ 0 ] = ( char ) iKey; szVal[ 1 ] = '\0'; - HB_GTSELF_WRITECON( pGT, ( const BYTE * ) szVal, 1 ); + HB_GTSELF_WRITECON( pGT, szVal, 1 ); } } } diff --git a/harbour/source/rtl/oldbox.c b/harbour/source/rtl/oldbox.c index 4e90af9d41..4fcbd96faa 100644 --- a/harbour/source/rtl/oldbox.c +++ b/harbour/source/rtl/oldbox.c @@ -69,7 +69,7 @@ HB_FUNC( __BOX ) ( SHORT ) hb_itemGetNI( pLeft), ( SHORT ) hb_itemGetNI( pBottom ), ( SHORT ) hb_itemGetNI( pRight ), - ( const BYTE * ) ( *pszBox ? pszBox : " " ) ); + *pszBox ? pszBox : " " ); } HB_FUNC( __BOXD )