+/* $OpenLDAP$ */
+/*
+ * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
/*
* Copyright 1997, 1998, 1999 Computing Research Labs,
* New Mexico State University
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef lint
-static char rcsid[] = "$Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $";
-#endif
+/* $Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $" */
#include "portable.h"
* Build the next symbol so we can test to see if it is already in the
* symbol table.
*/
- (void) memset((char *) &symbol, 0, sizeof(_ure_symtab_t));
+ (void) memset((char *) &symbol, '\0', sizeof(_ure_symtab_t));
*consumed = _ure_compile_symbol(sym, limit, &symbol, b);
/*
realloc((char *) b->symtab,
sizeof(_ure_symtab_t) * (b->symtab_size + 8));
sp = b->symtab + b->symtab_size;
- (void) memset((char *) sp, 0, sizeof(_ure_symtab_t) << 3);
+ (void) memset((char *) sp, '\0', sizeof(_ure_symtab_t) << 3);
b->symtab_size += 8;
}
symbol.id = b->symtab_used++;
- (void) memcpy((char *) &b->symtab[symbol.id], (char *) &symbol,
+ (void) AC_MEMCPY((char *) &b->symtab[symbol.id], (char *) &symbol,
sizeof(_ure_symtab_t));
return symbol.id;
realloc((char *) b->states.states,
sizeof(_ure_state_t) * (b->states.states_size + 8));
sp = b->states.states + b->states.states_size;
- (void) memset((char *) sp, 0, sizeof(_ure_state_t) << 3);
+ (void) memset((char *) sp, '\0', sizeof(_ure_state_t) << 3);
b->states.states_size += 8;
}
sp->st.slist_size = sp->st.slist_used + nstates;
}
sp->st.slist_used = nstates;
- (void) memcpy((char *) sp->st.slist, (char *) states,
+ (void) AC_MEMCPY((char *) sp->st.slist, (char *) states,
sizeof(ucs2_t) * nstates);
}
* Construct the minimal DFA.
*/
dfa = (ure_dfa_t) malloc(sizeof(_ure_dfa_t));
- (void) memset((char *) dfa, 0, sizeof(_ure_dfa_t));
+ (void) memset((char *) dfa, '\0', sizeof(_ure_dfa_t));
dfa->flags = buf->flags & (_URE_DFA_CASEFOLD|_URE_DFA_BLANKLINE);
*/
if (0x10000 <= rp->min_code &&
rp->min_code <= 0x10ffff) {
- h = ((rp->min_code - 0x10000) >> 10) + 0xd800;
- l = ((rp->min_code - 0x10000) & 1023) + 0xdc00;
+ h = (ucs2_t) (((rp->min_code - 0x10000) >> 10) + 0xd800);
+ l = (ucs2_t) (((rp->min_code - 0x10000) & 1023) + 0xdc00);
fprintf(out, "\\x%04hX\\x%04hX", h, l);
} else
fprintf(out, "\\x%04lX", rp->min_code & 0xffff);
putc('-', out);
if (rp->max_code >= 0x10000 &&
rp->max_code <= 0x10ffff) {
- h = ((rp->max_code - 0x10000) >> 10) + 0xd800;
- l = ((rp->max_code - 0x10000) & 1023) + 0xdc00;
+ h = (ucs2_t) (((rp->max_code - 0x10000) >> 10) + 0xd800);
+ l = (ucs2_t) (((rp->max_code - 0x10000) & 1023) + 0xdc00);
fprintf(out, "\\x%04hX\\x%04hX", h, l);
} else
fprintf(out, "\\x%04lX", rp->max_code & 0xffff);
/*
* Take care of UTF16 characters.
*/
- h = ((sym->sym.chr - 0x10000) >> 10) + 0xd800;
- l = ((sym->sym.chr - 0x10000) & 1023) + 0xdc00;
+ h = (ucs2_t) (((sym->sym.chr - 0x10000) >> 10) + 0xd800);
+ l = (ucs2_t) (((sym->sym.chr - 0x10000) & 1023) + 0xdc00);
fprintf(out, "\\x%04hX\\x%04hX ", h, l);
} else
fprintf(out, "\\x%04lX ", sym->sym.chr & 0xffff);