From 2be36617bb6be3f60e44cb636fdb1fa78531d399 Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 17 Apr 2013 17:39:29 +0000 Subject: silence some warnings by adding prototypes, casts, and headers as appropriate. in regex, stop using the struct hack for a fixed size array --- lib/libc/regex/regexec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libc/regex/regexec.c') diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c index 7b3bfc7a0b1..5e986f34c3c 100644 --- a/lib/libc/regex/regexec.c +++ b/lib/libc/regex/regexec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regexec.c,v 1.11 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: regexec.c,v 1.12 2013/04/17 17:39:29 tedu Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -140,6 +140,8 @@ regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { struct re_guts *g = preg->re_g; + char *s = (char *)string; /* XXX fucking gcc XXX */ + #ifdef REDEBUG # define GOODFLAGS(f) (f) #else @@ -154,7 +156,7 @@ regexec(const regex_t *preg, const char *string, size_t nmatch, eflags = GOODFLAGS(eflags); if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(g, (char *)string, nmatch, pmatch, eflags)); + return(smatcher(g, s, nmatch, pmatch, eflags)); else - return(lmatcher(g, (char *)string, nmatch, pmatch, eflags)); + return(lmatcher(g, s, nmatch, pmatch, eflags)); } -- cgit v1.2.3-59-g8ed1b