@ -32,26 +32,26 @@ typedef __typeof(((struct jr_state*)NULL)->st) jr_xsub_t;
_Static_assert ( sizeof ( uint48_t ) = = ( sizeof ( uint16_t ) * 3 ) , " bad uint48 (ushort[3]) " ) ;
_Static_assert ( sizeof ( uint48_t ) = = ( sizeof ( uint16_t ) * 3 ) , " bad uint48 (ushort[3]) " ) ;
_Static_assert ( sizeof ( ( ( struct jr_state * ) NULL ) - > st ) = = sizeof ( uint64_t ) , " bad uint64 (union st) " ) ;
_Static_assert ( sizeof ( ( ( struct jr_state * ) NULL ) - > st ) = = sizeof ( uint64_t ) , " bad uint64 (union st) " ) ;
__attribute__ ( ( nonnull , returns_nonnull ) )
static unsigned short * IFUNC_DEF ( _jr_st_resolv , ( jr_xsub_t * restrict state )
__attribute__ ( ( const , nonnull , returns_nonnull ) ) ) ;
static unsigned short * IFUNC_IMPL ( _jr_st_resolv , low ) ( jr_xsub_t * restrict state )
static unsigned short * IFUNC_IMPL ( _jr_st_resolv , low ) ( jr_xsub_t * restrict state )
{
{
return state - > xsubi ;
return state - > xsubi ;
}
}
__attribute__ ( ( nonnull , returns_nonnull ) )
static unsigned short * IFUNC_IMPL ( _jr_st_resolv , high ) ( jr_xsub_t * restrict state )
static unsigned short * IFUNC_IMPL ( _jr_st_resolv , high ) ( jr_xsub_t * restrict state )
{
{
return state - > xsubi + 1 ;
return state - > xsubi + 1 ;
}
}
__attribute__ ( ( returns_nonnull ) )
__attribute__ ( ( const ) )
static unsigned short * IFUNC_RESOLVER ( _jr_st_resolv ) ( jr_xsub_t * restrict state )
static unsigned short * IFUNC_RESOLVER ( _jr_st_resolv ) ( jr_xsub_t * restrict state )
{
{
struct jr_state chk = { 0 } ;
struct jr_state chk = { 0 } ;
chk . st . xsubh = JR_MAX ;
chk . st . xsubh = JR_MAX ;
return chk . st . _xsub
return chk . st . _xsub
? & IFUNC_ IMPL ( _jr_st_resolv , high )
? & IFUNC_ NAME ( _jr_st_resolv , high )
: & IFUNC_ IMPL ( _jr_st_resolv , low ) ;
: & IFUNC_ NAME ( _jr_st_resolv , low ) ;
}
}
static unsigned short * IFUNC_DEF ( _jr_st_resolv , ( jr_xsub_t * restrict state ) __attribute__ ( ( nonnull , returns_nonnull ) ) ) ;
internal void _jr_seed ( struct jr_state * restrict state , unsigned long with )
internal void _jr_seed ( struct jr_state * restrict state , unsigned long with )
{
{
@ -71,6 +71,7 @@ internal double _jr_procf(struct jr_state* restrict state)
return state - > fresult ;
return state - > fresult ;
}
}
__attribute__ ( ( malloc ( _jr_free ) ) )
internal struct jr_state * _jr_alloc ( )
internal struct jr_state * _jr_alloc ( )
{
{
struct jr_state * bx = aligned_alloc ( _Alignof ( struct jr_state ) , sizeof ( struct jr_state ) ) ;
struct jr_state * bx = aligned_alloc ( _Alignof ( struct jr_state ) , sizeof ( struct jr_state ) ) ;
@ -78,7 +79,7 @@ internal struct jr_state* _jr_alloc()
return bx ;
return bx ;
}
}
__attribute__ ( ( malloc ( _jr_free ) ) )
internal struct jr_state * _jr_new ( unsigned long with )
internal struct jr_state * _jr_new ( unsigned long with )
{
{
struct jr_state * state = _jr_alloc ( ) ;
struct jr_state * state = _jr_alloc ( ) ;