From d020f613ed455e19b4ca0f79f945e438eadfe6da Mon Sep 17 00:00:00 2001 From: Paul Tucker Date: Wed, 19 Apr 2000 02:33:46 +0000 Subject: [PATCH] 20000418-22:40 DST --- harbour/ChangeLog | 4 ++++ harbour/source/compiler/harbour.c | 29 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0a358bbe8a..4367ccbf9c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +20000418-22:05 DST Paul Tucker + * source/compiler/harbour.c + * added casts. + 20000418-18:35 GMT-8 Ron Pinkas * source/compiler/harbour.c diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 81f485d531..70bdd0b4f9 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -1270,12 +1270,12 @@ void hb_compPrepareOptimize() if ( hb_comp_functions.pLast->pJumps ) { - hb_comp_functions.pLast->pJumps = hb_xrealloc( hb_comp_functions.pLast->pJumps, sizeof( ULONG ) * hb_comp_functions.pLast->iJumps ); + hb_comp_functions.pLast->pJumps = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pJumps, sizeof( ULONG ) * hb_comp_functions.pLast->iJumps ); hb_comp_functions.pLast->pJumps[ hb_comp_functions.pLast->iJumps - 1 ] = ( ULONG ) ( hb_comp_functions.pLast->lPCodePos - 4 ); } else { - hb_comp_functions.pLast->pJumps = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pJumps = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pJumps[ hb_comp_functions.pLast->iJumps - 1 ] = ( LONG ) ( hb_comp_functions.pLast->lPCodePos - 4 ); } @@ -1292,12 +1292,12 @@ void hb_compPrepareOptimize() if ( hb_comp_functions.pLast->pNOOPs ) { - hb_comp_functions.pLast->pNOOPs = hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = hb_comp_functions.pLast->lPCodePos - 1; } else { - hb_comp_functions.pLast->pNOOPs = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = hb_comp_functions.pLast->lPCodePos - 1; } @@ -1308,12 +1308,12 @@ void hb_compPrepareOptimize() if ( hb_comp_functions.pLast->pNOOPs ) { - hb_comp_functions.pLast->pNOOPs = hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = hb_comp_functions.pLast->lPCodePos - 2; } else { - hb_comp_functions.pLast->pNOOPs = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = hb_comp_functions.pLast->lPCodePos - 2; } } @@ -1502,12 +1502,12 @@ void hb_compGenJumpThere( ULONG ulFrom, ULONG ulTo ) if ( hb_comp_functions.pLast->pNOOPs ) { - hb_comp_functions.pLast->pNOOPs = hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = ( ULONG ) ulFrom + 2; } else { - hb_comp_functions.pLast->pNOOPs = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pNOOPs[ 0 ] = ( ULONG ) ulFrom + 2; } @@ -1518,12 +1518,12 @@ void hb_compGenJumpThere( ULONG ulFrom, ULONG ulTo ) if ( hb_comp_functions.pLast->pNOOPs ) { - hb_comp_functions.pLast->pNOOPs = hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = ( ULONG ) ulFrom + 1; } else { - hb_comp_functions.pLast->pNOOPs = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pNOOPs[ 0 ] = ( ULONG ) ulFrom + 1; } } @@ -1601,12 +1601,12 @@ void hb_compGenJumpThere( ULONG ulFrom, ULONG ulTo ) if ( hb_comp_functions.pLast->pNOOPs ) { - hb_comp_functions.pLast->pNOOPs = hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xrealloc( hb_comp_functions.pLast->pNOOPs, sizeof( ULONG ) * hb_comp_functions.pLast->iNOOPs ); hb_comp_functions.pLast->pNOOPs[ hb_comp_functions.pLast->iNOOPs - 1 ] = ( ULONG ) ulFrom + 2; } else { - hb_comp_functions.pLast->pNOOPs = hb_xgrab( sizeof( ULONG ) ); + hb_comp_functions.pLast->pNOOPs = ( ULONG * ) hb_xgrab( sizeof( ULONG ) ); hb_comp_functions.pLast->pNOOPs[ 0 ] = ( ULONG ) ulFrom + 2; } } @@ -2336,10 +2336,10 @@ void hb_compOptimizeJumps( void ) { /* Jump Optimizer */ BYTE * pCode = hb_comp_functions.pLast->pCode; - BYTE * pOptimized = hb_xgrab( hb_comp_functions.pLast->lPCodePos - hb_comp_functions.pLast->iNOOPs ); + BYTE * pOptimized = ( BYTE * ) hb_xgrab( hb_comp_functions.pLast->lPCodePos - hb_comp_functions.pLast->iNOOPs ); ULONG * pNOOPs = hb_comp_functions.pLast->pNOOPs; ULONG * pJumps = hb_comp_functions.pLast->pJumps; - int * piShifts = hb_xgrab( sizeof( int ) * hb_comp_functions.pLast->iJumps ); + int * piShifts = ( int * ) hb_xgrab( sizeof( int ) * hb_comp_functions.pLast->iJumps ); ULONG ulOptimized = 0; ULONG ulNextByte = 0; int iNOOP; @@ -2790,7 +2790,6 @@ void hb_compCodeBlockEnd( void ) pVar = pVar->pNext; hb_xfree( ( void * ) pFree ); } - /* Release the NOOP array. */ if ( pCodeblock->pNOOPs ) hb_xfree( ( void * ) pCodeblock->pNOOPs );