summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-26 07:12:35 +0000
committermtm <mtm@FreeBSD.org>2008-06-26 07:12:35 +0000
commit2b91fddddae74c8aeb407e90be1ac4d4cb7cde8d (patch)
treec4132339dbd832946ded84008c5a22f30d8b0fab /lib/libc
parent5fecddb79aab07763260a65735440c7c326c203c (diff)
downloadFreeBSD-src-2b91fddddae74c8aeb407e90be1ac4d4cb7cde8d.zip
FreeBSD-src-2b91fddddae74c8aeb407e90be1ac4d4cb7cde8d.tar.gz
Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
and return (const Char *) pointers instead of just (Char *) and get rid of all the type casting. PR: kern/124334
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/glob.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index c75f6ef..32af5db 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -143,7 +143,7 @@ static int compare(const void *, const void *);
static int g_Ctoc(const Char *, char *, size_t);
static int g_lstat(Char *, struct stat *, glob_t *);
static DIR *g_opendir(Char *, glob_t *);
-static Char *g_strchr(Char *, wchar_t);
+static const Char *g_strchr(const Char *, wchar_t);
#ifdef notdef
static Char *g_strcat(Char *, const Char *);
#endif
@@ -246,7 +246,7 @@ globexp1(const Char *pattern, glob_t *pglob, size_t *limit)
if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
return glob0(pattern, pglob, limit);
- while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL)
+ while ((ptr = g_strchr(ptr, LBRACE)) != NULL)
if (!globexp2(ptr, pattern, pglob, &rv, limit))
return rv;
@@ -449,7 +449,7 @@ glob0(const Char *pattern, glob_t *pglob, size_t *limit)
if (c == NOT)
++qpatnext;
if (*qpatnext == EOS ||
- g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) {
+ g_strchr(qpatnext+1, RBRACKET) == NULL) {
*bufnext++ = LBRACKET;
if (c == NOT)
--qpatnext;
@@ -859,8 +859,8 @@ g_stat(Char *fn, struct stat *sb, glob_t *pglob)
return(stat(buf, sb));
}
-static Char *
-g_strchr(Char *str, wchar_t ch)
+static const Char *
+g_strchr(const Char *str, wchar_t ch)
{
do {
OpenPOWER on IntegriCloud