*** empty log message ***

This commit is contained in:
hyung-hwan 2007-02-28 11:19:03 +00:00
parent c2acd692ae
commit cd082b88ca

View File

@ -1,5 +1,5 @@
/* /*
* $Id: rex.c,v 1.70 2007-02-28 11:04:16 bacon Exp $ * $Id: rex.c,v 1.71 2007-02-28 11:19:03 bacon Exp $
* *
* {License} * {License}
*/ */
@ -143,12 +143,12 @@ typedef const ase_byte_t* (*atom_matcher_t) (
#define ADD_CODE(rex,data,len) \ #define ADD_CODE(rex,data,len) \
do { if (__add_code(rex,data,len) == -1) return -1; } while (0) do { if (__add_code(rex,data,len) == -1) return -1; } while (0)
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
#define GET_CODE(rex,pos,type) __get_code(rex,pos)
#define SET_CODE(rex,pos,type,code) __set_code(rex,pos,code)
#else
#define GET_CODE(rex,pos,type) (*((type*)&(rex)->code.buf[pos])) #define GET_CODE(rex,pos,type) (*((type*)&(rex)->code.buf[pos]))
#define SET_CODE(rex,pos,type,code) (GET_CODE(rex,pos,type) = (code)) #define SET_CODE(rex,pos,type,code) (GET_CODE(rex,pos,type) = (code))
#else
#define GET_CODE(rex,pos,type) __get_code(rex,pos)
#define SET_CODE(rex,pos,type,code) __set_code(rex,pos,code)
#endif #endif
static int __build_pattern (builder_t* rex); static int __build_pattern (builder_t* rex);
@ -162,7 +162,7 @@ static int __build_range (builder_t* rex, struct code_t* cmd);
static int __next_char (builder_t* rex, int level); static int __next_char (builder_t* rex, int level);
static int __add_code (builder_t* rex, void* data, ase_size_t len); static int __add_code (builder_t* rex, void* data, ase_size_t len);
#if defined(__sparc) || defined(__sparc__) #if !defined(__i386) && !defined(__i386__)
static ase_size_t __get_code (builder_t* builder, ase_size_t pos) static ase_size_t __get_code (builder_t* builder, ase_size_t pos)
{ {
@ -404,17 +404,17 @@ ase_bool_t ase_awk_isemptyrex (ase_awk_t* awk, void* code)
ASE_AWK_ASSERT (awk, p != ASE_NULL); ASE_AWK_ASSERT (awk, p != ASE_NULL);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#else
nb = *(ase_size_t*)p; nb = *(ase_size_t*)p;
#else
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#endif #endif
p += ASE_SIZEOF(nb); p += ASE_SIZEOF(nb);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&el, p, ASE_SIZEOF(el));
#else
el = *(ase_size_t*)p; el = *(ase_size_t*)p;
#else
ase_memcpy (&el, p, ASE_SIZEOF(el));
#endif #endif
p += ASE_SIZEOF(el); p += ASE_SIZEOF(el);
@ -1039,17 +1039,17 @@ static const ase_byte_t* __match_pattern (
ase_size_t nb, el, i; ase_size_t nb, el, i;
p = base; p = base;
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#else
nb = *(ase_size_t*)p; nb = *(ase_size_t*)p;
#else
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#endif #endif
p += ASE_SIZEOF(nb); p += ASE_SIZEOF(nb);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&el, p, ASE_SIZEOF(el));
#else
el = *(ase_size_t*)p; el = *(ase_size_t*)p;
#else
ase_memcpy (&el, p, ASE_SIZEOF(el));
#endif #endif
p += ASE_SIZEOF(el); p += ASE_SIZEOF(el);
@ -1382,17 +1382,17 @@ static const ase_byte_t* __match_charset (
lbound = cp->lbound; lbound = cp->lbound;
ubound = cp->ubound; ubound = cp->ubound;
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&csc, p, ASE_SIZEOF(csc));
#else
csc = *(ase_size_t*)p; csc = *(ase_size_t*)p;
#else
ase_memcpy (&csc, p, ASE_SIZEOF(csc));
#endif #endif
p += ASE_SIZEOF(csc); p += ASE_SIZEOF(csc);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&csl, p, ASE_SIZEOF(csl));
#else
csl = *(ase_size_t*)p; csl = *(ase_size_t*)p;
#else
ase_memcpy (&csl, p, ASE_SIZEOF(csl));
#endif #endif
p += ASE_SIZEOF(csl); p += ASE_SIZEOF(csl);
@ -1795,17 +1795,17 @@ static const ase_byte_t* __print_pattern (ase_awk_t* awk, const ase_byte_t* p)
{ {
ase_size_t nb, el, i; ase_size_t nb, el, i;
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#else
nb = *(ase_size_t*)p; nb = *(ase_size_t*)p;
#else
ase_memcpy (&nb, p, ASE_SIZEOF(nb));
#endif #endif
p += ASE_SIZEOF(nb); p += ASE_SIZEOF(nb);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&el, p, ASE_SIZEOF(el));
#else
el = *(ase_size_t*)p; el = *(ase_size_t*)p;
#else
ase_memcpy (&el, p, ASE_SIZEOF(el));
#endif #endif
p += ASE_SIZEOF(el); p += ASE_SIZEOF(el);
@ -1866,17 +1866,17 @@ static const ase_byte_t* __print_atom (ase_awk_t* awk, const ase_byte_t* p)
DPRINTF (DCUSTOM, ASE_T("[")); DPRINTF (DCUSTOM, ASE_T("["));
if (cp->negate) DPRINTF (DCUSTOM, ASE_T("^")); if (cp->negate) DPRINTF (DCUSTOM, ASE_T("^"));
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&csc, p, ASE_SIZEOF(csc));
#else
csc = *(ase_size_t*)p; csc = *(ase_size_t*)p;
#else
ase_memcpy (&csc, p, ASE_SIZEOF(csc));
#endif #endif
p += ASE_SIZEOF(csc); p += ASE_SIZEOF(csc);
#if defined(__sparc) || defined(__sparc__) #if defined(__i386) || defined(__i386__)
ase_memcpy (&csl, p, ASE_SIZEOF(csl));
#else
csl = *(ase_size_t*)p; csl = *(ase_size_t*)p;
#else
ase_memcpy (&csl, p, ASE_SIZEOF(csl));
#endif #endif
p += ASE_SIZEOF(csl); p += ASE_SIZEOF(csl);