From 215e18e9bd45b1cf367e275bd8527e600d4c621f Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 13 Aug 2008 03:31:00 +0000 Subject: [PATCH] 2008-08-13 05:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/pp/ppcore.c * harbour/source/pp/hbpp.c * harbour/source/vm/itemapi.c * harbour/source/vm/hvm.c * harbour/source/common/hbver.c * harbour/source/macro/macrolex.c * harbour/source/hbpcre/pcrecomp.c * harbour/source/compiler/hbpcode.c * harbour/contrib/hbmisc/spd.c * harbour/contrib/hbsqlit3/sqlite3/sqlite3.c * pacified warnings * harbour/config/w32/dm.cf * updated to work with SHELL env - comment -w7 switch --- harbour/ChangeLog | 17 +++++++++++++++++ harbour/config/w32/dm.cf | 17 +++++++++++------ harbour/contrib/hbmisc/spd.c | 10 +++++----- harbour/contrib/hbsqlit3/sqlite3/sqlite3.c | 2 +- harbour/source/common/hbver.c | 2 +- harbour/source/compiler/hbpcode.c | 6 +++--- harbour/source/hbpcre/pcrecomp.c | 10 +++++----- harbour/source/macro/macrolex.c | 10 +++++----- harbour/source/pp/hbpp.c | 2 +- harbour/source/pp/ppcore.c | 22 +++++++++++----------- harbour/source/vm/hvm.c | 6 +++--- harbour/source/vm/itemapi.c | 2 +- 12 files changed, 64 insertions(+), 42 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f03c92a518..d25e800c8c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,23 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-13 05:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/pp/ppcore.c + * harbour/source/pp/hbpp.c + * harbour/source/vm/itemapi.c + * harbour/source/vm/hvm.c + * harbour/source/common/hbver.c + * harbour/source/macro/macrolex.c + * harbour/source/hbpcre/pcrecomp.c + * harbour/source/compiler/hbpcode.c + * harbour/contrib/hbmisc/spd.c + * harbour/contrib/hbsqlit3/sqlite3/sqlite3.c + * pacified warnings + + * harbour/config/w32/dm.cf + * updated to work with SHELL env + - comment -w7 switch + 2008-08-13 04:16 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbodbc/odbc.c ! Some recently updated code now conditionally restored diff --git a/harbour/config/w32/dm.cf b/harbour/config/w32/dm.cf index 79c4f3cb99..2c8d0951ce 100644 --- a/harbour/config/w32/dm.cf +++ b/harbour/config/w32/dm.cf @@ -11,14 +11,14 @@ EXE_EXT = .exe LIB_PREF = LIB_EXT = .lib -CC = dmc +CC = dmc.exe CC_IN = -c CC_OUT = -o CPPFLAGS = -I. -I$(HB_INC_COMPILE) CFLAGS = -6 -cpp -mn -o+time -x # Suppressing "possible extraneous ';'" warnings. [vszakats] -CFLAGS += -w7 +#CFLAGS += -w7 # Add all libraries specified in CONTRIBS and LIBS. ifeq ($(HB_LIB_COMPILE),) @@ -56,6 +56,7 @@ endif SYSLIBS = kernel32 user32 winspool gdi32 comctl32 comdlg32 ole32 oleaut32 uuid wsock32 advapi32 LINKLIBS += $(SYSLIBS) + define link_exe_file echo $(subst /,\,$(^F)) > __link__.tmp echo $@ >> __link__.tmp @@ -64,10 +65,14 @@ echo $(subst /,\,$(LINKLIBS)) >> __link__.tmp $(LD) $(LDFLAGS) @__link__.tmp endef -LD = link +LD = link.exe LDFLAGS = /NOMAP /EXETYPE:NT /SUBSYSTEM:CONSOLE $(LINKPATHS) $(L_USR) -LDOBJS = $(foreach file, $(^F), $(file)) -LD_RULE = $(LD) $(LDFLAGS) $(subst /,\,$(LDOBJS)), $@,, $(subst /,\,$(LINKLIBS)) +ifeq ($(SHLVL),) +LNKLIBS=$(subst /,\,$(LINKLIBS)) +else +LNKLIBS=$(subst /,\\,$(subst \,/,$(LINKLIBS))) +endif +LD_RULE = $(LD) $(LDFLAGS) $(^F), $@,, $(LNKLIBS) define create_library echo $@ > __lib__.tmp @@ -75,7 +80,7 @@ echo $(^F) >> __lib__.tmp $(AR) $(ARFLAGS) @__lib__.tmp endef -AR = lib +AR = lib.exe ARFLAGS = -c $(A_USR) AROBJS = $(foreach file, $(^F), $(file)) AR_RULE = $(AR) $(ARFLAGS) $(LIB_DIR)/$@ $(AROBJS) diff --git a/harbour/contrib/hbmisc/spd.c b/harbour/contrib/hbmisc/spd.c index e853cb12e5..a42a6e57ab 100644 --- a/harbour/contrib/hbmisc/spd.c +++ b/harbour/contrib/hbmisc/spd.c @@ -186,7 +186,7 @@ HB_FUNC( SQL_SPRINTF ) if( !pItmFrm || (cItmFrm = hb_itemGetCPtr( pItmFrm )) == NULL ){ hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 1, hb_paramError( 1 ) ); - }else if( !(ulItmFrm = hb_itemGetCLen( pItmFrm )) ){ + }else if( (ulItmFrm = hb_itemGetCLen( pItmFrm )) == 0 ){ hb_retc( NULL ); }else if( !argc ){ cRes = (char *)hb_xgrab( ulItmFrm + sizeof(char) ); @@ -241,7 +241,7 @@ HB_FUNC( SQL_SPRINTF ) }else{ f = 3; iErrorPar = 1; } - while( i && cParFrm[--i] != iCOut ); + while( i && cParFrm[--i] != iCOut ) {}; ++i; iCOut = 0; }else if( f && *c == '{' ){ if( s ){ @@ -340,7 +340,7 @@ HB_FUNC( SQL_SPRINTF ) if( HB_IS_NIL( pItmPar ) ){ # endif ulWidth = f; IsIndW = IsIndP = 0; - while( cParFrm[--f] != '%' ); + while( cParFrm[--f] != '%' ) {}; iCOut = cParFrm[f + 1] = 's'; /* Change format with %s */ memcpy( cParFrm + f + 2, cParFrm + ulWidth, i - ulWidth + 1 ); i -= ulWidth - f - 2; /* i == strlen(cParFrm) */ @@ -370,7 +370,7 @@ HB_FUNC( SQL_SPRINTF ) char cDTBuf[ 19 ], cDTFrm[ 28 ]; /* 26 + 2 if %t and change format time */ if( s ){ /* Internal Modifier */ - for( f = 0; cIntMod[f] && cIntMod[f] != ' '; f++ ); + for( f = 0; cIntMod[f] && cIntMod[f] != ' '; f++ ) {}; if( f != s ) cIntMod[f++] = '\0'; /* Date & Time */ } @@ -404,7 +404,7 @@ HB_FUNC( SQL_SPRINTF ) }else if( HB_IS_LOGICAL( pItmPar ) ){ if( s ){ /* Internal Modifier */ - for( f = 0; cIntMod[f] && cIntMod[f] != ','; f++ ); + for( f = 0; cIntMod[f] && cIntMod[f] != ','; f++ ) {}; if( f != s ) cIntMod[f++] = '\0'; /* TRUE & FALSE */ } if( iCOut == 's' ){ diff --git a/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c b/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c index 15c023b5ae..9b3140ae61 100644 --- a/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c +++ b/harbour/contrib/hbsqlit3/sqlite3/sqlite3.c @@ -64525,7 +64525,7 @@ static const char *columnType( int iCol = pExpr->iColumn; /* Index of column in pTab */ while( pNC && !pTab ){ SrcList *pTabList = pNC->pSrcList; - for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); + for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++){}; if( jnSrc ){ pTab = pTabList->a[j].pTab; pS = pTabList->a[j].pSelect; diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index f8d6dbf34a..3da9994826 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -276,7 +276,7 @@ char * hb_verPlatform( void ) int i; /* Skip the leading spaces (Win95B, Win98) */ - for( i = 0; osVer.szCSDVersion[ i ] != '\0' && isspace( ( int ) osVer.szCSDVersion[ i ] ); i++ ); + for( i = 0; osVer.szCSDVersion[ i ] != '\0' && isspace( ( int ) osVer.szCSDVersion[ i ] ); i++ ) {}; if( osVer.szCSDVersion[ i ] != '\0' ) { diff --git a/harbour/source/compiler/hbpcode.c b/harbour/source/compiler/hbpcode.c index 2d53677d6e..4f5e3cc940 100644 --- a/harbour/source/compiler/hbpcode.c +++ b/harbour/source/compiler/hbpcode.c @@ -93,7 +93,7 @@ static HB_PSIZE_FUNC( hb_p_localname ) HB_SYMBOL_UNUSED( cargo ); lPCodePos += 3; - while( pFunc->pCode[ lPCodePos++ ] ); + while( pFunc->pCode[ lPCodePos++ ] ) {}; return ( lPCodePos - ulStart ); } @@ -104,7 +104,7 @@ static HB_PSIZE_FUNC( hb_p_modulename ) HB_SYMBOL_UNUSED( cargo ); lPCodePos += 3; - while( pFunc->pCode[ lPCodePos++ ]); + while( pFunc->pCode[ lPCodePos++ ]) {}; return ( lPCodePos - ulStart ); } @@ -115,7 +115,7 @@ static HB_PSIZE_FUNC( hb_p_staticname ) HB_SYMBOL_UNUSED( cargo ); lPCodePos += 4; - while( pFunc->pCode[ lPCodePos++ ] ); + while( pFunc->pCode[ lPCodePos++ ] ) {}; return ( lPCodePos - ulStart ); } diff --git a/harbour/source/hbpcre/pcrecomp.c b/harbour/source/hbpcre/pcrecomp.c index aeae12eeed..a2295b1c72 100644 --- a/harbour/source/hbpcre/pcrecomp.c +++ b/harbour/source/hbpcre/pcrecomp.c @@ -455,7 +455,7 @@ static const char * find_error_text(int n) { const char *s = error_texts; -for (; n > 0; n--) while (*s++ != 0); +for (; n > 0; n--) while (*s++ != 0) {}; return s; } @@ -1002,7 +1002,7 @@ for (; *ptr != 0; ptr++) if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1045,7 +1045,7 @@ for (; *ptr != 0; ptr++) if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1059,7 +1059,7 @@ for (; *ptr != 0; ptr++) if (xmode && *ptr == '#') { - while (*(++ptr) != 0 && *ptr != '\n'); + while (*(++ptr) != 0 && *ptr != '\n') {}; if (*ptr == 0) return -1; continue; } @@ -4225,7 +4225,7 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */ const char *vn = verbnames; const uschar *name = ++ptr; previous = NULL; - while ((cd->ctypes[*++ptr] & ctype_letter) != 0); + while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {}; if (*ptr == ':') { *errorcodeptr = ERR59; /* Not supported */ diff --git a/harbour/source/macro/macrolex.c b/harbour/source/macro/macrolex.c index 4133dac8e8..4b0a86de7f 100644 --- a/harbour/source/macro/macrolex.c +++ b/harbour/source/macro/macrolex.c @@ -397,7 +397,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) { ULONG ul = pLex->ulSrc; while( ++ul < pLex->ulLen && - HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ); + HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ) {}; ul -= --pLex->ulSrc; return hb_lexNumConv( yylval_ptr, pLex, ul ); } @@ -528,7 +528,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) if( pLex->pString[ ul ] == 'd' || pLex->pString[ ul ] == 'D' ) { while( ++ul < pLex->ulLen && - HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ); + HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ) {}; if( ul - pLex->ulSrc == 9 ) { int year, month, day; @@ -545,7 +545,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) pLex->pString[ ul ] == 'X' ) { while( ++ul < pLex->ulLen && - HB_LEX_ISHEXDIGIT( pLex->pString[ ul ] ) ); + HB_LEX_ISHEXDIGIT( pLex->pString[ ul ] ) ) {}; if( ul == pLex->ulSrc + 1 ) --ul; } @@ -558,7 +558,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) HB_LEX_ISDIGIT( pLex->pString[ ul + 1 ] ) ) { while( ++ul < pLex->ulLen && - HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ); + HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ) {}; } } } @@ -571,7 +571,7 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro ) HB_LEX_ISDIGIT( pLex->pString[ ul + 1 ] ) ) { while( ++ul < pLex->ulLen && - HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ); + HB_LEX_ISDIGIT( pLex->pString[ ul ] ) ) {}; } } ul -= --pLex->ulSrc; diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index 0e18a54ad8..014b081cde 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -272,7 +272,7 @@ static int hb_pp_preprocesfile( PHB_PP_STATE pState, char * szRuleFile ) int iResult = 0; ULONG ulLen; - while( hb_pp_nextLine( pState, &ulLen ) != NULL && ulLen ); + while( hb_pp_nextLine( pState, &ulLen ) != NULL && ulLen ) {}; if( szRuleFile ) { diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 7882883351..38b7f5c512 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1141,7 +1141,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) { if( ch == '`' ) ch = '\''; - while( ++ul < ulLen && pBuffer[ ul ] != ch ); + while( ++ul < ulLen && pBuffer[ ul ] != ch ) {}; #ifdef HB_PP_MULTILINE_STRING while( ul == ulLen ) { @@ -1234,7 +1234,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) } else if( HB_PP_ISFIRSTIDCHAR( ch ) ) { - while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ) {}; /* * In Clipper note can be used only as 1-st token and after @@ -1263,9 +1263,9 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) while( ulLen - ul > 1 && pBuffer[ ul ] == '&' && HB_PP_ISFIRSTIDCHAR( pBuffer[ ul + 1 ] ) ) { - while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ) {}; if( ul < ulLen && pBuffer[ ul ] == '.' ) - while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ) {}; } if( ul < ulLen && pBuffer[ ul ] == '&' ) ++ul; @@ -1291,7 +1291,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) to change HB_PP_ISILLEGAL() macro */ else if( HB_PP_ISTEXTCHAR( ch ) ) { - while( ++ul < ulLen && HB_PP_ISTEXTCHAR( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISTEXTCHAR( pBuffer[ ul ] ) ) {}; hb_pp_tokenAddNext( pState, pBuffer, ul, HB_PP_TOKEN_TEXT ); } @@ -1310,7 +1310,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) HB_PP_ISHEX( pBuffer[ 2 ] ) ) { ul = 2; - while( ++ul < ulLen && HB_PP_ISHEX( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISHEX( pBuffer[ ul ] ) ) {}; /* (LEX: mark token as hex?) */ hb_pp_tokenAddNext( pState, pBuffer, ul, HB_PP_TOKEN_NUMBER ); @@ -1320,25 +1320,25 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) HB_PP_ISDIGIT( pBuffer[ 2 ] ) ) { ul = 2; - while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ) {}; hb_pp_tokenAddNext( pState, pBuffer, ul, HB_PP_TOKEN_DATE ); } else { - while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ) {}; if( ulLen - ul > 1 && pBuffer[ ul ] == '.' && HB_PP_ISDIGIT( pBuffer[ ul + 1 ] ) ) { ++ul; - while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ) {}; } hb_pp_tokenAddNext( pState, pBuffer, ul, HB_PP_TOKEN_NUMBER ); } } else if( ch == '.' && ulLen > 1 && HB_PP_ISDIGIT( pBuffer[ 1 ] ) ) { - while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISDIGIT( pBuffer[ ul ] ) ) {}; hb_pp_tokenAddNext( pState, pBuffer, ul, HB_PP_TOKEN_NUMBER ); } @@ -1362,7 +1362,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) HB_PP_ISFIRSTIDCHAR( pBuffer[ ul + 1 ] ) ) { ++iParts; - while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ); + while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ) {}; if( ul < ulLen && pBuffer[ ul ] == '.' ) while( ++ul < ulLen && HB_PP_ISNEXTIDCHAR( pBuffer[ ul ] ) ) ++iParts; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 95746979b4..2324de4fd3 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1111,19 +1111,19 @@ HB_EXPORT void hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols ) hb_vmLocalName( HB_PCODE_MKUSHORT( &( pCode[ w + 1 ] ) ), ( char * ) pCode + w + 3 ); w += 3; - while( pCode[ w++ ] ); + while( pCode[ w++ ] ) {}; break; case HB_P_STATICNAME: hb_vmStaticName( pCode[ w + 1 ], HB_PCODE_MKUSHORT( &( pCode[ w + 2 ] ) ), ( char * ) pCode + w + 4 ); w += 4; - while( pCode[ w++ ] ); + while( pCode[ w++ ] ) {}; break; case HB_P_MODULENAME: hb_vmModuleName( ( char * ) pCode + w + 1 ); - while( pCode[ w++ ] ); + while( pCode[ w++ ] ) {}; break; case HB_P_ENDBLOCK: diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index bbe915fa7c..37f2b396a1 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -2535,7 +2535,7 @@ HB_EXPORT char * hb_itemPadConv( PHB_ITEM pItem, ULONG * pulSize, BOOL * bFreeRe /* remove leading spaces if any, a little bit redundant but * I don't want to complicate the API interface more. Druzus */ - for( i = 0; buffer[i] == ' '; i++ ); + for( i = 0; buffer[i] == ' '; i++ ) {}; if( i > 0 ) {