From e785359af3b9cafa11cd88a5b65eae9f4cfd3843 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 25 Sep 2023 23:15:52 +0200 Subject: [PATCH] warning clean up --- src/dir.c | 4 ++-- src/exec.c | 2 +- src/input.c | 3 ++- src/readline.c | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dir.c b/src/dir.c index 8ea0cb3..76e7f78 100644 --- a/src/dir.c +++ b/src/dir.c @@ -418,7 +418,7 @@ void makefilelist(void) { if((s = inviewpath(newpath)) != NULL) { addsrcfile(s); } else { - fprintf(stderr, PROGRAM_NAME, ": cannot find file %s\n", newpath); + fprintf(stderr, PROGRAM_NAME ": cannot find file %s\n", newpath); errorsfound = true; } } @@ -494,7 +494,7 @@ static void scan_dir(const char *adir, bool recurse_dir) { /* see if this is a source file */ static bool issrcfile(char *path) { struct stat statstruct; - char *file = basename(path); + const char *file = basename(path); char *s = strrchr(file, '.'); bool looks_like_source = false; diff --git a/src/exec.c b/src/exec.c index 7da3edf..54834b0 100644 --- a/src/exec.c +++ b/src/exec.c @@ -102,7 +102,7 @@ static int myexecvp(char *a, char **args) { char msg[MSGLEN + 1]; /* modify argv[0] to reference the last component of its path name */ - args[0] = basename(args[0]); + args[0] = (char *)basename(args[0]); /* execute the program or shell script */ execvp(a, args); /* returns only on failure */ diff --git a/src/input.c b/src/input.c index 2833e2f..b32f4b7 100644 --- a/src/input.c +++ b/src/input.c @@ -356,6 +356,7 @@ static int global_input(const int c) { break; case EOF: myexit(0); + break; default: return 0; } @@ -368,7 +369,7 @@ int change_input(const int c) { switch(c) { case '*': /* invert page */ - for(int i = 0; i < (nextline-1); i++) { + for(unsigned i = 0; i < (nextline-1); i++) { change[topref + i] = !change[topref + i]; } window_change |= CH_RESULT; diff --git a/src/readline.c b/src/readline.c index a7b4dfb..9164dd9 100644 --- a/src/readline.c +++ b/src/readline.c @@ -24,7 +24,6 @@ static struct PARTIAL_LINE { static inline void previous_history_proxy(void); static inline void next_history_proxy(void); -static inline int rebuild_reference(void); bool interpret(int c) {