From 065af09cd8006c4763f03c8b7ade158926b9cdde Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 29 Oct 2005 16:23:08 +1000 Subject: Fixed gcc 4.0 compilation problems Removed obsolete extern declaration on funcnest. This conflits with the correct static definition. Changed memtodest prototype to use char * instead of unsigned char *. Perform the unsigned char cast inside memtodest instead. --- ChangeLog | 1 + src/eval.h | 3 --- src/expand.c | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72c9bfd..9d2c17e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ * Use stat if stat64 does not exist. * Added default implementation of bsearch. * Added getpwhome as a wrapper for getpwnam. + * Fixed gcc 4.0 compilation problems. 2005-10-26 Herbert Xu diff --git a/src/eval.h b/src/eval.h index 7e888ff..005620d 100644 --- a/src/eval.h +++ b/src/eval.h @@ -52,9 +52,6 @@ union node; /* BLETCH for ansi C */ void evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); -/* in_function returns nonzero if we are currently evaluating a function */ -#define in_function() funcnest -extern int funcnest; extern int evalskip; /* reasons for skipping commands (see comment on breakcmd routine) */ diff --git a/src/expand.c b/src/expand.c index 7fdc492..c3f1eef 100644 --- a/src/expand.c +++ b/src/expand.c @@ -119,7 +119,7 @@ STATIC void expbackq(union node *, int, int); STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); -STATIC void memtodest(const unsigned char *, size_t, const char *, int); +STATIC void memtodest(const char *, size_t, const char *, int); STATIC ssize_t varvalue(char *, int, int); STATIC void recordregion(int, int, int); STATIC void removerecordregions(int); @@ -882,7 +882,7 @@ end: */ STATIC void -memtodest(const unsigned char *p, size_t len, const char *syntax, int quotes) { +memtodest(const char *p, size_t len, const char *syntax, int quotes) { char *q; if (unlikely(!len)) @@ -891,7 +891,7 @@ memtodest(const unsigned char *p, size_t len, const char *syntax, int quotes) { q = makestrspace(len * 2, expdest); do { - int c = *p++; + int c = (unsigned char)*p++; if (c) { if ((quotes & QUOTES_ESC) && (syntax[c] == CCTL || syntax[c] == CBACK)) -- cgit 1.4.1