From 81b40cd232be8079752766aabc72774f461fca7c Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 19 Dec 2008 17:22:52 +0000 Subject: [PATCH] 2008-12-19 18:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/compiler/hbopt.c * pacified GCC warning --- harbour/ChangeLog | 4 ++++ harbour/source/compiler/hbopt.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5af3bdd91f..0a9cf6d99e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-12-19 18:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/compiler/hbopt.c + * pacified GCC warning + 2008-12-19 14:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/pp/hbpp.c * accept empty $Id keywords in ChangeLog file. It allows to compile diff --git a/harbour/source/compiler/hbopt.c b/harbour/source/compiler/hbopt.c index 0c5f3300de..2ac3c534d0 100644 --- a/harbour/source/compiler/hbopt.c +++ b/harbour/source/compiler/hbopt.c @@ -1041,7 +1041,7 @@ static LONG hb_compJumpGetOffset( BYTE * pCode ) static void hb_compPCodeEnumScanLocals( PFUNCTION pFunc, PHB_OPT_LOCAL pLocals ) { ULONG ulPos = 0, ulLastPos = 0; - SHORT isVar; + SHORT isVar = 0; BOOL fWasJump = 0; while( ulPos < pFunc->lPCodePos ) @@ -1081,7 +1081,7 @@ static void hb_compPCodeEnumScanLocals( PFUNCTION pFunc, PHB_OPT_LOCAL pLocals ) /* For real POPSELF support we need to do backward tree tracing. This is not implemented, but using fWasJump we can easy optimize Self := QSelf() at the beginning - of functions. [Mindaugas] + of functions. [Mindaugas] */ pLocals[ isVar - 1 ].bFlags |= OPT_LOCAL_FLAG_POPSELF; } @@ -1403,7 +1403,7 @@ static void hb_compPCodeEnumRenumberLocals( PFUNCTION pFunc, PHB_OPT_LOCAL pLoca if( isVar > 0 && pLocals[ isVar - 1 ].isNumber != isVar ) { isVar = pLocals[ isVar - 1 ].isNumber; - + assert( isVar > 0 ); /* We do not allow removal of detached locals */ pVar[ 0 ] = HB_LOBYTE( isVar ); @@ -1483,7 +1483,7 @@ void hb_compPCodeTraceOptimizer( HB_COMP_DECL ) pVar = pFunc->pLocals; for( usIndex = 0; usIndex < pFunc->wParamCount; usIndex++ ) pVar = pVar->pNext; - + for( usIndex = pFunc->wParamCount; usIndex < usLocalCount; usIndex++ ) { if( pLocals[ usIndex ].bFlags == ( OPT_LOCAL_FLAG_PUSH | OPT_LOCAL_FLAG_POPSELF ) || @@ -1512,7 +1512,7 @@ void hb_compPCodeTraceOptimizer( HB_COMP_DECL ) break; } } - + if( fBool ) { usIndex = usLocalCount = 0; @@ -1529,7 +1529,7 @@ void hb_compPCodeTraceOptimizer( HB_COMP_DECL ) else { /* printf( "Info: %s(%d) removing unused variable '%s'\n", pFunc->szName, pVar->iDeclLine, pVar->szName ); */ - + /* Delete pVar from the linked list */ *ppVar = pVar->pNext; hb_xfree( pVar );