struct hb_struString bPcode member renamed as bStatic

This commit is contained in:
Antonio Linares
2002-02-10 15:08:19 +00:00
parent 6dbdd0be52
commit b6f0f58e1f
4 changed files with 17 additions and 17 deletions

View File

@@ -200,7 +200,7 @@ struct hb_struString
{
ULONG length;
char * value;
BOOL bPcode; /* it is a string created from the pcode */
BOOL bStatic; /* it is a static string from pcode or from a C string */
USHORT * puiHolders; /* number of holders of this string */
};
@@ -607,4 +607,4 @@ extern char * hb_getenv( const char * name );
}
#endif
#endif /* HB_APIEXT_H_ */
#endif /* HB_APIEXT_H_ */

View File

@@ -70,7 +70,7 @@ static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, ULONG ulPos )
pTemp->type = HB_IT_STRING;
pTemp->item.asString.length = strlen( pItem->item.asSymbol.value->szName ) + 2;
pTemp->item.asString.value = ( char * ) hb_xgrab( pTemp->item.asString.length + 1 );
pTemp->item.asString.bPcode = FALSE;
pTemp->item.asString.bStatic = FALSE;
sprintf( pTemp->item.asString.value, "[%s]", pItem->item.asSymbol.value->szName );
@@ -224,4 +224,4 @@ HB_FUNC( __VMVARLSET )
pBase = hb_stack.pItems + ( *pBase )->item.asSymbol.stackbase;
hb_itemCopy( *(pBase + 1 + hb_parni( 2 )), *(hb_stack.pBase + 4) );
}
}

View File

@@ -3830,7 +3830,7 @@ void hb_vmPushString( char * szText, ULONG length )
pStackTopItem->type = HB_IT_STRING;
pStackTopItem->item.asString.length = length;
pStackTopItem->item.asString.value = szTemp;
pStackTopItem->item.asString.bPcode = FALSE;
pStackTopItem->item.asString.bStatic = FALSE;
pStackTopItem->item.asString.puiHolders = ( USHORT * ) hb_xgrab( sizeof( USHORT ) );
*( pStackTopItem->item.asString.puiHolders ) = 1;
hb_stackPush();
@@ -3845,7 +3845,7 @@ void hb_vmPushStringPcode( char * szText, ULONG length )
pStackTopItem->type = HB_IT_STRING;
pStackTopItem->item.asString.length = length;
pStackTopItem->item.asString.value = szText;
pStackTopItem->item.asString.bPcode = TRUE;
pStackTopItem->item.asString.bStatic = TRUE;
hb_stackPush();
}
@@ -4866,4 +4866,4 @@ HB_FUNC( __OPGETPRF ) /* profiler: It returns an array with an opcode called and
hb_stornl( hb_ulOpcodesCalls[ ulOpcode ], -1, 1 );
hb_stornl( hb_ulOpcodesTime[ ulOpcode ], -1, 2 );
}
}
}

View File

@@ -199,13 +199,13 @@ PHB_ITEM hb_itemPutC( PHB_ITEM pItem, char * szText )
{
pItem->item.asString.length = 0;
pItem->item.asString.value = "";
pItem->item.asString.bPcode = TRUE;
pItem->item.asString.bStatic = TRUE;
}
else
{
pItem->item.asString.length = strlen( szText );
pItem->item.asString.value = ( char * ) hb_xgrab( pItem->item.asString.length + 1 );
pItem->item.asString.bPcode = FALSE;
pItem->item.asString.bStatic = FALSE;
pItem->item.asString.puiHolders = ( USHORT * ) hb_xgrab( sizeof( USHORT ) );
* ( pItem->item.asString.puiHolders ) = 1;
strcpy( pItem->item.asString.value, szText );
@@ -224,7 +224,7 @@ PHB_ITEM hb_itemPutCConst( PHB_ITEM pItem, char * szText )
pItem = hb_itemNew( NULL );
pItem->type = HB_IT_STRING;
pItem->item.asString.bPcode = TRUE;
pItem->item.asString.bStatic = TRUE;
if( szText == NULL )
{
@@ -236,7 +236,7 @@ PHB_ITEM hb_itemPutCConst( PHB_ITEM pItem, char * szText )
pItem->item.asString.length = strlen( szText );
pItem->item.asString.value = szText;
}
return pItem;
}
@@ -259,7 +259,7 @@ PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, char * szText, ULONG ulLen )
{
pItem->item.asString.length = 0;
pItem->item.asString.value = "";
pItem->item.asString.bPcode = TRUE;
pItem->item.asString.bStatic = TRUE;
}
else
{
@@ -267,7 +267,7 @@ PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, char * szText, ULONG ulLen )
pItem->item.asString.value = ( char * ) hb_xgrab( ulLen + 1 );
hb_xmemcpy( pItem->item.asString.value, szText, ulLen );
pItem->item.asString.value[ ulLen ] = '\0';
pItem->item.asString.bPcode = FALSE;
pItem->item.asString.bStatic = FALSE;
pItem->item.asString.puiHolders = ( USHORT * ) hb_xgrab( sizeof( USHORT ) );
* ( pItem->item.asString.puiHolders ) = 1;
}
@@ -288,7 +288,7 @@ PHB_ITEM hb_itemPutCPtr( PHB_ITEM pItem, char * szText, ULONG ulLen )
pItem->item.asString.length = ulLen;
pItem->item.asString.value = szText;
pItem->item.asString.value[ ulLen ] = '\0';
pItem->item.asString.bPcode = FALSE;
pItem->item.asString.bStatic = FALSE;
pItem->item.asString.puiHolders = ( USHORT * ) hb_xgrab( sizeof( USHORT ) );
* ( pItem->item.asString.puiHolders ) = 1;
@@ -835,7 +835,7 @@ void hb_itemClear( PHB_ITEM pItem )
if( HB_IS_STRING( pItem ) )
{
if( pItem->item.asString.bPcode )
if( pItem->item.asString.bStatic )
pItem->item.asString.value = NULL;
else
{
@@ -876,7 +876,7 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
memcpy( pDest, pSource, sizeof( HB_ITEM ) );
if( HB_IS_STRING( pSource ) && ! pSource->item.asString.bPcode )
if( HB_IS_STRING( pSource ) && ! pSource->item.asString.bStatic )
{
++*( pSource->item.asString.puiHolders );
}
@@ -1311,4 +1311,4 @@ PHB_ITEM hb_itemValToStr( PHB_ITEM pItem )
hb_xfree( buffer );
return pResult;
}
}