diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7713fac372..86b8ea530a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,16 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-06 21:35 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * include/hbdefs.h + - Removed HB_ISSPACE(). It was already defined. + + * include/hbset.h + * contrib/hbct/ctwin.c + * contrib/hbct/ctwin.h + * source/vm/set.c + * BYTE -> UCHAR + 2009-02-06 20:02 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/codepage/cptr857.c * source/codepage/cphu852s.c diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index 2e0abb2b9f..8a1df9f55d 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -233,7 +233,7 @@ static void hb_ctw_WindowMap( PHB_GTCTW pCTW, int iWindow, BOOL fExpose ) int iLastRow = pWnd->iFirstRow + pWnd->iHeight - 1, iLastCol = pWnd->iFirstCol + pWnd->iWidth - 1; - hb_ctw_SetMap( pCTW, pCTW->pWindowMap, iWindow, + hb_ctw_SetMap( pCTW, pCTW->pWindowMap, iWindow, pWnd->iFirstRow, pWnd->iFirstCol, iLastRow, iLastCol, 0 ); hb_ctw_SetMap( pCTW, pCTW->pShadowMap, 0, @@ -981,7 +981,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, BYTE * szBox, int iColor ) +static int hb_ctw_AddWindowBox( PHB_GTCTW pCTW, int iWindow, UCHAR * szBox, int iColor ) { int iMaxRow, iMaxCol; @@ -1253,13 +1253,13 @@ static int hb_ctw_gt_MaxRow( PHB_GT pGT ) */ #define WRITECON_BUFFER_SIZE 512 -static void hb_ctw_gt_WriteCon( PHB_GT pGT, BYTE * pText, ULONG ulLength ) +static void hb_ctw_gt_WriteCon( PHB_GT pGT, UCHAR * pText, ULONG ulLength ) { int iLen = 0; BOOL bDisp = FALSE; BOOL bBell = FALSE; int iRow, iCol, iMaxRow, iMaxCol; - BYTE szString[ WRITECON_BUFFER_SIZE ]; + UCHAR szString[ WRITECON_BUFFER_SIZE ]; HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_WriteCon(%p,%p,%lu)", pGT, pText, ulLength)); @@ -1286,7 +1286,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, BYTE * pText, ULONG ulLength ) while( ulLength-- ) { - BYTE ch = *pText++; + UCHAR ch = *pText++; switch( ch ) { @@ -1879,7 +1879,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, ( BYTE * ) _B_SINGLE, iClrNorm ); + hb_ctw_AddWindowBox( pCTW, iWnd, ( UCHAR * ) _B_SINGLE, iClrNorm ); HB_GTSELF_SETCURSORSTYLE( pGT, SC_NONE ); ulLast = 0; i = 0; @@ -1893,7 +1893,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, - ( BYTE * ) szMessage + ulLast, ul2 ); + ( UCHAR * ) szMessage + ulLast, ul2 ); } ulLast = ul + 1; if( ++i >= iLines ) @@ -1906,7 +1906,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, - ( BYTE * ) szMessage + ulLast, ul2 ); + ( UCHAR * ) szMessage + ulLast, ul2 ); } iPos = 1; @@ -1919,7 +1919,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, - ( BYTE * ) hb_arrayGetCPtr( pOptions, i ), ulLen ); + ( UCHAR * ) hb_arrayGetCPtr( pOptions, i ), ulLen ); iMnuCol += ulLen + 3; } while( HB_GTSELF_DISPCOUNT( pGT ) ) @@ -2329,7 +2329,7 @@ int hb_ctwCenterWindow( int iWindow, BOOL fCenter ) return iResult; } -int hb_ctwAddWindowBox( int iWindow, BYTE * szBox, int iColor ) +int hb_ctwAddWindowBox( int iWindow, UCHAR * 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 a9025ff595..f5cc7ffc08 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, BYTE * szBox, int iColor ); +extern int hb_ctwAddWindowBox( int iWindow, UCHAR * szBox, int iColor ); extern int hb_ctwSwapWindows( int iWindow1, int iWindow2 ); extern int hb_ctwLastKey( void ); diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index fcedc373f5..f6860d9a52 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -1161,7 +1161,6 @@ typedef unsigned long HB_COUNTER; #define HB_SIZEOFARRAY( var ) ( sizeof( var ) / sizeof( *var ) ) -#define HB_ISSPACE( c ) ( ( c ) == ' ' || ( c ) == '\t' || ( c ) == '\n' || ( c ) == '\r' ) #define HB_ISUPPER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ) #define HB_ISLOWER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ) #define HB_TOUPPER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ? ( c ) - ( 'a' - 'A' ) : ( c ) ) diff --git a/harbour/include/hbset.h b/harbour/include/hbset.h index 9939c75863..7f172c1864 100644 --- a/harbour/include/hbset.h +++ b/harbour/include/hbset.h @@ -149,8 +149,8 @@ typedef struct HB_FHANDLE hb_set_extrahan; HB_FHANDLE hb_set_printhan; HB_PATHNAMES * hb_set_path; - BYTE hb_set_oscptransto[ 256 ]; - BYTE hb_set_oscptransfrom[ 256 ]; + UCHAR hb_set_oscptransto[ 256 ]; + UCHAR hb_set_oscptransfrom[ 256 ]; void * hb_set_listener; /* Upper case members are directly related to a SET */ diff --git a/harbour/source/vm/set.c b/harbour/source/vm/set.c index a4733cf8a9..f3d8756236 100644 --- a/harbour/source/vm/set.c +++ b/harbour/source/vm/set.c @@ -331,8 +331,8 @@ static void hb_set_OSCODEPAGE( PHB_SET_STRUCT pSet ) for( i = 0; i < 256; ++i ) { - pSet->hb_set_oscptransto[ i ] = ( BYTE ) i; - pSet->hb_set_oscptransfrom[ i ] = ( BYTE ) i; + pSet->hb_set_oscptransto[ i ] = ( UCHAR ) i; + pSet->hb_set_oscptransfrom[ i ] = ( UCHAR ) i; } #ifndef HB_CDP_SUPPORT_OFF @@ -351,10 +351,10 @@ static void hb_set_OSCODEPAGE( PHB_SET_STRUCT pSet ) { for( i = 0; i < cdpHost->nChars; ++i ) { - pSet->hb_set_oscptransto[ ( BYTE ) cdpHost->CharsUpper[ i ] ] = ( BYTE ) cdpFile->CharsUpper[ i ]; - pSet->hb_set_oscptransto[ ( BYTE ) cdpHost->CharsLower[ i ] ] = ( BYTE ) cdpFile->CharsLower[ i ]; - pSet->hb_set_oscptransfrom[ ( BYTE ) cdpFile->CharsUpper[ i ] ] = ( BYTE ) cdpHost->CharsUpper[ i ]; - pSet->hb_set_oscptransfrom[ ( BYTE ) cdpFile->CharsLower[ i ] ] = ( BYTE ) cdpHost->CharsLower[ i ]; + pSet->hb_set_oscptransto[ ( UCHAR ) cdpHost->CharsUpper[ i ] ] = ( UCHAR ) cdpFile->CharsUpper[ i ]; + pSet->hb_set_oscptransto[ ( UCHAR ) cdpHost->CharsLower[ i ] ] = ( UCHAR ) cdpFile->CharsLower[ i ]; + pSet->hb_set_oscptransfrom[ ( UCHAR ) cdpFile->CharsUpper[ i ] ] = ( UCHAR ) cdpHost->CharsUpper[ i ]; + pSet->hb_set_oscptransfrom[ ( UCHAR ) cdpFile->CharsLower[ i ] ] = ( UCHAR ) cdpHost->CharsLower[ i ]; } } } @@ -2593,7 +2593,7 @@ char * hb_setGetOSCODEPAGE( void ) return hb_stackSetStruct()->HB_SET_OSCODEPAGE; } -BYTE * hb_osEncode( BYTE * szFileName, BOOL * pfFree ) +UCHAR * hb_osEncode( UCHAR * szFileName, BOOL * pfFree ) { *pfFree = FALSE; @@ -2605,12 +2605,12 @@ BYTE * hb_osEncode( BYTE * szFileName, BOOL * pfFree ) if( bCPConv ) { - BYTE * p = szFileName; - BYTE * pCPTrans = hb_stackSetStruct()->hb_set_oscptransto; + UCHAR * p = szFileName; + UCHAR * pCPTrans = hb_stackSetStruct()->hb_set_oscptransto; while( *p ) { - *p = pCPTrans[ ( BYTE ) *p ]; + *p = pCPTrans[ ( UCHAR ) *p ]; p++; } } @@ -2619,7 +2619,7 @@ BYTE * hb_osEncode( BYTE * szFileName, BOOL * pfFree ) return szFileName; } -BYTE * hb_osDecode( BYTE * szFileName, BOOL * pfFree ) +UCHAR * hb_osDecode( UCHAR * szFileName, BOOL * pfFree ) { *pfFree = FALSE; @@ -2631,12 +2631,12 @@ BYTE * hb_osDecode( BYTE * szFileName, BOOL * pfFree ) if( bCPConv ) { - BYTE * p = szFileName; - BYTE * pCPTrans = hb_stackSetStruct()->hb_set_oscptransfrom; + UCHAR * p = szFileName; + UCHAR * pCPTrans = hb_stackSetStruct()->hb_set_oscptransfrom; while( *p ) { - *p = pCPTrans[ ( BYTE ) *p ]; + *p = pCPTrans[ ( UCHAR ) *p ]; p++; } }