From f4f1bdab202bac2b9e4e5e4ef93e7ebac8d204cb Mon Sep 17 00:00:00 2001 From: Jean-Francois Lefebvre Date: Tue, 31 Oct 2000 19:52:16 +0000 Subject: [PATCH] 2000-10-31 20:56 GMT+1 JFL (Mafact) --- harbour/ChangeLog | 5 +++++ harbour/source/vm/classes.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 49cc32f828..e537bee586 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +2000-10-31 20:56 GMT+1 JFL (Mafact) + * source/vm/classes.c + * Bug correction where __OBJHASMSG() returned True when no msg exist + in some case + 2000-10-30 18:51 GMT+2 Maurilio Longo * contrib/mysql/* * little changes chasing a bug :-| diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 6bfc7bc9b1..e5a5852dcc 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -140,6 +140,8 @@ * 1.35 ? * 1.36 Adding HB_CLS_ENFORCERO FLAG to disable Write access to RO VAR * This is work in progress (JFL) Should be related to some compatibility flag + * 1.37 minor syntax correction + * 1.38 __ObjHasMsg() could return true when false * * See doc/license.txt for licensing terms. * @@ -208,6 +210,7 @@ static void hb_clsRelease( PCLASS ); char * hb_objGetClsName( PHB_ITEM pObject ); PHB_FUNC hb_objGetMethod( PHB_ITEM, PHB_SYMB ); + PHB_FUNC hb_objGetMthd( PHB_ITEM pObject, PHB_SYMB pMessage, BOOL lAllowErrFunc ); ULONG hb_objHasMsg( PHB_ITEM pObject, char * szString ); static HARBOUR hb___msgClsH( void ); @@ -588,6 +591,11 @@ char * hb_objGetClsName( PHB_ITEM pObject ) * Internal function to the function pointer of a message of an object */ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage ) +{ + return hb_objGetMthd( (PHB_ITEM) pObject, (PHB_SYMB) pMessage, TRUE ) ; +} + +PHB_FUNC hb_objGetMthd( PHB_ITEM pObject, PHB_SYMB pMessage, BOOL lAllowErrFunc ) { USHORT uiClass; PHB_DYNS pMsg = pMessage->pDynSym; @@ -656,7 +664,7 @@ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage ) { PCLASS pClass = s_pClasses + ( uiClass - 1 ); - if( pClass->pFunError ) + if( lAllowErrFunc && pClass->pFunError ) return pClass->pFunError; } @@ -678,7 +686,7 @@ ULONG hb_objHasMsg( PHB_ITEM pObject, char *szString ) HB_TRACE(HB_TR_DEBUG, ("hb_objHasMsg(%p, %s)", pObject, szString)); if( pDynSym ) - return ( ULONG ) hb_objGetMethod( pObject, pDynSym->pSymbol ); + return ( ULONG ) hb_objGetMthd( pObject, pDynSym->pSymbol, FALSE ); else return 0; } /* Get funcptr of message */