*** empty log message ***
This commit is contained in:
parent
5f177783f8
commit
72f2be9f67
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: func.c,v 1.94 2007-02-07 07:17:02 bacon Exp $
|
* $Id: func.c,v 1.95 2007-02-07 14:08:07 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -20,18 +20,7 @@ static int __bfn_match (ase_awk_run_t*, const ase_char_t*, ase_size_t);
|
|||||||
static int __bfn_sprintf (ase_awk_run_t*, const ase_char_t*, ase_size_t);
|
static int __bfn_sprintf (ase_awk_run_t*, const ase_char_t*, ase_size_t);
|
||||||
|
|
||||||
#undef MAX
|
#undef MAX
|
||||||
#if defined(__HP_cc)
|
#define MAX ASE_TYPE_UNSIGNED_MAX(ase_size_t)
|
||||||
#if ASE_SIZEOF_VOID_P == 4
|
|
||||||
#define MAX 0xFFFFFFFFlu
|
|
||||||
#elif ASE_SIZEOF_VOID_P == 8
|
|
||||||
#define MAX 0xFFFFFFFFFFFFFFFFllu
|
|
||||||
#else
|
|
||||||
#define MAX ASE_TYPE_MAX(ase_size_t)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define MAX ASE_TYPE_MAX(ase_size_t)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static ase_awk_bfn_t __sys_bfn[] =
|
static ase_awk_bfn_t __sys_bfn[] =
|
||||||
{
|
{
|
||||||
|
17
ase/macros.h
17
ase/macros.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: macros.h,v 1.45 2007-02-03 10:52:36 bacon Exp $
|
* $Id: macros.h,v 1.46 2007-02-07 14:04:34 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -24,18 +24,29 @@
|
|||||||
|
|
||||||
#define ASE_TYPE_IS_SIGNED(type) (((type)0) > ((type)-1))
|
#define ASE_TYPE_IS_SIGNED(type) (((type)0) > ((type)-1))
|
||||||
#define ASE_TYPE_IS_UNSIGNED(type) (((type)0) < ((type)-1))
|
#define ASE_TYPE_IS_UNSIGNED(type) (((type)0) < ((type)-1))
|
||||||
|
|
||||||
|
#define ASE_TYPE_SIGNED_MAX(type) \
|
||||||
|
((type)~((type)1 << (ASE_SIZEOF(type) * 8 - 1)))
|
||||||
|
#define ASE_TYPE_UNSIGNED_MAX(type) ((type)(~(type)0))
|
||||||
|
|
||||||
|
#define ASE_TYPE_SIGNED_MIN(type) \
|
||||||
|
((type)((type)1 << (ASE_SIZEOF(type) * 8 - 1)))
|
||||||
|
#define ASE_TYPE_UNSIGNED_MIN(type) ((type)0)
|
||||||
|
|
||||||
#define ASE_TYPE_MAX(type) \
|
#define ASE_TYPE_MAX(type) \
|
||||||
((ASE_TYPE_IS_SIGNED(type)? (type)~((type)1 << (ASE_SIZEOF(type) * 8 - 1)): (type)(~(type)0)))
|
((ASE_TYPE_IS_SIGNED(type)? ASE_TYPE_SIGNED_MAX(type): ASE_TYPE_UNSIGNED_MAX(type)))
|
||||||
#define ASE_TYPE_MIN(type) \
|
#define ASE_TYPE_MIN(type) \
|
||||||
((ASE_TYPE_IS_SIGNED(type)? (type)((type)1 << (ASE_SIZEOF(type) * 8 - 1)): (type)0))
|
((ASE_TYPE_IS_SIGNED(type)? ASE_TYPE_SIGNED_MIN(type): ASE_TYPE_UNSIGNED_MIN(type)))
|
||||||
|
|
||||||
#define ASE_IS_POWOF2(x) (((x) & ((x) - 1)) == 0)
|
#define ASE_IS_POWOF2(x) (((x) & ((x) - 1)) == 0)
|
||||||
|
|
||||||
#define ASE_SWAP(x,y,original_type,casting_type) \
|
#define ASE_SWAP(x,y,original_type,casting_type) \
|
||||||
do { \
|
do { \
|
||||||
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
||||||
y = (original_type)((casting_type)(y) ^ (casting_type)(x)); \
|
y = (original_type)((casting_type)(y) ^ (casting_type)(x)); \
|
||||||
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define ASE_ABS(x) ((x) < 0? -(x): (x))
|
#define ASE_ABS(x) ((x) < 0? -(x): (x))
|
||||||
|
|
||||||
#define ASE_LOOP_CONTINUE(id) goto __loop_ ## id ## _begin__;
|
#define ASE_LOOP_CONTINUE(id) goto __loop_ ## id ## _begin__;
|
||||||
|
Loading…
Reference in New Issue
Block a user