From ca49407a60a2248fd63fca2bf49eb7ea4e06bef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 30 Jan 2014 10:34:22 +0100 Subject: [PATCH] 2014-01-30 10:34 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbtip/utils.c * src/rtl/gtwvt/gtwvt.c * casting to pacify some warnings * src/compiler/harbour.y * src/compiler/harbour.yyc * src/compiler/harbour.yyh * changed type of valChar.length from int to HB_SIZE * include/hbpp.h * src/pp/ppcore.c * changed type of last hb_pp_tokenBlockString() parameter from int * to HB_SIZE * * src/compiler/complex.c * removed unnecessary casting --- ChangeLog.txt | 18 ++++++++++++++++++ contrib/hbtip/utils.c | 2 +- include/hbpp.h | 2 +- src/compiler/complex.c | 4 ++-- src/compiler/harbour.y | 4 ++-- src/compiler/harbour.yyc | 4 ++-- src/compiler/harbour.yyh | 4 ++-- src/pp/ppcore.c | 4 ++-- src/rtl/gtwvt/gtwvt.c | 2 +- 9 files changed, 31 insertions(+), 13 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2e87fd1146..7875cb5569 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,24 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-01-30 10:34 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbtip/utils.c + * src/rtl/gtwvt/gtwvt.c + * casting to pacify some warnings + + * src/compiler/harbour.y + * src/compiler/harbour.yyc + * src/compiler/harbour.yyh + * changed type of valChar.length from int to HB_SIZE + + * include/hbpp.h + * src/pp/ppcore.c + * changed type of last hb_pp_tokenBlockString() parameter + from int * to HB_SIZE * + + * src/compiler/complex.c + * removed unnecessary casting + 2014-01-29 09:38 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/harbour.hbx * src/vm/dynsym.c diff --git a/contrib/hbtip/utils.c b/contrib/hbtip/utils.c index 1f8e1c1402..3f6c53199b 100644 --- a/contrib/hbtip/utils.c +++ b/contrib/hbtip/utils.c @@ -84,7 +84,7 @@ HB_FUNC( TIP_TIMESTAMP ) /* For compatibility, seconds() value */ if( HB_ISNUM( 2 ) ) - hb_timeDecode( hb_parnd( 2 ) * 1000, + hb_timeDecode( ( long ) ( hb_parnd( 2 ) * 1000 ), &iHour, &iMinute, &iSecond, &iMSec ); else iHour = iMinute = iSecond = 0; diff --git a/include/hbpp.h b/include/hbpp.h index 053cd749aa..e354d57a27 100644 --- a/include/hbpp.h +++ b/include/hbpp.h @@ -680,7 +680,7 @@ extern HB_EXPORT int hb_pp_errorCount( PHB_PP_STATE pState ); extern HB_EXPORT void hb_pp_tokenUpper( PHB_PP_TOKEN pToken ); extern HB_EXPORT void hb_pp_tokenToString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken ); -extern HB_EXPORT char * hb_pp_tokenBlockString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, int * piType, int * piLen ); +extern HB_EXPORT char * hb_pp_tokenBlockString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, int * piType, HB_SIZE * pnLen ); extern HB_EXPORT PHB_PP_STATE hb_pp_lexNew( const char * pString, HB_SIZE nLen ); extern HB_EXPORT PHB_PP_TOKEN hb_pp_lexGet( PHB_PP_STATE pState ); extern HB_EXPORT PHB_PP_TOKEN hb_pp_tokenGet( PHB_PP_STATE pState ); diff --git a/src/compiler/complex.c b/src/compiler/complex.c index 53525fdc71..169fbc9756 100644 --- a/src/compiler/complex.c +++ b/src/compiler/complex.c @@ -269,12 +269,12 @@ static const char * hb_comp_tokenIdentifer( HB_COMP_DECL, PHB_PP_TOKEN pToken ) static const char * hb_comp_tokenString( YYSTYPE * yylval_ptr, HB_COMP_DECL, PHB_PP_TOKEN pToken ) { - yylval_ptr->valChar.length = ( HB_SIZE ) pToken->len; + yylval_ptr->valChar.length = pToken->len; yylval_ptr->valChar.string = ( char * ) pToken->value; yylval_ptr->valChar.dealloc = HB_FALSE; if( HB_PP_TOKEN_ALLOC( pToken->type ) ) { - yylval_ptr->valChar.dealloc = ( HB_SIZE ) pToken->len != strlen( pToken->value ); + yylval_ptr->valChar.dealloc = pToken->len != strlen( pToken->value ); pToken->value = hb_compIdentifierNew( HB_COMP_PARAM, pToken->value, yylval_ptr->valChar.dealloc ? HB_IDENT_COPY : HB_IDENT_FREE ); if( ! yylval_ptr->valChar.dealloc ) diff --git a/src/compiler/harbour.y b/src/compiler/harbour.y index 663e3996cc..aa91b04c7c 100644 --- a/src/compiler/harbour.y +++ b/src/compiler/harbour.y @@ -145,13 +145,13 @@ static void hb_compDebugStart( void ) { } struct { char * string; - int length; + HB_SIZE length; HB_BOOL dealloc; } valChar; struct { char * string; - int length; + HB_SIZE length; int flags; /* Flag for early {|| ¯o} (1) or late {|| &(macro)} (2) binding */ } asCodeblock; PHB_VARTYPE asVarType; diff --git a/src/compiler/harbour.yyc b/src/compiler/harbour.yyc index cd63709e44..fa2465090f 100644 --- a/src/compiler/harbour.yyc +++ b/src/compiler/harbour.yyc @@ -365,13 +365,13 @@ typedef union YYSTYPE struct { char * string; - int length; + HB_SIZE length; HB_BOOL dealloc; } valChar; struct { char * string; - int length; + HB_SIZE length; int flags; /* Flag for early {|| ¯o} (1) or late {|| &(macro)} (2) binding */ } asCodeblock; PHB_VARTYPE asVarType; diff --git a/src/compiler/harbour.yyh b/src/compiler/harbour.yyh index 2d384eae73..71d21be230 100644 --- a/src/compiler/harbour.yyh +++ b/src/compiler/harbour.yyh @@ -184,13 +184,13 @@ typedef union YYSTYPE struct { char * string; - int length; + HB_SIZE length; HB_BOOL dealloc; } valChar; struct { char * string; - int length; + HB_SIZE length; int flags; /* Flag for early {|| ¯o} (1) or late {|| &(macro)} (2) binding */ } asCodeblock; PHB_VARTYPE asVarType; diff --git a/src/pp/ppcore.c b/src/pp/ppcore.c index d89b5d3230..20670a00e9 100644 --- a/src/pp/ppcore.c +++ b/src/pp/ppcore.c @@ -6315,7 +6315,7 @@ void hb_pp_tokenToString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken ) } char * hb_pp_tokenBlockString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, - int * piType, int * piLen ) + int * piType, HB_SIZE * pnLen ) { *piType = 0; hb_membufFlush( pState->pBuffer ); @@ -6345,7 +6345,7 @@ char * hb_pp_tokenBlockString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, } while( iBraces && ! HB_PP_TOKEN_ISEOC( pToken ) ); } - *piLen = ( int ) hb_membufLen( pState->pBuffer ); + *pnLen = hb_membufLen( pState->pBuffer ); hb_membufAddCh( pState->pBuffer, '\0' ); return hb_membufPtr( pState->pBuffer ); } diff --git a/src/rtl/gtwvt/gtwvt.c b/src/rtl/gtwvt/gtwvt.c index cb1456dd02..17db69fbc6 100644 --- a/src/rtl/gtwvt/gtwvt.c +++ b/src/rtl/gtwvt/gtwvt.c @@ -2524,7 +2524,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, if( iFlags & HB_KF_CTRL ) { pWVT->IgnoreWM_SYSCHAR = HB_TRUE; - iKey = wParam - VK_NUMPAD0 + '0'; + iKey = ( int ) wParam - VK_NUMPAD0 + '0'; } else if( iFlags == HB_KF_ALT ) iFlags = 0; /* for ALT + */