On Wed, 11 Feb 2009, [email protected] wrote:
Hi,
> * source/rtl/binnum.c
> * Added rewritten versions of these functions, now with
> a proper license: BIN2W(), BIN2I(), BIN2L(), I2BIN(), L2BIN()
Thanks,
BTW maybe we should also update binumx.c functions to work in similar
way, f.e.:
HB_FUNC( BIN2U )
{
PHB_ITEM pItem = hb_param( 1, HB_IT_STRING );
UINT32 uiResult = 0;
if( pItem )
{
ULONG ulLen = hb_itemGetCLen( pItem );
if( ulLen )
{
const char * pszString = hb_itemGetCPtr( pItem );
if( ulLen >= 3 )
iResult = HB_GET_LE_UINT32( pszString );
else
iResult = HB_GET_LE_UINT16( pszString );
}
}
hb_retnint( uiResult );
}
HB_FUNC( U2BIN )
{
char szResult[ 4 ];
UINT32 iValue = ( UINT32 ) hb_parnint( 1 );
HB_PUT_LE_UINT32( szResult, iValue );
hb_retclen( szResult, 4 );
}
HB_FUNC( W2BIN )
{
char szResult[ 2 ];
UINT16 uiValue = ( UINT16 ) hb_parni( 1 );
HB_PUT_LE_UINT16( szResult, uiValue );
hb_retclen( szResult, 4 );
}
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour