2001-05-09 00:02 UTC+1 JFL (mafact) <jfl@mafact.com>

This commit is contained in:
Jean-Francois Lefebvre
2001-05-08 22:06:38 +00:00
parent ac58f869ba
commit c1bc118679
4 changed files with 44 additions and 9 deletions

View File

@@ -1,3 +1,11 @@
2001-05-09 00:02 UTC+1 JFL (mafact) <jfl@mafact.com>
* source/vm/classes.c
* modified hb_msgclssel() to accept one logical param
so as it return only ClassMsg
* source/rtl/objfunc.prg
* modified ObjGetMsgList() to accept one logical param
so as it return only ClassMsg
2001-05-08 14:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* include/hbclass.ch
% Removed numerous redundant rules.

View File

@@ -83,7 +83,7 @@ HBPDF_DIR = contrib\pdflib
# C compiler definition and C flags. These should never have to change.
#
AS = ml
AS = ML
CFLAGS = -I$(INCLUDE_DIR) -TP -W3 -nologo $(C_USR) $(CFLAGS)
CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS) -DSIMPLEX
CLIBFLAGSDEBUG = -Zi $(CLIBFLAGS)
@@ -548,7 +548,7 @@ COMMON_LIB_OBJS = \
{$(VM_DIR)}.asm{$(OBJ_DIR)}.obj:
rem lib /extract:$(OBJ_DIR)\symbols.obj /out:$(OBJ_DIR)\symbols.obj \harb35\lib\vm.lib
$(AS) /c /Fo$@ $<
$(AS) /c /Fo$@ $<
{$(VM_DIR)}.c{$(OBJ_DIR)}.obj:
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<

View File

@@ -43,6 +43,8 @@
* Copyright 2000 Jf. Lefebvre <jfl@mafact.com> and Ra. Cuylen <rac@mafact.com>
* __objDerivedFrom
*
* New Param for Method :ClassSel() to allow it to return only ClassData array
*
* See doc/license.txt for licensing terms.
*
*/
@@ -69,7 +71,7 @@ FUNCTION __objHasMethod( oObject, cSymbol )
RETURN __objHasMsg( oObject, cSymbol ) .AND. ;
!__objHasMsg( oObject, "_" + cSymbol )
FUNCTION __objGetMsgList( oObject, lDataMethod )
FUNCTION __objGetMsgList( oObject, lDataMethod, lClassOnly )
LOCAL aInfo
LOCAL aData
LOCAL n
@@ -83,7 +85,11 @@ FUNCTION __objGetMsgList( oObject, lDataMethod )
lDataMethod := .T.
ENDIF
aInfo := ASort( oObject:ClassSel() )
IF !ISLOGICAL( lClassOnly )
lClassOnly := .F.
ENDIF
aInfo := ASort( oObject:ClassSel(lClassOnly) )
aData := {}
n := 1
nLen := Len( aInfo )

View File

@@ -617,7 +617,7 @@ PHB_FUNC hb_objGetMthd( PHB_ITEM pObject, PHB_SYMB pMessage, BOOL lAllowErrFunc
USHORT uiClass;
PHB_DYNS pMsg = pMessage->pDynSym;
HB_TRACE(HB_TR_DEBUG, ("hb_objGetMethod(%p, %p)", pObject, pMessage));
HB_TRACE(HB_TR_DEBUG, ("hb_objGetMthd(%p, %p)", pObject, pMessage));
if( pObject->type == HB_IT_ARRAY )
uiClass = pObject->item.asArray.value->uiClass;
@@ -688,7 +688,6 @@ PHB_FUNC hb_objGetMthd( PHB_ITEM pObject, PHB_SYMB pMessage, BOOL lAllowErrFunc
return NULL;
}
/*
* <uPtr> = hb_objHasMsg( <pObject>, <szString> )
*
@@ -1940,6 +1939,15 @@ static HARBOUR hb___msgClsSel( void )
/* Get class word */
PHB_ITEM pReturn = hb_itemNew( NULL );
BOOL lParam=0;
USHORT uiPCount=hb_pcount();
if( uiPCount>=1 )
{
lParam = hb_parl( 1 );
}
if( ( ! uiClass ) && HB_IS_BYREF( pSelf ) )
{ /* Variables by reference */
PHB_ITEM pItemRef = hb_itemUnRef( pSelf );
@@ -1961,12 +1969,25 @@ static HARBOUR hb___msgClsSel( void )
{
PHB_DYNS pMessage = ( PHB_DYNS ) pClass->pMethods[ uiAt ].pMessage;
s_pMethod = NULL; /* Current method pointer */
if( pMessage ) /* Hash Entry used ? */
{
PHB_ITEM pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
s_pMethod = pClass->pMethods + uiAt;
if ( (! lParam) ||
s_pMethod->pFunction == hb___msgSetClsData ||
s_pMethod->pFunction == hb___msgGetClsData ||
s_pMethod->pFunction == hb___msgSetShrData ||
s_pMethod->pFunction == hb___msgGetShrData
)
{
PHB_ITEM pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
/* Add to array */
hb_itemArrayPut( pReturn, ++uiPos, pItem );
hb_itemRelease( pItem );
hb_itemArrayPut( pReturn, ++uiPos, pItem );
hb_itemRelease( pItem );
}
}
}
}