hb_arrayPut() used instead of hb_itemArrayPut()

This commit is contained in:
Antonio Linares
2002-01-21 10:47:04 +00:00
parent bb25145a1c
commit cbe8fb2136

View File

@@ -320,17 +320,16 @@ static void hb_clsRelease( PCLASS pClass )
HB_TRACE(HB_TR_DEBUG, ("hb_clsRelease(%p)", pClass));
for( uiAt = 0; uiAt < uiLimit; uiAt++, pMeth++ )
{
{
if( pMeth->pInitValue )
hb_itemRelease( pMeth->pInitValue );
}
}
hb_xfree( pClass->szName );
hb_xfree( pClass->pMethods );
hb_itemRelease( pClass->pClassDatas );
hb_itemRelease( pClass->pInlines );
}
@@ -386,10 +385,10 @@ void hb_clsIsClassRef( void )
uiLimit = ( USHORT ) ( pClass->uiHashKey * BUCKET );
pMeth = pClass->pMethods;
for( uiAt = 0; uiAt < uiLimit; uiAt++, pMeth++ )
{
{
if( pMeth->pInitValue )
hb_gcItemRef( pMeth->pInitValue );
}
}
++pClass;
}
@@ -672,7 +671,7 @@ char * hb_objGetRealClsName( PHB_ITEM pObject, char * szName )
if( ! pObject->item.asArray.value->uiClass )
szClassName = "ARRAY";
else
{
{
PHB_DYNS pMsg = hb_dynsymFindName( szName );
USHORT uiClass;
USHORT uiCurCls;
@@ -681,51 +680,50 @@ char * hb_objGetRealClsName( PHB_ITEM pObject, char * szName )
uiClass = pObject->item.asArray.value->uiClass;
/* default value to current class object */
if (pObject->item.asArray.value->puiClsTree && pObject->item.asArray.value->puiClsTree[0])
{
uiClsTree = pObject->item.asArray.value->puiClsTree[0] ;
uiCurCls = pObject->item.asArray.value->puiClsTree[uiClsTree] ;
}
if( pObject->item.asArray.value->puiClsTree && pObject->item.asArray.value->puiClsTree[0] )
{
uiClsTree = pObject->item.asArray.value->puiClsTree[0] ;
uiCurCls = pObject->item.asArray.value->puiClsTree[uiClsTree] ;
}
else
{
{
uiClsTree = 1; /* Flag value */
uiCurCls = uiClass;
}
}
while (uiClsTree)
{
if( uiCurCls && uiCurCls <= s_uiClasses )
{
if( uiCurCls && uiCurCls <= s_uiClasses )
{
PCLASS pClass = s_pClasses + ( uiCurCls - 1 );
USHORT uiAt = ( USHORT ) ( ( ( hb_cls_MsgToNum( pMsg ) ) % pClass->uiHashKey ) * BUCKET );
USHORT uiMask = ( USHORT ) ( pClass->uiHashKey * BUCKET );
USHORT uiLimit = ( USHORT ) ( uiAt ? ( uiAt - 1 ) : ( uiMask - 1 ) );
PCLASS pClass = s_pClasses + ( uiCurCls - 1 );
USHORT uiAt = ( USHORT ) ( ( ( hb_cls_MsgToNum( pMsg ) ) % pClass->uiHashKey ) * BUCKET );
USHORT uiMask = ( USHORT ) ( pClass->uiHashKey * BUCKET );
USHORT uiLimit = ( USHORT ) ( uiAt ? ( uiAt - 1 ) : ( uiMask - 1 ) );
while( uiAt != uiLimit )
{
if( pClass->pMethods[ uiAt ].pMessage == pMsg )
{
uiClass = (pClass->pMethods + uiAt)->uiSprClass;
uiClsTree=1; /* Flag Value */
break;
}
uiAt++;
if( uiAt == uiMask )
uiAt = 0;
}
while( uiAt != uiLimit )
{
if( pClass->pMethods[ uiAt ].pMessage == pMsg )
{
uiClass = (pClass->pMethods + uiAt)->uiSprClass;
uiClsTree=1; /* Flag Value */
break;
}
uiAt++;
if( uiAt == uiMask )
uiAt = 0;
}
}
if (-- uiClsTree)
uiCurCls = pObject->item.asArray.value->puiClsTree[uiClsTree] ;
if( --uiClsTree )
uiCurCls = pObject->item.asArray.value->puiClsTree[uiClsTree];
}
if( uiClass && uiClass <= s_uiClasses )
szClassName = ( s_pClasses + uiClass - 1 )->szName;
else
szClassName = "UNKNOWN";
if( uiClass && uiClass <= s_uiClasses )
szClassName = ( s_pClasses + uiClass - 1 )->szName;
else
szClassName = "UNKNOWN";
}
}
}
else /* built in types */
{
@@ -1479,8 +1477,8 @@ HB_FUNC( __CLSDELMSG )
while( pClass->pMethods[ uiAt ].pMessage && uiAt != uiLimit )
{
hb_xmemcpy( pClass->pMethods + uiAt,
pClass->pMethods + ( ( uiAt == uiMask ) ? 0 : uiAt + 1 ),
sizeof( METHOD ) );
pClass->pMethods + ( ( uiAt == uiMask ) ? 0 : uiAt + 1 ),
sizeof( METHOD ) );
uiAt++;
if( uiAt == uiMask )
uiAt = 0;
@@ -1531,8 +1529,7 @@ static PHB_ITEM hb_clsInst( USHORT uiClass )
pSelf->item.asArray.value->uiClass = uiClass;
pSelf->item.asArray.value->uiPrevCls = 0;
pSelf->item.asArray.value->puiClsTree = NULL;
pSelf->item.asArray.value->puiClsTree = NULL;
/* pSelf->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); */
/* pSelf->item.asArray.value->puiClsTree[0]=0; */
@@ -1734,15 +1731,15 @@ HB_FUNC( __OBJCLONE )
PHB_ITEM pDstObject ;
if( pSrcObject )
{
pDstObject= hb_arrayClone( pSrcObject, NULL ) ;
{
pDstObject = hb_arrayClone( pSrcObject, NULL ) ;
pDstObject->item.asArray.value->puiClsTree = NULL;
/* pDstObject->item.asArray.value->puiClsTree = ( USHORT * ) hb_xgrab( sizeof( USHORT ) ); */
/* pDstObject->item.asArray.value->puiClsTree[0]=0; */
hb_itemRelease( hb_itemReturn( pDstObject ) );
}
}
else
hb_errRT_BASE( EG_ARG, 3001, NULL, "__OBJCLONE", 0 );
}
@@ -1940,7 +1937,7 @@ HB_FUNC( __CLASSSEL )
{
PHB_ITEM pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
/* Add to array */
hb_itemArrayPut( pReturn, ++uiPos, pItem );
hb_arraySet( pReturn, ++uiPos, pItem );
hb_itemRelease( pItem );
}
}
@@ -2168,7 +2165,7 @@ static HARBOUR hb___msgClsSel( void )
PHB_ITEM pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
/* Add to array */
hb_itemArrayPut( pReturn, ++uiPos, pItem );
hb_arraySet( pReturn, ++uiPos, pItem );
hb_itemRelease( pItem );
}
}
@@ -2252,7 +2249,7 @@ static HARBOUR hb___msgSuper( void )
PHB_ITEM pCopy = hb_itemArrayNew(1);
/* Now save the Self object as the 1st elem. */
hb_itemArrayPut( pCopy, 1 , pObject );
hb_arraySet( pCopy, 1 , pObject );
/* Or Store original object as 1st elem */
/* hb_itemCopy( pCopy->item.asArray.value->pItems , pObject) ; */
@@ -2260,11 +2257,9 @@ static HARBOUR hb___msgSuper( void )
/* And transform it into a fake object */
pCopy->item.asArray.value->uiPrevCls = pObject->item.asArray.value->uiClass; /* backup of actual handel */
pCopy->item.asArray.value->uiClass = s_pMethod->uiSprClass; /* superclass handel casting */
pCopy->item.asArray.value->puiClsTree = NULL;
pCopy->item.asArray.value->puiClsTree = 0 ;
hb_itemRelease(hb_itemReturn( pCopy ));
hb_itemRelease( hb_itemReturn( pCopy ) );
}
/*
@@ -2404,7 +2399,7 @@ HB_FUNC( __CLS_PARAM )
for( n = 1; n <= uiParam; n++ )
{
PHB_ITEM iTmp = hb_itemParam( n );
hb_itemArrayPut( array, n, iTmp );
hb_arraySet( array, n, iTmp );
hb_itemRelease( iTmp );
}
}
@@ -2412,7 +2407,7 @@ HB_FUNC( __CLS_PARAM )
{
PHB_ITEM iTmp = hb_itemPutC( NULL, (char *) "HBObject" );
array = hb_itemArrayNew( 1 );
hb_itemArrayPut( array, 1, iTmp );
hb_arraySet( array, 1, iTmp );
hb_itemRelease( iTmp );
}
@@ -2431,7 +2426,7 @@ HB_FUNC( __CLS_PAR00 )
for( n = 1; n <= uiParam; n++ )
{
PHB_ITEM iTmp = hb_itemParam( n );
hb_itemArrayPut( array, n, iTmp );
hb_arraySet( array, n, iTmp );
hb_itemRelease( iTmp );
}
@@ -2526,4 +2521,3 @@ HB_FUNC( __CLSGETPROPERTIES )
hb_itemRelease( hb_itemReturn( pReturn ) );
}