diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 904526dba2..9b7f199658 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +19990924-07:18 GMT+1 Victor Szel + + * source/hbpp/hbpp.c + ! Fixed warning about function not returning value (in ParseDefine()) + * source/rtl/classes.c + + hb_clsDictRealloc() implemented. + By Janica Lubos + 19990923-20:55 EDT Paul Tucker * source/rtl/gt/gtwin.c * fix for redirected console output as reported by Victor diff --git a/harbour/source/hbpp/hbpp.c b/harbour/source/hbpp/hbpp.c index 32be37303f..db2cb41ac2 100644 --- a/harbour/source/hbpp/hbpp.c +++ b/harbour/source/hbpp/hbpp.c @@ -270,10 +270,11 @@ int ParseDefine( char* sLine) lastdef->npars = npars; lastdef->pars = ( npars == 0 )? NULL : strodup ( pars ); - - return 0; } - else GenError( _szPErrors, 'P', ERR_DEFINE_ABSENT, NULL, NULL ); + else + GenError( _szPErrors, 'P', ERR_DEFINE_ABSENT, NULL, NULL ); + + return 0; } DEFINES* AddDefine ( char* defname, char* value ) diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index febb879388..0e119b9377 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -53,6 +53,9 @@ * Copyright 1999 Victor Szel * hb___msgEval() * + * Copyright 1999 Janica Lubos + * hb_clsDictRealloc() + * * See doc/license.txt for licensing terms. * */ @@ -127,9 +130,36 @@ static HARBOUR hb___msgSetData( void ); */ static void hb_clsDictRealloc( PCLASS pClass ) { - /* TODO: Implement it for very large classes */ if( pClass ) - hb_errInternal( 9999, "classes.c hb_clsDictRealloc() not implemented yet", NULL, NULL ); + { + PMETHOD pNewMethods; + USHORT uiNewHashKey = pClass->uiHashKey + 20; + USHORT uiMask = uiNewHashKey * BUCKET; + USHORT ui; + + pNewMethods = ( PMETHOD ) hb_xgrab( uiNewHashKey * BUCKET * sizeof( METHOD ) ); + memset( pNewMethods, 0, uiNewHashKey * BUCKET * sizeof( METHOD ) ); + + for( ui = 0; ui < ( pClass->uiHashKey * BUCKET ); ui++ ) + { + PHB_DYNS pMessage = pClass->pMethods[ ui ].pMessage; + + if( pMessage ) + { + USHORT uiAt = ( ( ( unsigned ) pMessage ) % uiNewHashKey ) * BUCKET; + + while( pNewMethods[ uiAt ].pMessage && + ( pNewMethods[ uiAt ].pMessage != pMessage ) ) + uiAt = ( uiAt == uiMask ) ? 0 : uiAt + 1; + + pNewMethods[ uiAt ] = pClass->pMethods[ ui ]; + } + } + + pClass->uiHashKey = uiNewHashKey; + hb_xfree( pClass->pMethods ); + pClass->pMethods = pNewMethods; + } }