@@ -167,13 +167,14 @@ static int evalcmd(int argc, char **argv, int flags)
*/
int
-evalstring(char *s, int flags)
+evalstring(const char *sc, int flags)
{
union node *n;
+ char *s;
struct stackmark smark;
int status;
- s = sstrdup(s);
+ s = sstrdup(sc);
setinputstring(s);
setstackmark(&smark);
@@ -51,7 +51,7 @@ struct backcmd { /* result of evalbackcmd */
#define EV_EXIT 01 /* exit after evaluating tree */
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
-int evalstring(char *, int);
+int evalstring(const char *, int);
union node; /* BLETCH for ansi C */
int evaltree(union node *, int);
void evalbackcmd(union node *, struct backcmd *);
@@ -770,11 +770,7 @@ typecmd(int argc, char **argv)
}
STATIC int
-describe_command(out, command, path, verbose)
- struct output *out;
- char *command;
- const char *path;
- int verbose;
+describe_command(struct output *out, char *command, const char *path, int verbose)
{
struct cmdentry entry;
struct tblentry *cmdp;
@@ -876,9 +872,7 @@ out:
}
int
-commandcmd(argc, argv)
- int argc;
- char **argv;
+commandcmd(int argc, char **argv)
{
char *cmd;
int c;
@@ -244,9 +244,7 @@ close:
int
-killcmd(argc, argv)
- int argc;
- char **argv;
+killcmd(int argc, char **argv)
{
extern char *signal_names[];
int signo = -1;
@@ -55,7 +55,7 @@ char *progname;
#endif
void
-initialize_signames ()
+initialize_signames (void)
{
register int i;
#if defined (SIGRTMAX) || defined (SIGRTMIN)
@@ -361,8 +361,7 @@ initialize_signames ()
}
void
-write_signames (stream)
- FILE *stream;
+write_signames (FILE *stream)
{
register int i;
@@ -88,8 +88,7 @@ copyfunc(union node *n)
STATIC void
-calcsize(n)
- union node *n;
+calcsize(union node *n)
{
%CALCSIZE
}
@@ -97,8 +96,7 @@ calcsize(n)
STATIC void
-sizenodelist(lp)
- struct nodelist *lp;
+sizenodelist(struct nodelist *lp)
{
while (lp) {
funcblocksize += SHELL_ALIGN(sizeof(struct nodelist));
@@ -110,8 +108,7 @@ sizenodelist(lp)
STATIC union node *
-copynode(n)
- union node *n;
+copynode(union node *n)
{
union node *new;
@@ -121,8 +118,7 @@ copynode(n)
STATIC struct nodelist *
-copynodelist(lp)
- struct nodelist *lp;
+copynodelist(struct nodelist *lp)
{
struct nodelist *start;
struct nodelist **lpp;
@@ -143,8 +139,7 @@ copynodelist(lp)
STATIC char *
-nodesavestr(s)
- char *s;
+nodesavestr(char *s)
{
char *rtn = funcstring;
@@ -390,8 +390,7 @@ setcmd(int argc, char **argv)
void
-getoptsreset(value)
- const char *value;
+getoptsreset(const char *value)
{
shellparam.optind = number(value) ?: 1;
shellparam.optoff = -1;
@@ -282,17 +282,12 @@ ecreate:
STATIC void
+dupredirect(union node *redir, int f
#ifdef notyet
-dupredirect(redir, f, memory)
-#else
-dupredirect(redir, f)
+ , char memory[10]
#endif
- union node *redir;
- int f;
-#ifdef notyet
- char memory[10];
-#endif
- {
+)
+{
int fd = redir->nfile.fd;
int err = 0;
This fixes all warnings with -Wall -Wextra on Clang trunk Also fix a missing const Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> --- Please keep me in CC, as I'm not subscribed src/eval.c | 5 +++-- src/eval.h | 2 +- src/exec.c | 10 ++-------- src/jobs.c | 4 +--- src/mksignames.c | 5 ++--- src/nodes.c.pat | 15 +++++---------- src/options.c | 3 +-- src/redir.c | 13 ++++--------- 8 files changed, 19 insertions(+), 38 deletions(-)