2012-07-27 19:55 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbtinymt/core32.c
* contrib/hbtinymt/core64.c
* contrib/hbtinymt/hbtinymt.hbx
* contrib/hbtinymt/tests/test32.prg
* contrib/hbtinymt/tests/test64.prg
! deleted unnecessary HB_ prefix from wrapper function
names, so now they match the low-level names exactly.
(incompatible with xhb)
This commit is contained in:
@@ -16,6 +16,16 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-07-27 19:55 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbtinymt/core32.c
|
||||
* contrib/hbtinymt/core64.c
|
||||
* contrib/hbtinymt/hbtinymt.hbx
|
||||
* contrib/hbtinymt/tests/test32.prg
|
||||
* contrib/hbtinymt/tests/test64.prg
|
||||
! deleted unnecessary HB_ prefix from wrapper function
|
||||
names, so now they match the low-level names exactly.
|
||||
(incompatible with xhb)
|
||||
|
||||
2012-07-27 11:24 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
- deleted compatibility plugin API functions starting with
|
||||
|
||||
@@ -63,7 +63,7 @@ typedef struct
|
||||
static HB_TSD_NEW( s_tinymtData, sizeof( HB_TINYMTDATA ), NULL, NULL );
|
||||
|
||||
/* Syntax: HB_TINYMT32_INIT( <nVector1>, <nVector2>, <nVector3>, [<nSeed>] ) -> <lSuccess> */
|
||||
HB_FUNC( HB_TINYMT32_INIT )
|
||||
HB_FUNC( TINYMT32_INIT )
|
||||
{
|
||||
if( hb_pcount() >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) )
|
||||
{
|
||||
@@ -84,7 +84,7 @@ HB_FUNC( HB_TINYMT32_INIT )
|
||||
}
|
||||
|
||||
/* Syntax: HB_TINYMT32_INIT_BY_ARRAY( { <nVector1>, <nVector2>, <nVector3> }, [<nSeed>], [<nKeyLength>] ) -> <lSuccess> */
|
||||
HB_FUNC( HB_TINYMT32_INIT_BY_ARRAY )
|
||||
HB_FUNC( TINYMT32_INIT_BY_ARRAY )
|
||||
{
|
||||
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
@@ -108,49 +108,49 @@ HB_FUNC( HB_TINYMT32_INIT_BY_ARRAY )
|
||||
hb_retl( HB_FALSE );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_UINT32 )
|
||||
HB_FUNC( TINYMT32_GENERATE_UINT32 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnint( tinymt32_generate_uint32( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_FLOAT )
|
||||
HB_FUNC( TINYMT32_GENERATE_FLOAT )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt32_generate_float( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_FLOAT01 )
|
||||
HB_FUNC( TINYMT32_GENERATE_FLOAT01 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt32_generate_float01( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_FLOAT12 )
|
||||
HB_FUNC( TINYMT32_GENERATE_FLOAT12 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt32_generate_float12( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_FLOATOC )
|
||||
HB_FUNC( TINYMT32_GENERATE_FLOATOC )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt32_generate_floatOC( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_FLOATOO )
|
||||
HB_FUNC( TINYMT32_GENERATE_FLOATOO )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt32_generate_floatOO( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT32_GENERATE_32DOUBLE )
|
||||
HB_FUNC( TINYMT32_GENERATE_32DOUBLE )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct
|
||||
static HB_TSD_NEW( s_tinymtData, sizeof( HB_TINYMTDATA ), NULL, NULL );
|
||||
|
||||
/* Syntax: HB_TINYMT64_INIT( <nVector1>, <nVector2>, <nVector3>, [<nSeed>] ) -> <lSuccess> */
|
||||
HB_FUNC( HB_TINYMT64_INIT )
|
||||
HB_FUNC( TINYMT64_INIT )
|
||||
{
|
||||
if( hb_pcount() >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) )
|
||||
{
|
||||
@@ -85,7 +85,7 @@ HB_FUNC( HB_TINYMT64_INIT )
|
||||
}
|
||||
|
||||
/* Syntax: HB_TINYMT64_INIT_BY_ARRAY( { <nVector1>, <nVector2>, <nVector3> }, [<nSeed>], [<nKeyLength>] ) -> <lSuccess> */
|
||||
HB_FUNC( HB_TINYMT64_INIT_BY_ARRAY )
|
||||
HB_FUNC( TINYMT64_INIT_BY_ARRAY )
|
||||
{
|
||||
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
@@ -109,42 +109,42 @@ HB_FUNC( HB_TINYMT64_INIT_BY_ARRAY )
|
||||
hb_retl( HB_FALSE );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_UINT64 )
|
||||
HB_FUNC( TINYMT64_GENERATE_UINT64 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnint( tinymt64_generate_uint64( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_DOUBLE )
|
||||
HB_FUNC( TINYMT64_GENERATE_DOUBLE )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt64_generate_double( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_DOUBLE01 )
|
||||
HB_FUNC( TINYMT64_GENERATE_DOUBLE01 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt64_generate_double01( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_DOUBLE12 )
|
||||
HB_FUNC( TINYMT64_GENERATE_DOUBLE12 )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt64_generate_double12( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_DOUBLEOC )
|
||||
HB_FUNC( TINYMT64_GENERATE_DOUBLEOC )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
hb_retnd( tinymt64_generate_doubleOC( &tinymtData->tinymt ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_TINYMT64_GENERATE_DOUBLEOO )
|
||||
HB_FUNC( TINYMT64_GENERATE_DOUBLEOO )
|
||||
{
|
||||
PHB_TINYMTDATA tinymtData = ( PHB_TINYMTDATA ) hb_stackGetTSD( &s_tinymtData );
|
||||
|
||||
|
||||
@@ -25,23 +25,23 @@
|
||||
#command DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
#endif
|
||||
|
||||
DYNAMIC hb_tinymt32_generate_32double
|
||||
DYNAMIC hb_tinymt32_generate_float
|
||||
DYNAMIC hb_tinymt32_generate_float01
|
||||
DYNAMIC hb_tinymt32_generate_float12
|
||||
DYNAMIC hb_tinymt32_generate_floatoc
|
||||
DYNAMIC hb_tinymt32_generate_floatoo
|
||||
DYNAMIC hb_tinymt32_generate_uint32
|
||||
DYNAMIC hb_tinymt32_init
|
||||
DYNAMIC hb_tinymt32_init_by_array
|
||||
DYNAMIC hb_tinymt64_generate_double
|
||||
DYNAMIC hb_tinymt64_generate_double01
|
||||
DYNAMIC hb_tinymt64_generate_double12
|
||||
DYNAMIC hb_tinymt64_generate_doubleoc
|
||||
DYNAMIC hb_tinymt64_generate_doubleoo
|
||||
DYNAMIC hb_tinymt64_generate_uint64
|
||||
DYNAMIC hb_tinymt64_init
|
||||
DYNAMIC hb_tinymt64_init_by_array
|
||||
DYNAMIC tinymt32_generate_32double
|
||||
DYNAMIC tinymt32_generate_float
|
||||
DYNAMIC tinymt32_generate_float01
|
||||
DYNAMIC tinymt32_generate_float12
|
||||
DYNAMIC tinymt32_generate_floatOC
|
||||
DYNAMIC tinymt32_generate_floatOO
|
||||
DYNAMIC tinymt32_generate_uint32
|
||||
DYNAMIC tinymt32_init
|
||||
DYNAMIC tinymt32_init_by_array
|
||||
DYNAMIC tinymt64_generate_double
|
||||
DYNAMIC tinymt64_generate_double01
|
||||
DYNAMIC tinymt64_generate_double12
|
||||
DYNAMIC tinymt64_generate_doubleOC
|
||||
DYNAMIC tinymt64_generate_doubleOO
|
||||
DYNAMIC tinymt64_generate_uint64
|
||||
DYNAMIC tinymt64_init
|
||||
DYNAMIC tinymt64_init_by_array
|
||||
|
||||
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBTINYMT__REQUEST )
|
||||
#uncommand DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
|
||||
@@ -13,19 +13,19 @@ PROCEDURE Main()
|
||||
|
||||
SET DECIMAL TO 0
|
||||
|
||||
IF hb_tinymt32_init( 0x123, 0x234, 0x345 )
|
||||
TestMatrix( "32-bit unsigned integers r, where 0 <= r < 2^32", {|| PadL( hb_tinymt32_generate_uint32(), 11 ) } )
|
||||
IF tinymt32_init( 0x123, 0x234, 0x345 )
|
||||
TestMatrix( "32-bit unsigned integers r, where 0 <= r < 2^32", {|| PadL( tinymt32_generate_uint32(), 11 ) } )
|
||||
ENDIF
|
||||
|
||||
SET DECIMAL TO 12
|
||||
|
||||
IF hb_tinymt32_init_by_array( { 0x123, 0x234, 0x345 } )
|
||||
TestMatrix( "Float numbers r, where 0.0 <= r < 1.0", {|| PadL( hb_tinymt32_generate_float(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 <= r < 1.0", {|| PadL( hb_tinymt32_generate_float01(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 1.0 <= r < 2.0", {|| PadL( hb_tinymt32_generate_float12(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 < r <= 1.0", {|| PadL( hb_tinymt32_generate_floatoc(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 < r < 1.0" , {|| PadL( hb_tinymt32_generate_floatoo(), 15 ) } )
|
||||
TestMatrix( "32-bit precision double numbers r, where 0.0 <= r < 1.0", {|| PadL( hb_tinymt32_generate_32double(), 15 ) } )
|
||||
IF tinymt32_init_by_array( { 0x123, 0x234, 0x345 } )
|
||||
TestMatrix( "Float numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt32_generate_float(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt32_generate_float01(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 1.0 <= r < 2.0", {|| PadL( tinymt32_generate_float12(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 < r <= 1.0", {|| PadL( tinymt32_generate_floatoc(), 15 ) } )
|
||||
TestMatrix( "Float numbers r, where 0.0 < r < 1.0" , {|| PadL( tinymt32_generate_floatoo(), 15 ) } )
|
||||
TestMatrix( "32-bit precision double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt32_generate_32double(), 15 ) } )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -8,18 +8,18 @@ PROCEDURE Main()
|
||||
|
||||
SET DECIMAL TO 0
|
||||
|
||||
IF hb_tinymt64_init( 0x123, 0x234, 0x345 )
|
||||
TestMatrix( "64-bit unsigned integers r, where 0 <= r < 2^64", {|| PadL( hb_tinymt64_generate_uint64(), 22 ) } )
|
||||
IF tinymt64_init( 0x123, 0x234, 0x345 )
|
||||
TestMatrix( "64-bit unsigned integers r, where 0 <= r < 2^64", {|| PadL( tinymt64_generate_uint64(), 22 ) } )
|
||||
ENDIF
|
||||
|
||||
SET DECIMAL TO 22
|
||||
|
||||
IF hb_tinymt64_init_by_array( { 0x123, 0x234, 0x345 } )
|
||||
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( hb_tinymt64_generate_double(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( hb_tinymt64_generate_double01(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 1.0 <= r < 2.0", {|| PadL( hb_tinymt64_generate_double12(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 < r <= 1.0", {|| PadL( hb_tinymt64_generate_doubleoc(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 < r < 1.0" , {|| PadL( hb_tinymt64_generate_doubleoo(), 30 ) } )
|
||||
IF tinymt64_init_by_array( { 0x123, 0x234, 0x345 } )
|
||||
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt64_generate_double(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt64_generate_double01(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 1.0 <= r < 2.0", {|| PadL( tinymt64_generate_double12(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 < r <= 1.0", {|| PadL( tinymt64_generate_doubleoc(), 30 ) } )
|
||||
TestMatrix( "Double numbers r, where 0.0 < r < 1.0" , {|| PadL( tinymt64_generate_doubleoo(), 30 ) } )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
Reference in New Issue
Block a user