diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h index 2f3c9525a45c..7928034f9abb 100644 --- a/lib/libc/regex/regex2.h +++ b/lib/libc/regex/regex2.h @@ -1,4 +1,4 @@ -/* $NetBSD: regex2.h,v 1.7 1998/11/14 16:43:49 christos Exp $ */ +/* $NetBSD: regex2.h,v 1.8 1998/12/08 13:41:42 drochner Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -78,14 +78,15 @@ * immediately *preceding* "execution" of that operator. */ typedef u_int32_t sop; /* strip operator */ -typedef int32_t sopno; +typedef int sopno; #define OPRMASK ((u_int32_t)0xf8000000UL) #define OPDMASK ((u_int32_t)0x07ffffffUL) -#define OPSHIFT ((u_int32_t)27) -#define OPC(n) (((u_int32_t)(n))<> (n)) -#define ISSETBACK(v, n) (((v) & ((u_int32_t)here >> (n))) != 0) +#define FWD(dst, src, n) ((dst) |= ((unsigned long)(src)&(here)) << (n)) +#define BACK(dst, src, n) ((dst) |= ((unsigned long)(src)&(here)) >> (n)) +#define ISSETBACK(v, n) (((v) & ((unsigned long)here >> (n))) != 0) /* function names */ #define SNAMES /* engine.c looks after details */ @@ -127,13 +127,13 @@ __weak_alias(regexec,_regexec); #define ISSET(v, n) ((v)[n]) #define ASSIGN(d, s) memcpy(d, s, (size_t)m->g->nstates) #define EQ(a, b) (memcmp(a, b, (size_t)m->g->nstates) == 0) -#define STATEVARS int32_t vn; char *space -#define STATESETUP(m, nv) { (m)->space = malloc((size_t)((nv)*(m)->g->nstates)); \ +#define STATEVARS int vn; char *space +#define STATESETUP(m, nv) { (m)->space = malloc((size_t)((nv)*(m)->g->nstates)); \ if ((m)->space == NULL) return(REG_ESPACE); \ (m)->vn = 0; } #define STATETEARDOWN(m) { free((m)->space); } #define SETUP(v) ((v) = &m->space[(size_t)(m->vn++ * m->g->nstates)]) -#define onestate int32_t +#define onestate int #define INIT(o, n) ((o) = (n)) #define INC(o) ((o)++) #define ISSTATEIN(v, o) ((v)[o])