20000502-09:30 GMT+1 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
20000502-09:30 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* utils/hbtest/rt_hvma.prg
|
||||
+ Added some tests for the new compile-time generated double widths.
|
||||
|
||||
* source/vm/hvm.c
|
||||
% Some optimization for hb_vmCalcDoubleWidth()
|
||||
|
||||
* source/rdd/dbfcdx/dbfcdx1.c
|
||||
! Fixed two -O2 GCC warnings.
|
||||
|
||||
2000-05-02 01:45 GMT-4 David G. Holm <dholm@jsd-llc.com>
|
||||
|
||||
* include/hbapigt.h
|
||||
@@ -122,7 +133,7 @@
|
||||
This is used for codeblocks which have no parameters, use no locals,
|
||||
and the total size is smaller than 255 bytes. The majority of codeblocks
|
||||
falls into this category.
|
||||
HB_TEST is now 15K smaller.
|
||||
HBTEST is now 15K smaller.
|
||||
|
||||
! WARNING ! All .PRGs must be recompiled after the changes of today.
|
||||
|
||||
|
||||
@@ -531,6 +531,7 @@ static int hb_cdxKeyCompare( LPKEYINFO pKey1, LPKEYINFO pKey2, USHORT * EndPos,
|
||||
return 1;
|
||||
if( pKey1 == NULL || pKey1->pItem->item.asString.length == 0 )
|
||||
return ( pKey2->pItem->item.asString.length == 0 ) ? 0: -1;
|
||||
|
||||
switch( hb_itemType( pKey1->pItem ) )
|
||||
{
|
||||
case HB_IT_STRING:
|
||||
@@ -544,6 +545,7 @@ static int hb_cdxKeyCompare( LPKEYINFO pKey1, LPKEYINFO pKey2, USHORT * EndPos,
|
||||
pKey2->pItem->item.asString.value[ * EndPos ];
|
||||
* EndPos += 1;
|
||||
} while( iResult == 0 && * EndPos < iLimit );
|
||||
|
||||
if( iResult == 0 )
|
||||
{
|
||||
* EndPos += 1;
|
||||
@@ -555,8 +557,10 @@ static int hb_cdxKeyCompare( LPKEYINFO pKey1, LPKEYINFO pKey2, USHORT * EndPos,
|
||||
break;
|
||||
|
||||
default:
|
||||
iResult = 0;
|
||||
printf( "hb_cdxKeyCompare()" );
|
||||
}
|
||||
|
||||
if( iResult < 0 )
|
||||
return -1;
|
||||
else if( iResult > 0 )
|
||||
@@ -2766,6 +2770,7 @@ static ERRCODE cdxOrderCreate( AREAP pArea, LPDBORDERCREATEINFO pOrderInfo )
|
||||
|
||||
uiType = hb_itemType( pResult );
|
||||
uiLen = 0;
|
||||
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_IT_INTEGER:
|
||||
@@ -2790,6 +2795,9 @@ static ERRCODE cdxOrderCreate( AREAP pArea, LPDBORDERCREATEINFO pOrderInfo )
|
||||
uiLen = pResult->item.asString.length > CDX_MAX_KEY ? CDX_MAX_KEY :
|
||||
pResult->item.asString.length;
|
||||
break;
|
||||
|
||||
default:
|
||||
bType = '\0';
|
||||
}
|
||||
|
||||
hb_itemRelease( pResult );
|
||||
|
||||
@@ -3097,16 +3097,13 @@ void hb_vmPushDouble( double dNumber, int iDec )
|
||||
static int hb_vmCalcDoubleWidth( double dNumber, int iDec )
|
||||
{
|
||||
char buffer[ 260 ];
|
||||
int iLength;
|
||||
|
||||
sprintf( buffer, "%.*f", 0, dNumber );
|
||||
|
||||
iLength = strlen( buffer );
|
||||
|
||||
if( iDec == 0 )
|
||||
iLength++;
|
||||
|
||||
return iLength;
|
||||
return strlen( buffer ) + 1;
|
||||
else
|
||||
return strlen( buffer );
|
||||
}
|
||||
|
||||
static void hb_vmPushDoubleConst( double dNumber, int iWidth, int iDec )
|
||||
|
||||
@@ -471,6 +471,8 @@ FUNCTION Main_HVMA()
|
||||
TEST_LINE( RTSTR( 1000000000.00 ) , " 13 1000000000.00" )
|
||||
TEST_LINE( RTSTR( 1000000000.99 ) , " 13 1000000000.99" )
|
||||
TEST_LINE( RTSTR( 4000000000 ) , " 11 4000000000" )
|
||||
TEST_LINE( RTSTR( 00005 ) , " 10 5" )
|
||||
TEST_LINE( RTSTR( 00005.5 ) , " 12 5.5" )
|
||||
TEST_LINE( RTSTR( 5000000000 ) , " 11 5000000000" )
|
||||
TEST_LINE( RTSTR( 50000000000 ) , " 12 50000000000" )
|
||||
TEST_LINE( RTSTR( 500000000000 ) , " 13 500000000000" )
|
||||
@@ -478,6 +480,10 @@ FUNCTION Main_HVMA()
|
||||
TEST_LINE( RTSTR( 5000000000000 ) , " 14 5000000000000" )
|
||||
TEST_LINE( RTSTR( 50000000000000 ) , " 15 50000000000000" )
|
||||
TEST_LINE( RTSTR( 500000000000000 ) , " 16 500000000000000" )
|
||||
TEST_LINE( RTSTR( 00000000000005 ) , " 10 5" )
|
||||
TEST_LINE( RTSTR( 00000500000000000000 ) , " 21 500000000000000" )
|
||||
TEST_LINE( RTSTR( 0500000000000000 ) , " 17 500000000000000" )
|
||||
TEST_LINE( RTSTR( 0500000000000000.5 ) , " 18 500000000000000.5" )
|
||||
TEST_LINE( RTSTR( 5000000000000000 ) , " 17 5000000000000000" )
|
||||
TEST_LINE( RTSTR( 50000000000000000 ) , " 18 50000000000000000" )
|
||||
TEST_LINE( RTSTR( 500000000000000000 ) , " 19 500000000000000000" )
|
||||
|
||||
Reference in New Issue
Block a user