diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2004-06-02 22:14:25 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2004-06-02 22:14:25 +0000 |
commit | fb0937a69eb38e744577aa94a6338135f6c1c9b4 (patch) | |
tree | 70c7404736602da0e91710dc3a991e3d2dc5377a | |
parent | 30a139fe894f76ad256281b60a36c693bc561245 (diff) | |
download | zsh-fb0937a69eb38e744577aa94a6338135f6c1c9b4.tar.gz zsh-fb0937a69eb38e744577aa94a6338135f6c1c9b4.tar.xz zsh-fb0937a69eb38e744577aa94a6338135f6c1c9b4.zip |
Marked unused parameters with the new UNUSED() macro.
58 files changed, 641 insertions, 593 deletions
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c index db84d8425..ff66d9594 100644 --- a/Src/Builtins/rlimits.c +++ b/Src/Builtins/rlimits.c @@ -289,7 +289,7 @@ printulimit(int lim, int hard, int head) /**/ static int -bin_limit(char *nam, char **argv, Options ops, int func) +bin_limit(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func)) { char *s; int hard, limnum, lim; @@ -397,7 +397,7 @@ bin_limit(char *nam, char **argv, Options ops, int func) /**/ static int -bin_unlimit(char *nam, char **argv, Options ops, int func) +bin_unlimit(char *nam, char **argv, Options ops, UNUSED(int func)) { int hard, limnum, lim; int ret = 0; @@ -460,7 +460,7 @@ bin_unlimit(char *nam, char **argv, Options ops, int func) /**/ static int -bin_ulimit(char *name, char **argv, Options ops, int func) +bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { int res, resmask = 0, hard = 0, soft = 0, nres = 0, all = 0; char *options; @@ -668,7 +668,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -690,7 +690,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Builtins/sched.c b/Src/Builtins/sched.c index 8bc9b2c8a..0c96b76b2 100644 --- a/Src/Builtins/sched.c +++ b/Src/Builtins/sched.c @@ -46,7 +46,7 @@ static struct schedcmd *schedcmds; /**/ static int -bin_sched(char *nam, char **argv, Options ops, int func) +bin_sched(UNUSED(char *nam), char **argv, UNUSED(Options ops), UNUSED(int func)) { char *s = *argv++; time_t t; @@ -183,7 +183,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -216,7 +216,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/cap.c b/Src/Modules/cap.c index ba377f876..4ef8d9cb3 100644 --- a/Src/Modules/cap.c +++ b/Src/Modules/cap.c @@ -124,7 +124,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -146,7 +146,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c index bb2240d49..60a21182b 100644 --- a/Src/Modules/clone.c +++ b/Src/Modules/clone.c @@ -41,7 +41,7 @@ /**/ static int -bin_clone(char *nam, char **args, Options ops, int func) +bin_clone(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int ttyfd, pid, cttyfd; @@ -111,7 +111,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -133,7 +133,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index d90791620..209675e5a 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -32,7 +32,7 @@ #include <time.h> static int -bin_strftime(char *nam, char **argv, Options ops, int func) +bin_strftime(char *nam, char **argv, Options ops, UNUSED(int func)) { int bufsize, x; char *endptr = NULL, *scalar = NULL, *buffer; @@ -93,7 +93,7 @@ static struct paramdef patab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -124,7 +124,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/example.c b/Src/Modules/example.c index 793d743fc..ab3a70592 100644 --- a/Src/Modules/example.c +++ b/Src/Modules/example.c @@ -39,7 +39,7 @@ static char **arrparam; /**/ static int -bin_example(char *nam, char **args, Options ops, int func) +bin_example(char *nam, char **args, Options ops, UNUSED(int func)) { unsigned char c; char **oargs = args, **p = arrparam; @@ -76,7 +76,7 @@ bin_example(char *nam, char **args, Options ops, int func) /**/ static int -cond_p_len(char **a, int id) +cond_p_len(char **a, UNUSED(int id)) { char *s1 = cond_str(a, 0, 0); @@ -91,7 +91,7 @@ cond_p_len(char **a, int id) /**/ static int -cond_i_ex(char **a, int id) +cond_i_ex(char **a, UNUSED(int id)) { char *s1 = cond_str(a, 0, 0), *s2 = cond_str(a, 1, 0); @@ -100,7 +100,7 @@ cond_i_ex(char **a, int id) /**/ static mnumber -math_sum(char *name, int argc, mnumber *argv, int id) +math_sum(UNUSED(char *name), int argc, mnumber *argv, UNUSED(int id)) { mnumber ret; int f = 0; @@ -129,7 +129,7 @@ math_sum(char *name, int argc, mnumber *argv, int id) /**/ static mnumber -math_length(char *name, char *arg, int id) +math_length(UNUSED(char *name), char *arg, UNUSED(int id)) { mnumber ret; @@ -186,7 +186,7 @@ static struct funcwrap wrapper[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { printf("The example module has now been set up.\n"); fflush(stdout); @@ -224,7 +224,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { printf("Thank you for using the example module. Have a nice day.\n"); fflush(stdout); diff --git a/Src/Modules/files.c b/Src/Modules/files.c index 82429a986..30ed32103 100644 --- a/Src/Modules/files.c +++ b/Src/Modules/files.c @@ -56,7 +56,7 @@ ask(void) /**/ static int -bin_sync(char *nam, char **args, Options ops, int func) +bin_sync(UNUSED(char *nam), UNUSED(char **args), UNUSED(Options ops), UNUSED(int func)) { sync(); return 0; @@ -66,7 +66,7 @@ bin_sync(char *nam, char **args, Options ops, int func) /**/ static int -bin_mkdir(char *nam, char **args, Options ops, int func) +bin_mkdir(char *nam, char **args, Options ops, UNUSED(int func)) { mode_t oumask = umask(0); mode_t mode = 0777 & ~oumask; @@ -143,7 +143,7 @@ domkdir(char *nam, char *path, mode_t mode, int p) /**/ static int -bin_rmdir(char *nam, char **args, Options ops, int func) +bin_rmdir(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int err = 0; @@ -477,7 +477,7 @@ recursivecmd_dorec(struct recursivecmd const *reccmd, /**/ static int -recurse_donothing(char *arg, char *rp, struct stat const *sp, void *magic) +recurse_donothing(UNUSED(char *arg), UNUSED(char *rp), UNUSED(struct stat const *sp), UNUSED(void *magic)) { return 0; } @@ -541,7 +541,7 @@ rm_leaf(char *arg, char *rp, struct stat const *sp, void *magic) /**/ static int -rm_dirpost(char *arg, char *rp, struct stat const *sp, void *magic) +rm_dirpost(char *arg, char *rp, UNUSED(struct stat const *sp), void *magic) { struct rmmagic *rmm = magic; @@ -563,7 +563,7 @@ rm_dirpost(char *arg, char *rp, struct stat const *sp, void *magic) /**/ static int -bin_rm(char *nam, char **args, Options ops, int func) +bin_rm(char *nam, char **args, Options ops, UNUSED(int func)) { struct rmmagic rmm; int err; @@ -589,7 +589,7 @@ struct chownmagic { /**/ static int -chown_dochown(char *arg, char *rp, struct stat const *sp, void *magic) +chown_dochown(char *arg, char *rp, UNUSED(struct stat const *sp), void *magic) { struct chownmagic *chm = magic; @@ -708,7 +708,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -730,7 +730,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/langinfo.c b/Src/Modules/langinfo.c index 66d0228aa..677440f52 100644 --- a/Src/Modules/langinfo.c +++ b/Src/Modules/langinfo.c @@ -439,7 +439,7 @@ createlihash() /**/ static HashNode -getlanginfo(HashTable ht, char *name) +getlanginfo(UNUSED(HashTable ht), char *name) { int len, *elem; char *listr; @@ -480,7 +480,7 @@ getlanginfo(HashTable ht, char *name) /**/ static void -scanlanginfo(HashTable ht, ScanFunc func, int flags) +scanlanginfo(UNUSED(HashTable ht), ScanFunc func, int flags) { Param pm = NULL; char **element, *langstr; @@ -515,14 +515,14 @@ scanlanginfo(HashTable ht, ScanFunc func, int flags) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { #ifdef HAVE_NL_LANGINFO if (!createlihash()) @@ -535,7 +535,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { #ifdef HAVE_NL_LANGINFO Param pm; @@ -551,7 +551,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/mapfile.c b/Src/Modules/mapfile.c index 586e4a24e..66e311c63 100644 --- a/Src/Modules/mapfile.c +++ b/Src/Modules/mapfile.c @@ -171,7 +171,7 @@ setpmmapfile(Param pm, char *value) /**/ static void -unsetpmmapfile(Param pm, int exp) +unsetpmmapfile(Param pm, UNUSED(int exp)) { /* Unlink the file given by pm->nam */ char *fname = ztrdup(pm->nam); @@ -259,7 +259,7 @@ get_contents(char *fname) /**/ static HashNode -getpmmapfile(HashTable ht, char *name) +getpmmapfile(UNUSED(HashTable ht), char *name) { char *contents; Param pm = NULL; @@ -290,7 +290,7 @@ getpmmapfile(HashTable ht, char *name) /**/ static void -scanpmmapfile(HashTable ht, ScanFunc func, int flags) +scanpmmapfile(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; DIR *dir; @@ -327,14 +327,14 @@ scanpmmapfile(HashTable ht, ScanFunc func, int flags) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { /* Create the special associative array. */ @@ -346,7 +346,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { Param pm; @@ -362,7 +362,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/mathfunc.c b/Src/Modules/mathfunc.c index af4366420..691755683 100644 --- a/Src/Modules/mathfunc.c +++ b/Src/Modules/mathfunc.c @@ -462,7 +462,7 @@ math_func(char *name, int argc, mnumber *argv, int id) /**/ static mnumber -math_string(char *name, char *arg, int id) +math_string(UNUSED(char *name), char *arg, int id) { mnumber ret = zero_mnumber; char *send; @@ -556,7 +556,7 @@ math_string(char *name, char *arg, int id) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -578,7 +578,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c index 5a09bd23c..01737ca27 100644 --- a/Src/Modules/parameter.c +++ b/Src/Modules/parameter.c @@ -136,7 +136,7 @@ paramtypestr(Param pm) /**/ static HashNode -getpmparameter(HashTable ht, char *name) +getpmparameter(UNUSED(HashTable ht), char *name) { Param rpm, pm = NULL; @@ -163,7 +163,7 @@ getpmparameter(HashTable ht, char *name) /**/ static void -scanpmparameters(HashTable ht, ScanFunc func, int flags) +scanpmparameters(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -213,7 +213,7 @@ setpmcommand(Param pm, char *value) /**/ static void -unsetpmcommand(Param pm, int exp) +unsetpmcommand(Param pm, UNUSED(int exp)) { HashNode hn = cmdnamtab->removenode(cmdnamtab, pm->nam); @@ -223,7 +223,7 @@ unsetpmcommand(Param pm, int exp) /**/ static void -setpmcommands(Param pm, HashTable ht) +setpmcommands(UNUSED(Param pm), HashTable ht) { int i; HashNode hn; @@ -251,7 +251,7 @@ setpmcommands(Param pm, HashTable ht) /**/ static HashNode -getpmcommand(HashTable ht, char *name) +getpmcommand(UNUSED(HashTable ht), char *name) { Cmdnam cmd; Param pm = NULL; @@ -290,7 +290,7 @@ getpmcommand(HashTable ht, char *name) /**/ static void -scanpmcommands(HashTable ht, ScanFunc func, int flags) +scanpmcommands(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -385,7 +385,7 @@ setpmdisfunction(Param pm, char *value) /**/ static void -unsetpmfunction(Param pm, int exp) +unsetpmfunction(Param pm, UNUSED(int exp)) { HashNode hn = shfunctab->removenode(shfunctab, pm->nam); @@ -395,7 +395,7 @@ unsetpmfunction(Param pm, int exp) /**/ static void -setfunctions(Param pm, HashTable ht, int dis) +setfunctions(UNUSED(Param pm), HashTable ht, int dis) { int i; HashNode hn; @@ -433,7 +433,7 @@ setpmdisfunctions(Param pm, HashTable ht) /**/ static HashNode -getfunction(HashTable ht, char *name, int dis) +getfunction(UNUSED(HashTable ht), char *name, int dis) { Shfunc shf; Param pm = NULL; @@ -498,7 +498,7 @@ getpmdisfunction(HashTable ht, char *name) /**/ static void -scanfunctions(HashTable ht, ScanFunc func, int flags, int dis) +scanfunctions(UNUSED(HashTable ht), ScanFunc func, int flags, int dis) { struct param pm; int i; @@ -568,7 +568,7 @@ scanpmdisfunctions(HashTable ht, ScanFunc func, int flags) /**/ static char ** -funcstackgetfn(Param pm) +funcstackgetfn(UNUSED(Param pm)) { Funcstack f; int num; @@ -589,7 +589,7 @@ funcstackgetfn(Param pm) /**/ static HashNode -getbuiltin(HashTable ht, char *name, int dis) +getbuiltin(UNUSED(HashTable ht), char *name, int dis) { Param pm = NULL; Builtin bn; @@ -634,7 +634,7 @@ getpmdisbuiltin(HashTable ht, char *name) /**/ static void -scanbuiltins(HashTable ht, ScanFunc func, int flags, int dis) +scanbuiltins(UNUSED(HashTable ht), ScanFunc func, int flags, int dis) { struct param pm; int i; @@ -705,14 +705,14 @@ getreswords(int dis) /**/ static char ** -reswordsgetfn(Param pm) +reswordsgetfn(UNUSED(Param pm)) { return getreswords(0); } /**/ static char ** -disreswordsgetfn(Param pm) +disreswordsgetfn(UNUSED(Param pm)) { return getreswords(DISABLED); } @@ -736,7 +736,7 @@ setpmoption(Param pm, char *value) /**/ static void -unsetpmoption(Param pm, int exp) +unsetpmoption(Param pm, UNUSED(int exp)) { int n; @@ -748,7 +748,7 @@ unsetpmoption(Param pm, int exp) /**/ static void -setpmoptions(Param pm, HashTable ht) +setpmoptions(UNUSED(Param pm), HashTable ht) { int i; HashNode hn; @@ -778,7 +778,7 @@ setpmoptions(Param pm, HashTable ht) /**/ static HashNode -getpmoption(HashTable ht, char *name) +getpmoption(UNUSED(HashTable ht), char *name) { Param pm = NULL; int n; @@ -813,7 +813,7 @@ getpmoption(HashTable ht, char *name) /**/ static void -scanpmoptions(HashTable ht, ScanFunc func, int flags) +scanpmoptions(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -846,7 +846,7 @@ static int modpmfound; /**/ static void -modpmbuiltinscan(HashNode hn, int dummy) +modpmbuiltinscan(HashNode hn, UNUSED(int dummy)) { if (!(((Builtin) hn)->flags & BINF_ADDED) && !strcmp(((Builtin) hn)->optstr, modpmname)) @@ -855,7 +855,7 @@ modpmbuiltinscan(HashNode hn, int dummy) /**/ static void -modpmparamscan(HashNode hn, int dummy) +modpmparamscan(HashNode hn, UNUSED(int dummy)) { if ((((Param) hn)->flags & PM_AUTOLOAD) && !strcmp(((Param) hn)->u.str, modpmname)) @@ -877,7 +877,7 @@ findmodnode(LinkList l, char *nam) /**/ static HashNode -getpmmodule(HashTable ht, char *name) +getpmmodule(UNUSED(HashTable ht), char *name) { Param pm = NULL; char *type = NULL; @@ -937,7 +937,7 @@ getpmmodule(HashTable ht, char *name) /**/ static void -scanpmmodules(HashTable ht, ScanFunc func, int flags) +scanpmmodules(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -999,7 +999,7 @@ scanpmmodules(HashTable ht, ScanFunc func, int flags) /**/ static void -dirssetfn(Param pm, char **x) +dirssetfn(UNUSED(Param pm), char **x) { char **ox = x; @@ -1015,7 +1015,7 @@ dirssetfn(Param pm, char **x) /**/ static char ** -dirsgetfn(Param pm) +dirsgetfn(UNUSED(Param pm)) { int l = countlinknodes(dirstack); char **ret = (char **) zhalloc((l + 1) * sizeof(char *)), **p; @@ -1032,7 +1032,7 @@ dirsgetfn(Param pm) /**/ static HashNode -getpmhistory(HashTable ht, char *name) +getpmhistory(UNUSED(HashTable ht), char *name) { Param pm = NULL; Histent he; @@ -1071,7 +1071,7 @@ getpmhistory(HashTable ht, char *name) /**/ static void -scanpmhistory(HashTable ht, ScanFunc func, int flags) +scanpmhistory(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i = addhistnum(curhist, -1, HIST_FOREIGN); @@ -1106,7 +1106,7 @@ scanpmhistory(HashTable ht, ScanFunc func, int flags) /**/ static char ** -histwgetfn(Param pm) +histwgetfn(UNUSED(Param pm)) { char **ret, **p, *h, *e, sav; LinkList l = newlinklist(), ll; @@ -1164,7 +1164,7 @@ pmjobtext(int job) /**/ static HashNode -getpmjobtext(HashTable ht, char *name) +getpmjobtext(UNUSED(HashTable ht), char *name) { Param pm = NULL; int job; @@ -1194,7 +1194,7 @@ getpmjobtext(HashTable ht, char *name) /**/ static void -scanpmjobtexts(HashTable ht, ScanFunc func, int flags) +scanpmjobtexts(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int job; @@ -1274,7 +1274,7 @@ pmjobstate(int job) /**/ static HashNode -getpmjobstate(HashTable ht, char *name) +getpmjobstate(UNUSED(HashTable ht), char *name) { Param pm = NULL; int job; @@ -1304,7 +1304,7 @@ getpmjobstate(HashTable ht, char *name) /**/ static void -scanpmjobstates(HashTable ht, ScanFunc func, int flags) +scanpmjobstates(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int job; @@ -1349,7 +1349,7 @@ pmjobdir(int job) /**/ static HashNode -getpmjobdir(HashTable ht, char *name) +getpmjobdir(UNUSED(HashTable ht), char *name) { Param pm = NULL; int job; @@ -1379,7 +1379,7 @@ getpmjobdir(HashTable ht, char *name) /**/ static void -scanpmjobdirs(HashTable ht, ScanFunc func, int flags) +scanpmjobdirs(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int job; @@ -1429,7 +1429,7 @@ setpmnameddir(Param pm, char *value) /**/ static void -unsetpmnameddir(Param pm, int exp) +unsetpmnameddir(Param pm, UNUSED(int exp)) { HashNode hd = nameddirtab->removenode(nameddirtab, pm->nam); @@ -1439,7 +1439,7 @@ unsetpmnameddir(Param pm, int exp) /**/ static void -setpmnameddirs(Param pm, HashTable ht) +setpmnameddirs(UNUSED(Param pm), HashTable ht) { int i; HashNode hn, next, hd; @@ -1487,7 +1487,7 @@ setpmnameddirs(Param pm, HashTable ht) /**/ static HashNode -getpmnameddir(HashTable ht, char *name) +getpmnameddir(UNUSED(HashTable ht), char *name) { Param pm = NULL; Nameddir nd; @@ -1515,7 +1515,7 @@ getpmnameddir(HashTable ht, char *name) /**/ static void -scanpmnameddirs(HashTable ht, ScanFunc func, int flags) +scanpmnameddirs(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -1549,7 +1549,7 @@ scanpmnameddirs(HashTable ht, ScanFunc func, int flags) /**/ static HashNode -getpmuserdir(HashTable ht, char *name) +getpmuserdir(UNUSED(HashTable ht), char *name) { Param pm = NULL; Nameddir nd; @@ -1579,7 +1579,7 @@ getpmuserdir(HashTable ht, char *name) /**/ static void -scanpmuserdirs(HashTable ht, ScanFunc func, int flags) +scanpmuserdirs(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -1665,7 +1665,7 @@ setpmdissalias(Param pm, char *value) /**/ static void -unsetpmalias(Param pm, int exp) +unsetpmalias(Param pm, UNUSED(int exp)) { HashNode hd = aliastab->removenode(aliastab, pm->nam); @@ -1675,7 +1675,7 @@ unsetpmalias(Param pm, int exp) /**/ static void -unsetpmsalias(Param pm, int exp) +unsetpmsalias(Param pm, UNUSED(int exp)) { HashNode hd = sufaliastab->removenode(sufaliastab, pm->nam); @@ -1685,7 +1685,7 @@ unsetpmsalias(Param pm, int exp) /**/ static void -setaliases(HashTable alht, Param pm, HashTable ht, int flags) +setaliases(HashTable alht, UNUSED(Param pm), HashTable ht, int flags) { int i; HashNode hn, next, hd; @@ -1813,7 +1813,7 @@ assignaliasdefs(Param pm, int flags) /**/ static HashNode -getalias(HashTable alht, HashTable ht, char *name, int flags) +getalias(HashTable alht, UNUSED(HashTable ht), char *name, int flags) { Param pm = NULL; Alias al; @@ -1877,7 +1877,7 @@ getpmdissalias(HashTable ht, char *name) /**/ static void -scanaliases(HashTable alht, HashTable ht, ScanFunc func, +scanaliases(HashTable alht, UNUSED(HashTable ht), ScanFunc func, int pmflags, int alflags) { struct param pm; @@ -2036,7 +2036,7 @@ static struct pardef partab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { incleanup = 0; @@ -2045,7 +2045,7 @@ setup_(Module m) /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { /* Create the special associative arrays. * As an example for autoloaded parameters, this is probably a bad @@ -2078,7 +2078,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { Param pm; struct pardef *def; @@ -2097,7 +2097,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/socket.c b/Src/Modules/socket.c index ace990ab4..5339e72b7 100644 --- a/Src/Modules/socket.c +++ b/Src/Modules/socket.c @@ -58,7 +58,7 @@ #endif static int -bin_zsocket(char *nam, char **args, Options ops, int func) +bin_zsocket(char *nam, char **args, Options ops, UNUSED(int func)) { int err=1, verbose=0, test=0, targetfd=0; SOCKLEN_T len; @@ -254,7 +254,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -277,7 +277,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c index 162612ee9..29a4099d6 100644 --- a/Src/Modules/stat.c +++ b/Src/Modules/stat.c @@ -341,7 +341,7 @@ statprint(struct stat *sbuf, char *outbuf, char *fname, int iwhich, int flags) */ /**/ static int -bin_stat(char *name, char **args, Options ops, int func) +bin_stat(char *name, char **args, Options ops, UNUSED(int func)) { char **aptr, *arrnam = NULL, **array = NULL, **arrptr = NULL; char *hashnam = NULL, **hash = NULL, **hashptr = NULL; @@ -615,7 +615,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -637,7 +637,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/system.c b/Src/Modules/system.c index 91811ae79..f292c1924 100644 --- a/Src/Modules/system.c +++ b/Src/Modules/system.c @@ -68,7 +68,7 @@ getposint(char *instr, char *nam) /**/ static int -bin_sysread(char *nam, char **args, Options ops, int func) +bin_sysread(char *nam, char **args, Options ops, UNUSED(int func)) { int infd = 0, outfd = -1, bufsize = SYSREAD_BUFSIZE, count; char *outvar = NULL, *countvar = NULL, *inbuf; @@ -236,7 +236,7 @@ bin_sysread(char *nam, char **args, Options ops, int func) /**/ static int -bin_syswrite(char *nam, char **args, Options ops, int func) +bin_syswrite(char *nam, char **args, Options ops, UNUSED(int func)) { int outfd = 1, len, count, totcount; char *countvar = NULL; @@ -290,7 +290,7 @@ bin_syswrite(char *nam, char **args, Options ops, int func) /**/ static int -bin_syserror(char *nam, char **args, Options ops, int func) +bin_syserror(char *nam, char **args, Options ops, UNUSED(int func)) { int num = 0; char *errvar = NULL, *msg, *pfx = "", *str; @@ -345,7 +345,7 @@ bin_syserror(char *nam, char **args, Options ops, int func) /**/ static char ** -errnosgetfn(Param pm) +errnosgetfn(UNUSED(Param pm)) { /* arrdup etc. should really take const pointers as arguments */ return arrdup((char **)sys_errnames); @@ -363,7 +363,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -414,7 +414,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index 453f7bf21..586c2a19e 100644 --- a/Src/Modules/tcp.c +++ b/Src/Modules/tcp.c @@ -167,7 +167,7 @@ zsh_gethostbyname2(char const *name, int af) /**/ mod_export struct hostent * -zsh_getipnodebyname(char const *name, int af, int flags, int *errorp) +zsh_getipnodebyname(char const *name, int af, UNUSED(int flags), int *errorp) { static struct hostent ahe; static char nbuf[16]; @@ -195,7 +195,7 @@ zsh_getipnodebyname(char const *name, int af, int flags, int *errorp) /**/ mod_export void -freehostent(struct hostent *ptr) +freehostent(UNUSED(struct hostent *ptr)) { } @@ -337,7 +337,7 @@ tcp_connect(Tcp_session sess, char *addrp, struct hostent *zhost, int d_port) } static int -bin_ztcp(char *nam, char **args, Options ops, int func) +bin_ztcp(char *nam, char **args, Options ops, UNUSED(int func)) { int herrno, err=1, destport, force=0, verbose=0, test=0, targetfd=0; SOCKLEN_T len; @@ -680,7 +680,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -706,7 +706,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c index 3b1e6e1e6..a74a0538e 100644 --- a/Src/Modules/termcap.c +++ b/Src/Modules/termcap.c @@ -103,7 +103,7 @@ ztgetflag(char *s) /**/ static int -bin_echotc(char *name, char **argv, Options ops, int func) +bin_echotc(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { char *s, buf[2048], *t, *u; int num, argct; @@ -219,7 +219,7 @@ createtchash() /**/ static HashNode -gettermcap(HashTable ht, char *name) +gettermcap(UNUSED(HashTable ht), char *name) { int len, num; char *tcstr, buf[2048], *u; @@ -284,7 +284,7 @@ gettermcap(HashTable ht, char *name) /**/ static void -scantermcap(HashTable ht, ScanFunc func, int flags) +scantermcap(UNUSED(HashTable ht), ScanFunc func, int flags) { Param pm = NULL; int num; @@ -389,7 +389,7 @@ scantermcap(HashTable ht, ScanFunc func, int flags) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -430,7 +430,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/terminfo.c b/Src/Modules/terminfo.c index 8b0ac6307..6e9e32588 100644 --- a/Src/Modules/terminfo.c +++ b/Src/Modules/terminfo.c @@ -61,7 +61,7 @@ static Param terminfo_pm; /**/ static int -bin_echoti(char *name, char **argv, Options ops, int func) +bin_echoti(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { char *s, *t, **u; int arg, num, strarg = 0; @@ -187,7 +187,7 @@ createtihash() /**/ static HashNode -getterminfo(HashTable ht, char *name) +getterminfo(UNUSED(HashTable ht), char *name) { int len, num; char *tistr; @@ -243,7 +243,7 @@ getterminfo(HashTable ht, char *name) /**/ static void -scanterminfo(HashTable ht, ScanFunc func, int flags) +scanterminfo(UNUSED(HashTable ht), ScanFunc func, int flags) { Param pm = NULL; int num; @@ -369,7 +369,7 @@ scanterminfo(HashTable ht, ScanFunc func, int flags) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -413,7 +413,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index e4c5a9703..a36b6bf3e 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -2068,7 +2068,7 @@ zfgetinfo(char *prompt, int noecho) /**/ static int -zftp_params(char *name, char **args, int flags) +zftp_params(UNUSED(char *name), char **args, UNUSED(int flags)) { char *prompts[] = { "Host: ", "User: ", "Password: ", "Account: " }; char **aptr, **newarr; @@ -2122,7 +2122,7 @@ zftp_params(char *name, char **args, int flags) /**/ static int -zftp_login(char *name, char **args, int flags) +zftp_login(char *name, char **args, UNUSED(int flags)) { char *ucmd, *passwd = NULL, *acct = NULL; char *user, tbuf[2] = "X"; @@ -2255,7 +2255,7 @@ zftp_login(char *name, char **args, int flags) /**/ static int -zftp_test(char *name, char **args, int flags) +zftp_test(UNUSED(char *name), UNUSED(char **args), UNUSED(int flags)) { #if defined(HAVE_POLL) || defined(HAVE_SELECT) int ret; @@ -2336,7 +2336,7 @@ zftp_dir(char *name, char **args, int flags) /**/ static int -zftp_cd(char *name, char **args, int flags) +zftp_cd(UNUSED(char *name), char **args, int flags) { /* change directory --- enhance to allow 'zftp cdup' */ int ret; @@ -2468,7 +2468,7 @@ zftp_type(char *name, char **args, int flags) /**/ static int -zftp_mode(char *name, char **args, int flags) +zftp_mode(char *name, char **args, UNUSED(int flags)) { char *str, cmd[] = "MODE X\r\n"; int nt; @@ -2495,7 +2495,7 @@ zftp_mode(char *name, char **args, int flags) /**/ static int -zftp_local(char *name, char **args, int flags) +zftp_local(UNUSED(char *name), char **args, int flags) { int more = !!args[1], ret = 0, dofd = !*args; while (*args || dofd) { @@ -2638,7 +2638,7 @@ zftp_getput(char *name, char **args, int flags) /**/ static int -zftp_delete(char *name, char **args, int flags) +zftp_delete(UNUSED(char *name), char **args, UNUSED(int flags)) { int ret = 0; char *cmd, **aptr; @@ -2655,7 +2655,7 @@ zftp_delete(char *name, char **args, int flags) /**/ static int -zftp_mkdir(char *name, char **args, int flags) +zftp_mkdir(UNUSED(char *name), char **args, int flags) { int ret; char *cmd = tricat((flags & ZFTP_DELE) ? "RMD " : "MKD ", @@ -2669,7 +2669,7 @@ zftp_mkdir(char *name, char **args, int flags) /**/ static int -zftp_rename(char *name, char **args, int flags) +zftp_rename(UNUSED(char *name), char **args, UNUSED(int flags)) { int ret; char *cmd; @@ -2693,7 +2693,7 @@ zftp_rename(char *name, char **args, int flags) /**/ static int -zftp_quote(char *name, char **args, int flags) +zftp_quote(UNUSED(char *name), char **args, int flags) { int ret = 0; char *cmd; @@ -2785,7 +2785,7 @@ zfclose(int leaveparams) /**/ static int -zftp_close(char *name, char **args, int flags) +zftp_close(UNUSED(char *name), UNUSED(char **args), UNUSED(int flags)) { zfclose(0); return 0; @@ -2892,7 +2892,7 @@ freesession(Zftp_session sptr) /**/ static int -zftp_session(char *name, char **args, int flags) +zftp_session(UNUSED(char *name), char **args, UNUSED(int flags)) { if (!*args) { LinkNode nptr; @@ -2918,7 +2918,7 @@ zftp_session(char *name, char **args, int flags) /**/ static int -zftp_rmsession(char *name, char **args, int flags) +zftp_rmsession(UNUSED(char *name), char **args, UNUSED(int flags)) { int no; LinkNode nptr; @@ -3005,7 +3005,7 @@ zftp_rmsession(char *name, char **args, int flags) /**/ static int -bin_zftp(char *name, char **args, Options ops, int func) +bin_zftp(char *name, char **args, UNUSED(Options ops), UNUSED(int func)) { char fullname[20] = "zftp "; char *cnam = *args++, *prefs, *ptr; @@ -3157,7 +3157,7 @@ zftp_cleanup(void) } static int -zftpexithook(Hookdef d, void *dummy) +zftpexithook(UNUSED(Hookdef d), UNUSED(void *dummy)) { zftp_cleanup(); return 0; @@ -3167,7 +3167,7 @@ zftpexithook(Hookdef d, void *dummy) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { /* setup_ returns 0 for success. require_module returns 1 for success. */ return !require_module("", "zsh/net/tcp", 0, 0); @@ -3175,7 +3175,7 @@ setup_(Module m) /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { int ret; if ((ret = addbuiltins("zftp", bintab, @@ -3199,7 +3199,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { deletehookfunc("exit", zftpexithook); zftp_cleanup(); @@ -3208,7 +3208,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/zprof.c b/Src/Modules/zprof.c index 3121efacf..ca053a9e9 100644 --- a/Src/Modules/zprof.c +++ b/Src/Modules/zprof.c @@ -136,7 +136,7 @@ cmpparcs(Parc *a, Parc *b) } static int -bin_zprof(char *nam, char **args, Options ops, int func) +bin_zprof(UNUSED(char *nam), UNUSED(char **args), Options ops, UNUSED(int func)) { if (OPT_ISSET(ops,'c')) { freepfuncs(calls); @@ -329,7 +329,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index 360d1cc63..fce09a02a 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -622,7 +622,7 @@ ptywrite(Ptycmd cmd, char **args, int nonl) /**/ static int -bin_zpty(char *nam, char **args, Options ops, int func) +bin_zpty(char *nam, char **args, Options ops, UNUSED(int func)) { if ((OPT_ISSET(ops,'r') && OPT_ISSET(ops,'w')) || ((OPT_ISSET(ops,'r') || OPT_ISSET(ops,'w')) && @@ -721,7 +721,7 @@ bin_zpty(char *nam, char **args, Options ops, int func) } static int -ptyhook(Hookdef d, void *dummy) +ptyhook(UNUSED(Hookdef d), UNUSED(void *dummy)) { deleteallptycmds(); return 0; @@ -733,7 +733,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -760,7 +760,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/zselect.c b/Src/Modules/zselect.c index 1e6753263..ea7396e30 100644 --- a/Src/Modules/zselect.c +++ b/Src/Modules/zselect.c @@ -62,7 +62,7 @@ handle_digits(char *nam, char *argptr, fd_set *fdset, int *fdmax) /**/ static int -bin_zselect(char *nam, char **args, Options ops, int func) +bin_zselect(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { #ifdef HAVE_SELECT int i, fd, fdsetind = 0, fdmax = 0, fdcount; @@ -278,7 +278,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -293,7 +293,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { deletebuiltins("zselect", bintab, sizeof(bintab)/sizeof(*bintab)); return 0; @@ -301,7 +301,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c index 57a368aab..9b81ba92e 100644 --- a/Src/Modules/zutil.c +++ b/Src/Modules/zutil.c @@ -254,7 +254,7 @@ lookupstyle(char *ctxt, char *style) } static int -bin_zstyle(char *nam, char **args, Options ops, int func) +bin_zstyle(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int min, max, n, add = 0, list = 0, eval = 0; @@ -692,7 +692,7 @@ static char *zformat_substring(char* instr, char **specs, char **outp, } static int -bin_zformat(char *nam, char **args, Options ops, int func) +bin_zformat(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { char opt; @@ -1232,7 +1232,7 @@ rmatch(RParseResult *sm, char *subj, char *var1, char *var2, int comp) */ static int -bin_zregexparse(char *nam, char **args, Options ops, int func) +bin_zregexparse(char *nam, char **args, Options ops, UNUSED(int func)) { int oldextendedglob = opts[EXTENDEDGLOB]; char *var1 = args[0]; @@ -1386,7 +1386,7 @@ add_opt_val(Zoptdesc d, char *arg) } static int -bin_zparseopts(char *nam, char **args, Options ops, int func) +bin_zparseopts(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { char *o, *p, *n, **pp, **aval, **ap, *assoc = NULL, **cp, **np; int del = 0, f, extract = 0, keep = 0; @@ -1687,7 +1687,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { zstyles = zlstyles = NULL; @@ -1711,7 +1711,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { freeallstyles(); diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index b0411651f..cf821197b 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -285,7 +285,7 @@ mod_export int lastend; /**/ int -do_completion(Hookdef dummy, Compldat dat) +do_completion(UNUSED(Hookdef dummy), Compldat dat) { int ret = 0, lst = dat->lst, incmd = dat->incmd, osl = showinglist; char *s = dat->s; @@ -444,7 +444,7 @@ static int oldmenucmp; /**/ int -before_complete(Hookdef dummy, int *lst) +before_complete(UNUSED(Hookdef dummy), int *lst) { oldmenucmp = menucmp; @@ -483,7 +483,7 @@ before_complete(Hookdef dummy, int *lst) /**/ int -after_complete(Hookdef dummy, int *dat) +after_complete(UNUSED(Hookdef dummy), int *dat) { if (menucmp && !oldmenucmp) { struct chdata cdat; diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 9023dbd69..689d28a30 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -1572,7 +1572,7 @@ printcompctlp(HashNode hn, int printflags) /**/ static int -bin_compctl(char *name, char **argv, Options ops, int func) +bin_compctl(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { Compctl cc = NULL; int ret = 0; @@ -1678,7 +1678,7 @@ bin_compctl(char *name, char **argv, Options ops, int func) #define CFN_DEFAULT 2 static int -bin_compcall(char *name, char **argv, Options ops, int func) +bin_compcall(char *name, UNUSED(char **argv), Options ops, UNUSED(int func)) { if (incompfunc != 1) { zwarnnam(name, "can only be called from completion function", NULL, 0); @@ -1755,7 +1755,7 @@ static int addwhat; /* Hook functions */ static int -ccmakehookfn(Hookdef dummy, struct ccmakedat *dat) +ccmakehookfn(UNUSED(Hookdef dummy), struct ccmakedat *dat) { char *s = dat->str; int incmd = dat->incmd, lst = dat->lst; @@ -1891,7 +1891,7 @@ ccmakehookfn(Hookdef dummy, struct ccmakedat *dat) } static int -cccleanuphookfn(Hookdef dummy, void *dat) +cccleanuphookfn(UNUSED(Hookdef dummy), UNUSED(void *dat)) { ccused = ccstack = NULL; return 0; @@ -2103,7 +2103,7 @@ dumphashtable(HashTable ht, int what) /**/ static void -addhnmatch(HashNode hn, int flags) +addhnmatch(HashNode hn, UNUSED(int flags)) { addmatch(hn->nam, NULL); } @@ -2345,7 +2345,7 @@ makecomplistctl(int flags) /**/ static int -makecomplistglobal(char *os, int incmd, int lst, int flags) +makecomplistglobal(char *os, int incmd, UNUSED(int lst), int flags) { Compctl cc = NULL; char *s; @@ -3896,7 +3896,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { compctlreadptr = compctlread; createcompctltable(); @@ -3935,7 +3935,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { deletehashtable(compctltab); diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 3939bdd07..d015ab356 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -421,7 +421,7 @@ parse_class(Cpattern p, unsigned char *s, unsigned char e) /**/ static int -bin_compadd(char *name, char **argv, Options ops, int func) +bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { struct cadata dat; char *p, **sp, *e, *m = NULL, *mstr = NULL; @@ -866,7 +866,7 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod) /**/ static int -bin_compset(char *name, char **argv, Options ops, int func) +bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { int test = 0, na = 0, nb = 0; char *sa = NULL, *sb = NULL; @@ -1067,7 +1067,7 @@ get_compstate(Param pm) /**/ static void -set_compstate(Param pm, HashTable ht) +set_compstate(UNUSED(Param pm), HashTable ht) { struct compparam *cp; Param *pp; @@ -1103,42 +1103,42 @@ set_compstate(Param pm, HashTable ht) /**/ static zlong -get_nmatches(Param pm) +get_nmatches(UNUSED(Param pm)) { return (permmatches(0) ? 0 : nmatches); } /**/ static zlong -get_listlines(Param pm) +get_listlines(UNUSED(Param pm)) { return list_lines(); } /**/ static void -set_complist(Param pm, char *v) +set_complist(UNUSED(Param pm), char *v) { comp_list(v); } /**/ static char * -get_complist(Param pm) +get_complist(UNUSED(Param pm)) { return complist; } /**/ static char * -get_unambig(Param pm) +get_unambig(UNUSED(Param pm)) { return unambig_data(NULL, NULL, NULL); } /**/ static zlong -get_unambig_curs(Param pm) +get_unambig_curs(UNUSED(Param pm)) { int c; @@ -1149,7 +1149,7 @@ get_unambig_curs(Param pm) /**/ static char * -get_unambig_pos(Param pm) +get_unambig_pos(UNUSED(Param pm)) { char *p; @@ -1160,7 +1160,7 @@ get_unambig_pos(Param pm) /**/ static char * -get_insert_pos(Param pm) +get_insert_pos(UNUSED(Param pm)) { char *p; @@ -1394,7 +1394,7 @@ struct hookdef comphooks[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { hasperm = 0; @@ -1454,7 +1454,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { if (compwords) freearray(compwords); diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index d43a03677..2c47b246b 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -1588,7 +1588,7 @@ singledraw() } static int -complistmatches(Hookdef dummy, Chdata dat) +complistmatches(UNUSED(Hookdef dummy), Chdata dat) { static int onlnct = -1; @@ -2870,7 +2870,7 @@ menuselect(char **args) /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } @@ -2919,7 +2919,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { free(mtab); free(mgtab); @@ -2934,7 +2934,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index c4c265c70..83de2bd28 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -870,7 +870,7 @@ ztat(char *nam, struct stat *buf, int ls) /**/ void -do_allmatches(int end) +do_allmatches(UNUSED(int end)) { int first = 1, nm = nmatches - 1, omc = menucmp, oma = menuacc, e; Cmatch *mc; @@ -1176,7 +1176,7 @@ do_menucmp(int lst) /**/ int -reverse_menu(Hookdef dummy, void *dummy2) +reverse_menu(UNUSED(Hookdef dummy), UNUSED(void *dummy2)) { do { if (minfo.cur == (minfo.group)->matches) { @@ -2091,7 +2091,7 @@ bld_all_str(Cmatch all) /**/ static void -iprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width) +iprintm(Cmgroup g, Cmatch *mp, UNUSED(int mc), UNUSED(int ml), int lastc, int width) { Cmatch m; int len = 0; @@ -2128,7 +2128,7 @@ iprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width) /**/ int -ilistmatches(Hookdef dummy, Chdata dat) +ilistmatches(UNUSED(Hookdef dummy), UNUSED(Chdata dat)) { calclist(0); @@ -2148,7 +2148,7 @@ ilistmatches(Hookdef dummy, Chdata dat) /**/ int -list_matches(Hookdef dummy, void *dummy2) +list_matches(UNUSED(Hookdef dummy), UNUSED(void *dummy2)) { struct chdata dat; int ret; diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index be9ad6bca..9450aa3ad 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -717,7 +717,7 @@ cd_get(char **params) /**/ static int -bin_compdescribe(char *nam, char **args, Options ops, int func) +bin_compdescribe(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int n = arrlen(args); @@ -2259,7 +2259,7 @@ ca_set_data(LinkList descr, LinkList act, LinkList subc, } static int -bin_comparguments(char *nam, char **args, Options ops, int func) +bin_comparguments(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int min, max, n; Castate lstate = &ca_laststate; @@ -3136,7 +3136,7 @@ cv_parse_word(Cvdef d) } static int -bin_compvalues(char *nam, char **args, Options ops, int func) +bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int min, max, n; @@ -3349,7 +3349,7 @@ comp_quote(char *str, int prefix) } static int -bin_compquote(char *nam, char **args, Options ops, int func) +bin_compquote(char *nam, char **args, Options ops, UNUSED(int func)) { char *name; struct value vbuf; @@ -3500,7 +3500,7 @@ arrcontains(char **a, char *s, int colon) } static int -bin_comptags(char *nam, char **args, Options ops, int func) +bin_comptags(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int min, max, n, level; @@ -3630,7 +3630,7 @@ bin_comptags(char *nam, char **args, Options ops, int func) } static int -bin_comptry(char *nam, char **args, Options ops, int func) +bin_comptry(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { if (incompfunc != 1) { zwarnnam(nam, "can only be called from completion function", NULL, 0); @@ -4092,7 +4092,7 @@ cfp_opt_pats(char **pats, char *matcher) } static LinkList -cfp_bld_pats(int dirs, LinkList names, char *skipped, char **pats) +cfp_bld_pats(UNUSED(int dirs), LinkList names, char *skipped, char **pats) { LinkList ret = newlinklist(); LinkNode node; @@ -4322,7 +4322,7 @@ cf_remove_other(char **names, char *pre, int *amb) } static int -bin_compfiles(char *nam, char **args, Options ops, int func) +bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { if (incompfunc != 1) { zwarnnam(nam, "can only be called from completion function", NULL, 0); @@ -4424,7 +4424,7 @@ bin_compfiles(char *nam, char **args, Options ops, int func) } static int -bin_compgroups(char *nam, char **args, Options ops, int func) +bin_compgroups(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { Heap oldheap; char *n; @@ -4467,7 +4467,7 @@ static struct builtin bintab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { memset(cadef_cache, 0, sizeof(cadef_cache)); memset(cvdef_cache, 0, sizeof(cvdef_cache)); @@ -4496,7 +4496,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { int i; diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c index 87f8593b8..054e7fe23 100644 --- a/Src/Zle/deltochar.c +++ b/Src/Zle/deltochar.c @@ -31,21 +31,24 @@ #include "deltochar.pro" static Widget w_deletetochar; +static Widget w_zaptochar; /**/ -static void -deltochar(void) +static int +deltochar(UNUSED(char **args)) { int c = getkey(0), dest = cs, ok = 0, n = zmult; + int zap = (bindk->widget == w_zaptochar); if (n > 0) { while (n-- && dest != ll) { while (dest != ll && line[dest] != c) dest++; if (dest != ll) { - dest++; + if (!zap || n > 0) + dest++; if (!n) { - foredel(dest - cs); + forekill(dest - cs, 0); ok++; } } @@ -57,35 +60,56 @@ deltochar(void) while (n++ && dest != 0) { while (dest != 0 && line[dest] != c) dest--; - if (line[dest] == c && !n) { - backdel(cs - dest); - ok++; + if (line[dest] == c) { + if (!n) { + backkill(cs - dest - zap, 1); + ok++; + } + if (dest) + dest--; } } } - if (!ok) - feep(); + return !ok; +} + +/**/ +int +setup_(UNUSED(Module m)) +{ + return 0; } /**/ int -boot_deltochar(Module m) +boot_(Module m) { - w_deletetochar = addzlefunction("delete-to-char", deltochar, ZLE_KEEPSUFFIX); - if (w_deletetochar) - return 0; - zwarnnam(m->nam, "name clash when adding ZLE function `delete-to-char'", + w_deletetochar = addzlefunction("delete-to-char", deltochar, + ZLE_KILL | ZLE_KEEPSUFFIX); + if (w_deletetochar) { + w_zaptochar = addzlefunction("zap-to-char", deltochar, + ZLE_KILL | ZLE_KEEPSUFFIX); + if (w_zaptochar) + return 0; + deletezlefunction(w_deletetochar); + } + zwarnnam(m->nam, "deltochar: name clash when adding ZLE functions", NULL, 0); return -1; } -#ifdef MODULE - /**/ int -cleanup_deltochar(Module m) +cleanup_(UNUSED(Module m)) { deletezlefunction(w_deletetochar); + deletezlefunction(w_zaptochar); + return 0; +} + +/**/ +int +finish_(UNUSED(Module m)) +{ return 0; } -#endif diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c index f1463cd15..70d8699c0 100644 --- a/Src/Zle/zle_hist.c +++ b/Src/Zle/zle_hist.c @@ -76,7 +76,7 @@ forget_edits(void) /**/ int -uphistory(char **args) +uphistory(UNUSED(char **args)) { int nodups = isset(HISTIGNOREDUPS); if (!zle_goto_hist(histline, -zmult, nodups) && isset(HISTBEEP)) @@ -254,7 +254,7 @@ downlineorsearch(char **args) /**/ int -acceptlineanddownhistory(char **args) +acceptlineanddownhistory(UNUSED(char **args)) { Histent he = quietgethist(histline); @@ -268,7 +268,7 @@ acceptlineanddownhistory(char **args) /**/ int -downhistory(char **args) +downhistory(UNUSED(char **args)) { int nodups = isset(HISTIGNOREDUPS); if (!zle_goto_hist(histline, zmult, nodups) && isset(HISTBEEP)) @@ -390,7 +390,7 @@ beginningofbufferorhistory(char **args) /**/ int -beginningofhistory(char **args) +beginningofhistory(UNUSED(char **args)) { if (!zle_goto_hist(firsthist(), 0, 0) && isset(HISTBEEP)) return 1; @@ -410,7 +410,7 @@ endofbufferorhistory(char **args) /**/ int -endofhistory(char **args) +endofhistory(UNUSED(char **args)) { zle_goto_hist(curhist, 0, 0); return 0; @@ -574,7 +574,7 @@ zle_setline(Histent he) /**/ int -setlocalhistory(char **args) +setlocalhistory(UNUSED(char **args)) { if (zmod.flags & MOD_MULT) { hist_skip_flags = zmult? HIST_FOREIGN : 0; @@ -604,7 +604,7 @@ zle_goto_hist(int ev, int n, int skipdups) /**/ int -pushline(char **args) +pushline(UNUSED(char **args)) { int n = zmult; @@ -663,7 +663,7 @@ pushinput(char **args) /* Renamed to avoid clash with library function */ /**/ int -zgetline(char **args) +zgetline(UNUSED(char **args)) { char *s = (char *)getlinknode(bufstack); @@ -1000,7 +1000,7 @@ doisearch(char **args, int dir) } static Histent -infernexthist(Histent he, char **args) +infernexthist(Histent he, UNUSED(char **args)) { for (he = movehistent(he, -2, HIST_FOREIGN); he; he = movehistent(he, -1, HIST_FOREIGN)) { @@ -1038,7 +1038,7 @@ infernexthistory(char **args) /**/ int -vifetchhistory(char **args) +vifetchhistory(UNUSED(char **args)) { if (zmult < 0) return 1; @@ -1200,7 +1200,7 @@ vihistorysearchbackward(char **args) /**/ int -virepeatsearch(char **args) +virepeatsearch(UNUSED(char **args)) { Histent he; int t0; diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 7e5fd02ee..3aee499f0 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -248,7 +248,7 @@ newkeymap(Keymap tocopy, char *kmname) /**/ static void -scancopykeys(HashNode hn, int flags) +scancopykeys(HashNode hn, UNUSED(int flags)) { Key k = (Key) hn; Key kn = zalloc(sizeof(*k)); @@ -301,7 +301,7 @@ scankeymap(Keymap km, int sort, KeyScanFunc func, void *magic) /**/ static void -scankeys(HashNode hn, int flags) +scankeys(HashNode hn, UNUSED(int flags)) { Key k = (Key) hn; int f = k->nam[0] == Meta ? STOUC(k->nam[1])^32 : STOUC(k->nam[0]); @@ -615,7 +615,7 @@ keyisprefix(Keymap km, char *seq) /**/ int -bin_bindkey(char *name, char **argv, Options ops, int func) +bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func)) { static struct opn { char o; @@ -707,7 +707,7 @@ bin_bindkey(char *name, char **argv, Options ops, int func) /**/ static int -bin_bindkey_lsmaps(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_lsmaps(UNUSED(char *name), UNUSED(char *kmname), UNUSED(Keymap km), UNUSED(char **argv), Options ops, UNUSED(char func)) { scanhashtable(keymapnamtab, 1, 0, 0, scanlistmaps, OPT_ISSET(ops,'L')); return 0; @@ -733,7 +733,7 @@ scanlistmaps(HashNode hn, int list) /**/ static int -bin_bindkey_delall(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_delall(UNUSED(char *name), UNUSED(char *kmname), UNUSED(Keymap km), UNUSED(char **argv), UNUSED(Options ops), UNUSED(char func)) { keymapnamtab->emptytable(keymapnamtab); default_bindings(); @@ -744,7 +744,7 @@ bin_bindkey_delall(char *name, char *kmname, Keymap km, char **argv, Options ops /**/ static int -bin_bindkey_del(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_del(char *name, UNUSED(char *kmname), UNUSED(Keymap km), char **argv, UNUSED(Options ops), UNUSED(char func)) { int ret = 0; @@ -763,7 +763,7 @@ bin_bindkey_del(char *name, char *kmname, Keymap km, char **argv, Options ops, c /**/ static int -bin_bindkey_link(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_link(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSED(Options ops), UNUSED(char func)) { km = openkeymap(argv[0]); if(!km) { @@ -780,7 +780,7 @@ bin_bindkey_link(char *name, char *kmname, Keymap km, char **argv, Options ops, /**/ static int -bin_bindkey_new(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_new(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSED(Options ops), UNUSED(char func)) { KeymapName kmn = (KeymapName) keymapnamtab->getnode(keymapnamtab, argv[0]); @@ -808,7 +808,7 @@ bin_bindkey_new(char *name, char *kmname, Keymap km, char **argv, Options ops, c /**/ static int -bin_bindkey_meta(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_meta(char *name, char *kmname, Keymap km, UNUSED(char **argv), UNUSED(Options ops), UNUSED(char func)) { char m[3], *str; int i; @@ -916,7 +916,7 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops, /**/ static void -scanremoveprefix(char *seq, Thingy bind, char *str, void *magic) +scanremoveprefix(char *seq, UNUSED(Thingy bind), UNUSED(char *str), void *magic) { struct remprefstate *rps = magic; @@ -932,7 +932,7 @@ scanremoveprefix(char *seq, Thingy bind, char *str, void *magic) /**/ static int -bin_bindkey_list(char *name, char *kmname, Keymap km, char **argv, Options ops, char func) +bin_bindkey_list(char *name, char *kmname, Keymap km, char **argv, Options ops, UNUSED(char func)) { struct bindstate bs; diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 8a9a149b9..0cfb8d9f6 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1035,7 +1035,7 @@ mod_export char *varedarg; /**/ static int -bin_vared(char *name, char **args, Options ops, int func) +bin_vared(char *name, char **args, Options ops, UNUSED(int func)) { char *s, *t, *ova = varedarg; struct value vbuf; @@ -1217,7 +1217,7 @@ bin_vared(char *name, char **args, Options ops, int func) /**/ int -describekeybriefly(char **args) +describekeybriefly(UNUSED(char **args)) { char *seq, *str, *msg, *is; Thingy func; @@ -1255,7 +1255,7 @@ struct findfunc { /**/ static void -scanfindfunc(char *seq, Thingy func, char *str, void *magic) +scanfindfunc(char *seq, Thingy func, UNUSED(char *str), void *magic) { struct findfunc *ff = magic; @@ -1274,7 +1274,7 @@ scanfindfunc(char *seq, Thingy func, char *str, void *magic) /**/ int -whereis(char **args) +whereis(UNUSED(char **args)) { struct findfunc ff; @@ -1294,7 +1294,7 @@ whereis(char **args) /**/ int -recursiveedit(char **args) +recursiveedit(UNUSED(char **args)) { int locerror; @@ -1341,7 +1341,7 @@ trashzle(void) * active. */ static int -zlebeforetrap(Hookdef dummy, void *dat) +zlebeforetrap(UNUSED(Hookdef dummy), UNUSED(void *dat)) { if (zleactive) { startparamscope(); @@ -1351,7 +1351,7 @@ zlebeforetrap(Hookdef dummy, void *dat) } static int -zleaftertrap(Hookdef dummy, void *dat) +zleaftertrap(UNUSED(Hookdef dummy), UNUSED(void *dat)) { if (zleactive) endparamscope(); @@ -1381,7 +1381,7 @@ mod_export struct hookdef zlehooks[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { /* Set up editor entry points */ trashzleptr = trashzle; @@ -1444,7 +1444,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { int i; diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 1d274a93e..935de58af 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -58,7 +58,7 @@ doinsert(char *str) /**/ mod_export int -selfinsert(char **args) +selfinsert(UNUSED(char **args)) { char s[3], *p = s; @@ -118,7 +118,7 @@ backwarddeletechar(char **args) /**/ int -killwholeline(char **args) +killwholeline(UNUSED(char **args)) { int i, fg, n = zmult; @@ -138,7 +138,7 @@ killwholeline(char **args) /**/ int -killbuffer(char **args) +killbuffer(UNUSED(char **args)) { cs = 0; forekill(ll, 0); @@ -173,7 +173,7 @@ backwardkillline(char **args) /**/ int -gosmacstransposechars(char **args) +gosmacstransposechars(UNUSED(char **args)) { int cc; @@ -193,7 +193,7 @@ gosmacstransposechars(char **args) /**/ int -transposechars(char **args) +transposechars(UNUSED(char **args)) { int cc, ct; int n = zmult; @@ -232,7 +232,7 @@ transposechars(char **args) /**/ int -poundinsert(char **args) +poundinsert(UNUSED(char **args)) { cs = 0; vifirstnonblank(zlenoargs); @@ -264,7 +264,7 @@ poundinsert(char **args) /**/ int -acceptline(char **args) +acceptline(UNUSED(char **args)) { done = 1; return 0; @@ -272,7 +272,7 @@ acceptline(char **args) /**/ int -acceptandhold(char **args) +acceptandhold(UNUSED(char **args)) { zpushnode(bufstack, metafy((char *)line, ll, META_DUP)); stackcs = cs; @@ -307,7 +307,7 @@ killline(char **args) /**/ int -killregion(char **args) +killregion(UNUSED(char **args)) { if (mark > ll) mark = ll; @@ -320,7 +320,7 @@ killregion(char **args) /**/ int -copyregionaskill(char **args) +copyregionaskill(UNUSED(char **args)) { if (mark > ll) mark = ll; @@ -341,7 +341,7 @@ static Cutbuffer kctbuf; /**/ int -yank(char **args) +yank(UNUSED(char **args)) { int n = zmult; @@ -367,7 +367,7 @@ yank(char **args) /**/ int -yankpop(char **args) +yankpop(UNUSED(char **args)) { int cc, kctstart = kct; Cutbuffer buf; @@ -426,7 +426,7 @@ yankpop(char **args) /**/ int -overwritemode(char **args) +overwritemode(UNUSED(char **args)) { insmode ^= 1; return 0; @@ -434,7 +434,7 @@ overwritemode(char **args) /**/ int -whatcursorposition(char **args) +whatcursorposition(UNUSED(char **args)) { char msg[100]; char *s = msg; @@ -473,7 +473,7 @@ whatcursorposition(char **args) /**/ int -undefinedkey(char **args) +undefinedkey(UNUSED(char **args)) { return 1; } @@ -501,7 +501,7 @@ quotedinsert(char **args) /**/ int -digitargument(char **args) +digitargument(UNUSED(char **args)) { int sign = (zmult < 0) ? -1 : 1; @@ -525,7 +525,7 @@ digitargument(char **args) /**/ int -negargument(char **args) +negargument(UNUSED(char **args)) { if (zmod.flags & MOD_TMULT) return 1; @@ -568,7 +568,7 @@ universalargument(char **args) /**/ int -copyprevword(char **args) +copyprevword(UNUSED(char **args)) { int len, t0; @@ -589,7 +589,7 @@ copyprevword(char **args) /**/ int -copyprevshellword(char **args) +copyprevshellword(UNUSED(char **args)) { LinkList l; LinkNode n; @@ -615,7 +615,7 @@ copyprevshellword(char **args) /**/ int -sendbreak(char **args) +sendbreak(UNUSED(char **args)) { errflag = 1; return 1; @@ -623,7 +623,7 @@ sendbreak(char **args) /**/ int -quoteregion(char **args) +quoteregion(UNUSED(char **args)) { char *str; size_t len; @@ -648,7 +648,7 @@ quoteregion(char **args) /**/ int -quoteline(char **args) +quoteline(UNUSED(char **args)) { char *str; size_t len = ll; @@ -692,7 +692,7 @@ static int cmdambig; /**/ static void -scancompcmd(HashNode hn, int flags) +scancompcmd(HashNode hn, UNUSED(int flags)) { int l; Thingy t = (Thingy) hn; diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c index a7db7dc85..23db9dc4e 100644 --- a/Src/Zle/zle_move.c +++ b/Src/Zle/zle_move.c @@ -157,7 +157,7 @@ endoflinehist(char **args) /**/ int -forwardchar(char **args) +forwardchar(UNUSED(char **args)) { cs += zmult; if (cs > ll) @@ -169,7 +169,7 @@ forwardchar(char **args) /**/ int -backwardchar(char **args) +backwardchar(UNUSED(char **args)) { cs -= zmult; if (cs > ll) @@ -181,7 +181,7 @@ backwardchar(char **args) /**/ int -setmarkcommand(char **args) +setmarkcommand(UNUSED(char **args)) { mark = cs; return 0; @@ -189,7 +189,7 @@ setmarkcommand(char **args) /**/ int -exchangepointandmark(char **args) +exchangepointandmark(UNUSED(char **args)) { int x; @@ -203,7 +203,7 @@ exchangepointandmark(char **args) /**/ int -vigotocolumn(char **args) +vigotocolumn(UNUSED(char **args)) { int x, y; @@ -221,7 +221,7 @@ vigotocolumn(char **args) /**/ int -vimatchbracket(char **args) +vimatchbracket(UNUSED(char **args)) { int ocs = cs, dir, ct; unsigned char oth, me; @@ -327,7 +327,7 @@ vibackwardchar(char **args) /**/ int -viendofline(char **args) +viendofline(UNUSED(char **args)) { int oldcs = cs, n = zmult; @@ -347,7 +347,7 @@ viendofline(char **args) /**/ int -vibeginningofline(char **args) +vibeginningofline(UNUSED(char **args)) { cs = findbol(); return 0; @@ -453,7 +453,7 @@ virevrepeatfind(char **args) /**/ int -vifirstnonblank(char **args) +vifirstnonblank(UNUSED(char **args)) { cs = findbol(); while (cs != ll && iblank(line[cs])) @@ -463,7 +463,7 @@ vifirstnonblank(char **args) /**/ int -visetmark(char **args) +visetmark(UNUSED(char **args)) { int ch; @@ -478,7 +478,7 @@ visetmark(char **args) /**/ int -vigotomark(char **args) +vigotomark(UNUSED(char **args)) { int ch; diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c index 2c3b2c007..f2eaea723 100644 --- a/Src/Zle/zle_params.c +++ b/Src/Zle/zle_params.c @@ -146,7 +146,7 @@ zleunsetfn(Param pm, int exp) /**/ static void -set_buffer(Param pm, char *x) +set_buffer(UNUSED(Param pm), char *x) { if(x) { unmetafy(x, &ll); @@ -163,14 +163,14 @@ set_buffer(Param pm, char *x) /**/ static char * -get_buffer(Param pm) +get_buffer(UNUSED(Param pm)) { return metafy((char *)line, ll, META_HEAPDUP); } /**/ static void -set_cursor(Param pm, zlong x) +set_cursor(UNUSED(Param pm), zlong x) { if(x < 0) cs = 0; @@ -184,14 +184,14 @@ set_cursor(Param pm, zlong x) /**/ static zlong -get_cursor(Param pm) +get_cursor(UNUSED(Param pm)) { return cs; } /**/ static void -set_mark(Param pm, zlong x) +set_mark(UNUSED(Param pm), zlong x) { if (x < 0) mark = 0; @@ -203,14 +203,14 @@ set_mark(Param pm, zlong x) /**/ static zlong -get_mark(Param pm) +get_mark(UNUSED(Param pm)) { return mark; } /**/ static void -set_lbuffer(Param pm, char *x) +set_lbuffer(UNUSED(Param pm), char *x) { char *y; int len; @@ -231,14 +231,14 @@ set_lbuffer(Param pm, char *x) /**/ static char * -get_lbuffer(Param pm) +get_lbuffer(UNUSED(Param pm)) { return metafy((char *)line, cs, META_HEAPDUP); } /**/ static void -set_rbuffer(Param pm, char *x) +set_rbuffer(UNUSED(Param pm), char *x) { char *y; int len; @@ -256,14 +256,14 @@ set_rbuffer(Param pm, char *x) /**/ static char * -get_rbuffer(Param pm) +get_rbuffer(UNUSED(Param pm)) { return metafy((char *)line + cs, ll - cs, META_HEAPDUP); } /**/ static char * -get_prebuffer(Param pm) +get_prebuffer(UNUSED(Param pm)) { if (chline) return dupstrpfx(chline, hptr - chline); @@ -273,35 +273,35 @@ get_prebuffer(Param pm) /**/ static char * -get_widget(Param pm) +get_widget(UNUSED(Param pm)) { return bindk->nam; } /**/ static char * -get_lwidget(Param pm) +get_lwidget(UNUSED(Param pm)) { return (lbindk ? lbindk->nam : ""); } /**/ static char * -get_keymap(Param pm) +get_keymap(UNUSED(Param pm)) { return dupstring(curkeymapname); } /**/ static char * -get_keys(Param pm) +get_keys(UNUSED(Param pm)) { return keybuf; } /**/ static void -set_numeric(Param pm, zlong x) +set_numeric(UNUSED(Param pm), zlong x) { zmult = x; zmod.flags = MOD_MULT; @@ -309,7 +309,7 @@ set_numeric(Param pm, zlong x) /**/ static zlong -get_numeric(Param pm) +get_numeric(UNUSED(Param pm)) { return zmult; } @@ -327,28 +327,28 @@ unset_numeric(Param pm, int exp) /**/ static zlong -get_histno(Param pm) +get_histno(UNUSED(Param pm)) { return histline; } /**/ static zlong -get_bufferlines(Param pm) +get_bufferlines(UNUSED(Param pm)) { return nlnct; } /**/ static zlong -get_pending(Param pm) +get_pending(UNUSED(Param pm)) { return noquery(0); } /**/ static char * -get_cutbuffer(Param pm) +get_cutbuffer(UNUSED(Param pm)) { if (cutbuf.buf) return metafy(cutbuf.buf, cutbuf.len, META_HEAPDUP); @@ -359,7 +359,7 @@ get_cutbuffer(Param pm) /**/ static void -set_cutbuffer(Param pm, char *x) +set_cutbuffer(UNUSED(Param pm), char *x) { if (cutbuf.buf) free(cutbuf.buf); @@ -393,7 +393,7 @@ unset_cutbuffer(Param pm, int exp) /**/ static void -set_killring(Param pm, char **x) +set_killring(UNUSED(Param pm), char **x) { int kcnt; Cutbuffer kptr; @@ -435,7 +435,7 @@ set_killring(Param pm, char **x) /**/ static char ** -get_killring(Param pm) +get_killring(UNUSED(Param pm)) { /* * Return the kill ring with the most recently killed first. @@ -508,28 +508,28 @@ get_prepost(unsigned char *text, int len) /**/ static void -set_predisplay(Param pm, char *x) +set_predisplay(UNUSED(Param pm), char *x) { set_prepost(&predisplay, &predisplaylen, x); } /**/ static char * -get_predisplay(Param pm) +get_predisplay(UNUSED(Param pm)) { return get_prepost(predisplay, predisplaylen); } /**/ static void -set_postdisplay(Param pm, char *x) +set_postdisplay(UNUSED(Param pm), char *x) { set_prepost(&postdisplay, &postdisplaylen, x); } /**/ static char * -get_postdisplay(Param pm) +get_postdisplay(UNUSED(Param pm)) { return get_prepost(postdisplay, postdisplaylen); } @@ -546,7 +546,7 @@ free_prepostdisplay(void) /**/ static char * -get_lsearch(Param pm) +get_lsearch(UNUSED(Param pm)) { if (previous_search_len) return metafy(previous_search, previous_search_len, META_HEAPDUP); @@ -556,7 +556,7 @@ get_lsearch(Param pm) /**/ static char * -get_context(Param pm) +get_context(UNUSED(Param pm)) { switch (zlecontext) { case ZLCON_LINE_CONT: diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index 2b90edd0c..08516939a 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -1096,7 +1096,7 @@ tcoutarg(int cap, int arg) /**/ mod_export int -clearscreen(char **args) +clearscreen(UNUSED(char **args)) { tcout(TCCLEARSCREEN); resetneeded = 1; @@ -1106,7 +1106,7 @@ clearscreen(char **args) /**/ mod_export int -redisplay(char **args) +redisplay(UNUSED(char **args)) { moveto(0, 0); zputc('\r', shout); /* extra care */ diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index 91ee2c010..53eb927f9 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -77,7 +77,7 @@ createthingytab(void) /**/ static void -emptythingytab(HashTable ht) +emptythingytab(UNUSED(HashTable ht)) { /* This will only be called when deleting the thingy table, which * * is only done to unload the zle module. A normal emptytable() * @@ -93,7 +93,7 @@ emptythingytab(HashTable ht) /**/ static void -scanemptythingies(HashNode hn, int flags) +scanemptythingies(HashNode hn, UNUSED(int flags)) { Thingy t = (Thingy) hn; @@ -335,7 +335,7 @@ deletezlefunction(Widget w) /**/ int -bin_zle(char *name, char **args, Options ops, int func) +bin_zle(char *name, char **args, Options ops, UNUSED(int func)) { static struct opn { char o; @@ -384,7 +384,7 @@ bin_zle(char *name, char **args, Options ops, int func) /**/ static int -bin_zle_list(char *name, char **args, Options ops, char func) +bin_zle_list(UNUSED(char *name), char **args, Options ops, UNUSED(char func)) { if (!*args) { scanhashtable(thingytab, 1, 0, DISABLED, scanlistwidgets, @@ -405,7 +405,7 @@ bin_zle_list(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_refresh(char *name, char **args, Options ops, char func) +bin_zle_refresh(UNUSED(char *name), char **args, Options ops, UNUSED(char func)) { char *s = statusline; int sl = statusll, ocl = clearlist; @@ -450,7 +450,7 @@ bin_zle_refresh(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_mesg(char *name, char **args, Options ops, char func) +bin_zle_mesg(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { if (!zleactive) { zwarnnam(name, "can only be called from widget function", NULL, 0); @@ -464,7 +464,7 @@ bin_zle_mesg(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_unget(char *name, char **args, Options ops, char func) +bin_zle_unget(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { char *b = *args, *p = b + strlen(b); @@ -479,7 +479,7 @@ bin_zle_unget(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_keymap(char *name, char **args, Options ops, char func) +bin_zle_keymap(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { if (!zleactive) { zwarnnam(name, "can only be called from widget function", NULL, 0); @@ -533,7 +533,7 @@ scanlistwidgets(HashNode hn, int list) /**/ static int -bin_zle_del(char *name, char **args, Options ops, char func) +bin_zle_del(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { int ret = 0; @@ -552,7 +552,7 @@ bin_zle_del(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_link(char *name, char **args, Options ops, char func) +bin_zle_link(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { Thingy t = (Thingy) thingytab->getnode(thingytab, args[0]); @@ -569,7 +569,7 @@ bin_zle_link(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_new(char *name, char **args, Options ops, char func) +bin_zle_new(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { Widget w = zalloc(sizeof(*w)); @@ -585,7 +585,7 @@ bin_zle_new(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_complete(char *name, char **args, Options ops, char func) +bin_zle_complete(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { Thingy t; Widget w, cw; @@ -619,7 +619,7 @@ bin_zle_complete(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_call(char *name, char **args, Options ops, char func) +bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { Thingy t; struct modifier modsave; @@ -683,7 +683,7 @@ bin_zle_call(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_invalidate(char *name, char **args, Options ops, char func) +bin_zle_invalidate(UNUSED(char *name), UNUSED(char **args), UNUSED(Options ops), UNUSED(char func)) { if (zleactive) { if (!trashedzle) @@ -695,7 +695,7 @@ bin_zle_invalidate(char *name, char **args, Options ops, char func) /**/ static int -bin_zle_fd(char *name, char **args, Options ops, char func) +bin_zle_fd(char *name, char **args, Options ops, UNUSED(char func)) { int fd = 0, i, found = 0; char *endptr; diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 135e38f88..4fbf2b9c5 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -223,7 +223,7 @@ menucomplete(char **args) /**/ int -listchoices(char **args) +listchoices(UNUSED(char **args)) { usemenu = !!isset(MENUCOMPLETE); useglob = isset(GLOBCOMPLETE); @@ -233,7 +233,7 @@ listchoices(char **args) /**/ int -spellword(char **args) +spellword(UNUSED(char **args)) { usemenu = useglob = 0; wouldinstab = 0; @@ -305,7 +305,7 @@ menuexpandorcomplete(char **args) /**/ int -listexpand(char **args) +listexpand(UNUSED(char **args)) { usemenu = !!isset(MENUCOMPLETE); useglob = isset(GLOBCOMPLETE); @@ -2305,7 +2305,7 @@ magicspace(char **args) /**/ int -expandhistory(char **args) +expandhistory(UNUSED(char **args)) { if (!doexpandhist()) return 1; @@ -2352,7 +2352,7 @@ getcurcmd(void) /**/ int -processcmd(char **args) +processcmd(UNUSED(char **args)) { char *s; int m = zmult; @@ -2376,7 +2376,7 @@ processcmd(char **args) /**/ int -expandcmdpath(char **args) +expandcmdpath(UNUSED(char **args)) { int oldcs = cs, na = noaliases; char *s, *str; @@ -2421,7 +2421,7 @@ expandorcompleteprefix(char **args) /**/ int -endoflist(char **args) +endoflist(UNUSED(char **args)) { if (lastlistlen > 0) { int i; diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index 69b4e6e42..8783e83f9 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -424,7 +424,7 @@ showmsg(char const *msg) /**/ int -handlefeep(char **args) +handlefeep(UNUSED(char **args)) { zbeep(); return 0; @@ -565,7 +565,7 @@ setlastline(void) /**/ int -undo(char **args) +undo(UNUSED(char **args)) { handleundo(); do { @@ -610,7 +610,7 @@ unapplychange(struct change *ch) /**/ int -redo(char **args) +redo(UNUSED(char **args)) { handleundo(); do { diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index 9ba84aadc..81a095c71 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -259,7 +259,7 @@ dovilinerange(void) /**/ int -viaddnext(char **args) +viaddnext(UNUSED(char **args)) { if (cs != findeol()) cs++; @@ -269,7 +269,7 @@ viaddnext(char **args) /**/ int -viaddeol(char **args) +viaddeol(UNUSED(char **args)) { cs = findeol(); startvitext(1); @@ -278,7 +278,7 @@ viaddeol(char **args) /**/ int -viinsert(char **args) +viinsert(UNUSED(char **args)) { startvitext(1); return 0; @@ -286,7 +286,7 @@ viinsert(char **args) /**/ int -viinsertbol(char **args) +viinsertbol(UNUSED(char **args)) { vifirstnonblank(zlenoargs); startvitext(1); @@ -295,7 +295,7 @@ viinsertbol(char **args) /**/ int -videlete(char **args) +videlete(UNUSED(char **args)) { int c2, ret = 1; @@ -343,7 +343,7 @@ videletechar(char **args) /**/ int -vichange(char **args) +vichange(UNUSED(char **args)) { int c2, ret = 1; @@ -360,7 +360,7 @@ vichange(char **args) /**/ int -visubstitute(char **args) +visubstitute(UNUSED(char **args)) { int n = zmult; @@ -382,7 +382,7 @@ visubstitute(char **args) /**/ int -vichangeeol(char **args) +vichangeeol(UNUSED(char **args)) { forekill(findeol() - cs, 0); startvitext(1); @@ -399,7 +399,7 @@ vichangewholeline(char **args) /**/ int -viyank(char **args) +viyank(UNUSED(char **args)) { int oldcs = cs, c2, ret = 1; @@ -415,7 +415,7 @@ viyank(char **args) /**/ int -viyankeol(char **args) +viyankeol(UNUSED(char **args)) { int x = findeol(); @@ -428,7 +428,7 @@ viyankeol(char **args) /**/ int -viyankwholeline(char **args) +viyankwholeline(UNUSED(char **args)) { int bol = findbol(), oldcs = cs; int n = zmult; @@ -451,7 +451,7 @@ viyankwholeline(char **args) /**/ int -vireplace(char **args) +vireplace(UNUSED(char **args)) { startvitext(0); return 0; @@ -472,7 +472,7 @@ vireplace(char **args) /**/ int -vireplacechars(char **args) +vireplacechars(UNUSED(char **args)) { int ch, n = zmult; @@ -510,7 +510,7 @@ vireplacechars(char **args) /**/ int -vicmdmode(char **args) +vicmdmode(UNUSED(char **args)) { if (invicmdmode() || selectkeymap("vicmd", 0)) return 1; @@ -523,7 +523,7 @@ vicmdmode(char **args) /**/ int -viopenlinebelow(char **args) +viopenlinebelow(UNUSED(char **args)) { cs = findeol(); spaceinline(1); @@ -535,7 +535,7 @@ viopenlinebelow(char **args) /**/ int -viopenlineabove(char **args) +viopenlineabove(UNUSED(char **args)) { cs = findbol(); spaceinline(1); @@ -547,7 +547,7 @@ viopenlineabove(char **args) /**/ int -vioperswapcase(char **args) +vioperswapcase(UNUSED(char **args)) { int oldcs, c2, ret = 1; @@ -576,7 +576,7 @@ vioperswapcase(char **args) /**/ int -virepeatchange(char **args) +virepeatchange(UNUSED(char **args)) { /* make sure we have a change to repeat */ if (!vichgbuf || vichgflag) @@ -599,7 +599,7 @@ virepeatchange(char **args) /**/ int -viindent(char **args) +viindent(UNUSED(char **args)) { int oldcs = cs, c2; @@ -630,7 +630,7 @@ viindent(char **args) /**/ int -viunindent(char **args) +viunindent(UNUSED(char **args)) { int oldcs = cs, c2; @@ -691,7 +691,7 @@ vibackwarddeletechar(char **args) /**/ int -vikillline(char **args) +vikillline(UNUSED(char **args)) { if (viinsbegin > cs) return 1; @@ -701,7 +701,7 @@ vikillline(char **args) /**/ int -viputbefore(char **args) +viputbefore(UNUSED(char **args)) { Cutbuffer buf = &cutbuf; int n = zmult; @@ -733,7 +733,7 @@ viputbefore(char **args) /**/ int -viputafter(char **args) +viputafter(UNUSED(char **args)) { Cutbuffer buf = &cutbuf; int n = zmult; @@ -767,7 +767,7 @@ viputafter(char **args) /**/ int -vijoin(char **args) +vijoin(UNUSED(char **args)) { int x; @@ -788,7 +788,7 @@ vijoin(char **args) /**/ int -viswapcase(char **args) +viswapcase(UNUSED(char **args)) { int eol, n = zmult; @@ -810,7 +810,7 @@ viswapcase(char **args) /**/ int -vicapslockpanic(char **args) +vicapslockpanic(UNUSED(char **args)) { clearlist = 1; zbeep(); @@ -824,7 +824,7 @@ vicapslockpanic(char **args) /**/ int -visetbuffer(char **args) +visetbuffer(UNUSED(char **args)) { int ch; @@ -844,7 +844,7 @@ visetbuffer(char **args) /**/ int -vikilleol(char **args) +vikilleol(UNUSED(char **args)) { int n = findeol() - cs; @@ -860,7 +860,7 @@ vikilleol(char **args) /**/ int -vipoundinsert(char **args) +vipoundinsert(UNUSED(char **args)) { int oldcs = cs; diff --git a/Src/Zle/zle_word.c b/Src/Zle/zle_word.c index 923216ef8..5c096e5d3 100644 --- a/Src/Zle/zle_word.c +++ b/Src/Zle/zle_word.c @@ -31,38 +31,41 @@ #include "zle_word.pro" /**/ -void -forwardword(void) +int +forwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwardword(); + ret = backwardword(args); zmult = n; - return; + return ret; } while (n--) { while (cs != ll && iword(line[cs])) cs++; if (wordflag && !n) - return; + return 0; while (cs != ll && !iword(line[cs])) cs++; } + return 0; } /**/ -void -viforwardword(void) +int +viforwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwardword(); + ret = backwardword(args); zmult = n; - return; + return ret; } while (n--) { if (iident(line[cs])) @@ -72,64 +75,69 @@ viforwardword(void) while (cs != ll && !iident(line[cs]) && !iblank(line[cs])) cs++; if (wordflag && !n) - return; - while (cs != ll && iblank(line[cs])) + return 0; + while (cs != ll && (iblank(line[cs]) || line[cs] == '\n')) cs++; } + return 0; } /**/ -void -viforwardblankword(void) +int +viforwardblankword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - vibackwardblankword(); + ret = vibackwardblankword(args); zmult = n; - return; + return ret; } while (n--) { while (cs != ll && !iblank(line[cs])) cs++; if (wordflag && !n) - return; + return 0; while (cs != ll && iblank(line[cs])) cs++; } + return 0; } /**/ -void -emacsforwardword(void) +int +emacsforwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - emacsbackwardword(); + ret = emacsbackwardword(args); zmult = n; - return; + return ret; } while (n--) { while (cs != ll && !iword(line[cs])) cs++; if (wordflag && !n) - return; + return 0; while (cs != ll && iword(line[cs])) cs++; } + return 0; } /**/ -void -viforwardblankwordend(void) +int +viforwardblankwordend(UNUSED(char **args)) { int n = zmult; if (n < 0) - return; + return 1; while (n--) { while (cs != ll && iblank(line[cs + 1])) cs++; @@ -138,19 +146,21 @@ viforwardblankwordend(void) } if (cs != ll && virangeflag) cs++; + return 0; } /**/ -void -viforwardwordend(void) +int +viforwardwordend(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwardword(); + ret = backwardword(args); zmult = n; - return; + return ret; } while (n--) { if (iblank(line[cs + 1])) @@ -165,19 +175,21 @@ viforwardwordend(void) } if (cs != ll && virangeflag) cs++; + return 0; } /**/ -void -backwardword(void) +int +backwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - forwardword(); + ret = forwardword(args); zmult = n; - return; + return ret; } while (n--) { while (cs && !iword(line[cs - 1])) @@ -185,19 +197,21 @@ backwardword(void) while (cs && iword(line[cs - 1])) cs--; } + return 0; } /**/ -void -vibackwardword(void) +int +vibackwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwardword(); + ret = backwardword(args); zmult = n; - return; + return ret; } while (n--) { while (cs && iblank(line[cs - 1])) @@ -209,19 +223,21 @@ vibackwardword(void) while (cs && !iident(line[cs - 1]) && !iblank(line[cs - 1])) cs--; } + return 0; } /**/ -void -vibackwardblankword(void) +int +vibackwardblankword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - viforwardblankword(); + ret = viforwardblankword(args); zmult = n; - return; + return ret; } while (n--) { while (cs && iblank(line[cs - 1])) @@ -229,19 +245,21 @@ vibackwardblankword(void) while (cs && !iblank(line[cs - 1])) cs--; } + return 0; } /**/ -void -emacsbackwardword(void) +int +emacsbackwardword(char **args) { int n = zmult; if (n < 0) { + int ret; zmult = -n; - emacsforwardword(); + ret = emacsforwardword(args); zmult = n; - return; + return ret; } while (n--) { while (cs && !iword(line[cs - 1])) @@ -249,19 +267,21 @@ emacsbackwardword(void) while (cs && iword(line[cs - 1])) cs--; } + return 0; } /**/ -void -backwarddeleteword(void) +int +backwarddeleteword(char **args) { int x = cs, n = zmult; if (n < 0) { + int ret; zmult = -n; - deleteword(); + ret = deleteword(args); zmult = n; - return; + return ret; } while (n--) { while (x && !iword(line[x - 1])) @@ -270,19 +290,18 @@ backwarddeleteword(void) x--; } backdel(cs - x); + return 0; } /**/ -void -vibackwardkillword(void) +int +vibackwardkillword(UNUSED(char **args)) { int x = cs, lim = (viinsbegin > findbol()) ? viinsbegin : findbol(); int n = zmult; - if (n < 0) { - feep(); - return; - } + if (n < 0) + return 1; /* this taken from "vibackwardword" */ while (n--) { while ((x > lim) && iblank(line[x - 1])) @@ -295,20 +314,22 @@ vibackwardkillword(void) x--; } backkill(cs - x, 1); + return 0; } /**/ -void -backwardkillword(void) +int +backwardkillword(char **args) { int x = cs; int n = zmult; if (n < 0) { + int ret; zmult = -n; - killword(); + ret = killword(args); zmult = n; - return; + return ret; } while (n--) { while (x && !iword(line[x - 1])) @@ -317,11 +338,12 @@ backwardkillword(void) x--; } backkill(cs - x, 1); + return 0; } /**/ -void -upcaseword(void) +int +upcaseword(UNUSED(char **args)) { int n = zmult; int neg = n < 0, ocs = cs; @@ -338,11 +360,12 @@ upcaseword(void) } if (neg) cs = ocs; + return 0; } /**/ -void -downcaseword(void) +int +downcaseword(UNUSED(char **args)) { int n = zmult; int neg = n < 0, ocs = cs; @@ -359,11 +382,12 @@ downcaseword(void) } if (neg) cs = ocs; + return 0; } /**/ -void -capitalizeword(void) +int +capitalizeword(UNUSED(char **args)) { int first, n = zmult; int neg = n < 0, ocs = cs; @@ -384,20 +408,22 @@ capitalizeword(void) } if (neg) cs = ocs; + return 0; } /**/ -void -deleteword(void) +int +deleteword(char **args) { int x = cs; int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwarddeleteword(); + ret = backwarddeleteword(args); zmult = n; - return; + return ret; } while (n--) { while (x != ll && !iword(line[x])) @@ -406,20 +432,22 @@ deleteword(void) x++; } foredel(x - cs); + return 0; } /**/ -void -killword(void) +int +killword(char **args) { int x = cs; int n = zmult; if (n < 0) { + int ret; zmult = -n; - backwardkillword(); + ret = backwardkillword(args); zmult = n; - return; + return ret; } while (n--) { while (x != ll && !iword(line[x])) @@ -428,11 +456,12 @@ killword(void) x++; } forekill(x - cs, 0); + return 0; } /**/ -void -transposewords(void) +int +transposewords(UNUSED(char **args)) { int p1, p2, p3, p4, x = cs; char *temp, *pp; @@ -448,24 +477,18 @@ transposewords(void) x = cs; while (x && line[x - 1] != '\n' && !iword(line[x])) x--; - if (!x || line[x - 1] == '\n') { - feep(); - return; - } + if (!x || line[x - 1] == '\n') + return 1; } for (p4 = x; p4 != ll && iword(line[p4]); p4++); for (p3 = p4; p3 && iword(line[p3 - 1]); p3--); - if (!p3) { - feep(); - return; - } + if (!p3) + return 1; for (p2 = p3; p2 && !iword(line[p2 - 1]); p2--); - if (!p2) { - feep(); - return; - } + if (!p2) + return 1; for (p1 = p2; p1 && iword(line[p1 - 1]); p1--); - pp = temp = (char *)halloc(p4 - p1 + 1); + pp = temp = (char *)zhalloc(p4 - p1 + 1); struncpy(&pp, (char *) line + p3, p4 - p3); struncpy(&pp, (char *) line + p2, p3 - p2); struncpy(&pp, (char *) line + p1, p2 - p1); @@ -474,4 +497,5 @@ transposewords(void) } if (neg) cs = ocs; + return 0; } diff --git a/Src/Zle/zleparameter.c b/Src/Zle/zleparameter.c index cce421897..38b2a3608 100644 --- a/Src/Zle/zleparameter.c +++ b/Src/Zle/zleparameter.c @@ -96,7 +96,7 @@ widgetstr(Widget w) /**/ static HashNode -getpmwidgets(HashTable ht, char *name) +getpmwidgets(UNUSED(HashTable ht), char *name) { Param pm = NULL; Thingy th; @@ -124,7 +124,7 @@ getpmwidgets(HashTable ht, char *name) /**/ static void -scanpmwidgets(HashTable ht, ScanFunc func, int flags) +scanpmwidgets(UNUSED(HashTable ht), ScanFunc func, int flags) { struct param pm; int i; @@ -154,7 +154,7 @@ scanpmwidgets(HashTable ht, ScanFunc func, int flags) /* Functions for the zlekeymaps special parameter. */ static char ** -keymapsgetfn(Param pm) +keymapsgetfn(UNUSED(Param pm)) { int i; HashNode hn; @@ -196,14 +196,14 @@ static struct pardef partab[] = { /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { struct pardef *def; @@ -230,7 +230,7 @@ boot_(Module m) /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { Param pm; struct pardef *def; @@ -247,7 +247,7 @@ cleanup_(Module m) /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } diff --git a/Src/builtin.c b/Src/builtin.c index f84e5504a..81bba7d4f 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -528,7 +528,7 @@ bin_enable(char *name, char **argv, Options ops, int func) /**/ int -bin_set(char *nam, char **args, Options ops, int func) +bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { int action, optno, array = 0, hadopt = 0, hadplus = 0, hadend = 0, sort = 0; @@ -656,7 +656,7 @@ int doprintdir = 0; /* set in exec.c (for autocd) */ /**/ int -bin_pwd(char *name, char **argv, Options ops, int func) +bin_pwd(UNUSED(char *name), UNUSED(char **argv), Options ops, UNUSED(int func)) { if (OPT_ISSET(ops,'r') || OPT_ISSET(ops,'P') || (isset(CHASELINKS) && !OPT_ISSET(ops,'L'))) @@ -677,7 +677,7 @@ mod_export LinkList dirstack; /**/ int -bin_dirs(char *name, char **argv, Options ops, int func) +bin_dirs(UNUSED(char *name), char **argv, Options ops, UNUSED(int func)) { LinkList l; @@ -1722,7 +1722,7 @@ enum { /**/ static Param -typeset_single(char *cname, char *pname, Param pm, int func, +typeset_single(char *cname, char *pname, Param pm, UNUSED(int func), int on, int off, int roff, char *value, Param altpm, Options ops, int auxlen, int joinchar) { @@ -2914,7 +2914,7 @@ bin_whence(char *nam, char **argv, Options ops, int func) /**/ int -bin_hash(char *name, char **argv, Options ops, int func) +bin_hash(char *name, char **argv, Options ops, UNUSED(int func)) { HashTable ht; Patprog pprog; @@ -3017,7 +3017,7 @@ bin_hash(char *name, char **argv, Options ops, int func) /**/ int -bin_unhash(char *name, char **argv, Options ops, int func) +bin_unhash(char *name, char **argv, Options ops, UNUSED(int func)) { HashTable ht; HashNode hn, nhn; @@ -3089,7 +3089,7 @@ bin_unhash(char *name, char **argv, Options ops, int func) /**/ int -bin_alias(char *name, char **argv, Options ops, int func) +bin_alias(char *name, char **argv, Options ops, UNUSED(int func)) { Alias a; Patprog pprog; @@ -3189,7 +3189,7 @@ bin_alias(char *name, char **argv, Options ops, int func) /**/ int -bin_true(char *name, char **argv, Options ops, int func) +bin_true(UNUSED(char *name), UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { return 0; } @@ -3198,7 +3198,7 @@ bin_true(char *name, char **argv, Options ops, int func) /**/ int -bin_false(char *name, char **argv, Options ops, int func) +bin_false(UNUSED(char *name), UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { return 1; } @@ -3829,7 +3829,7 @@ bin_print(char *name, char **args, Options ops, int func) /**/ int -bin_shift(char *name, char **argv, Options ops, int func) +bin_shift(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { int num = 1, l, ret = 0; char **s; @@ -3880,7 +3880,7 @@ int optcind; /**/ int -bin_getopts(char *name, char **argv, Options ops, int func) +bin_getopts(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int func)) { int lenstr, lenoptstr, quiet, lenoptbuf; char *optstr = unmetafy(*argv++, &lenoptstr), *var = *argv++; @@ -3987,7 +3987,7 @@ exit_pending; /**/ int -bin_break(char *name, char **argv, Options ops, int func) +bin_break(char *name, char **argv, UNUSED(Options ops), int func) { int num = lastval, nump = 0; @@ -4138,7 +4138,7 @@ zexit(int val, int from_where) /**/ int -bin_dot(char *name, char **argv, Options ops, int func) +bin_dot(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { char **old, *old0 = NULL; int ret, diddot = 0, dotdot = 0; @@ -4216,7 +4216,7 @@ bin_dot(char *name, char **argv, Options ops, int func) /**/ int -bin_emulate(char *nam, char **argv, Options ops, int func) +bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func)) { emulate(*argv, OPT_ISSET(ops,'R')); if (OPT_ISSET(ops,'L')) @@ -4228,7 +4228,7 @@ bin_emulate(char *nam, char **argv, Options ops, int func) /**/ int -bin_eval(char *nam, char **argv, Options ops, int func) +bin_eval(UNUSED(char *nam), char **argv, UNUSED(Options ops), UNUSED(int func)) { Eprog prog; char *oscriptname = scriptname; @@ -4266,7 +4266,7 @@ file/buffer. */ /**/ int -bin_read(char *name, char **args, Options ops, int func) +bin_read(char *name, char **args, Options ops, UNUSED(int func)) { char *reply, *readpmpt; int bsiz, c = 0, gotnl = 0, al = 0, first, nchars = 1, bslash, keys = 0; @@ -4791,7 +4791,7 @@ testlex(void) /**/ int -bin_test(char *name, char **argv, Options ops, int func) +bin_test(char *name, char **argv, UNUSED(Options ops), int func) { char **s; Eprog prog; @@ -4846,7 +4846,7 @@ bin_test(char *name, char **argv, Options ops, int func) /**/ int -bin_times(char *name, char **argv, Options ops, int func) +bin_times(UNUSED(char *name), UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { struct tms buf; @@ -4868,7 +4868,7 @@ bin_times(char *name, char **argv, Options ops, int func) /**/ int -bin_trap(char *name, char **argv, Options ops, int func) +bin_trap(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) { Eprog prog; char *arg, *s; @@ -4944,7 +4944,7 @@ bin_trap(char *name, char **argv, Options ops, int func) /**/ int -bin_ttyctl(char *name, char **argv, Options ops, int func) +bin_ttyctl(UNUSED(char *name), UNUSED(char **argv), Options ops, UNUSED(int func)) { if (OPT_ISSET(ops,'f')) ttyfrozen = 1; @@ -4959,7 +4959,7 @@ bin_ttyctl(char *name, char **argv, Options ops, int func) /**/ int -bin_let(char *name, char **argv, Options ops, int func) +bin_let(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int func)) { mnumber val = zero_mnumber; @@ -4978,7 +4978,7 @@ bin_let(char *name, char **argv, Options ops, int func) /**/ int -bin_umask(char *nam, char **args, Options ops, int func) +bin_umask(char *nam, char **args, Options ops, UNUSED(int func)) { mode_t um; char *s = *args; @@ -5089,7 +5089,7 @@ bin_umask(char *nam, char **args, Options ops, int func) /**/ mod_export int -bin_notavail(char *nam, char **argv, Options ops, int func) +bin_notavail(char *nam, UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { zwarnnam(nam, "not available on this system", NULL, 0); return 1; diff --git a/Src/exec.c b/Src/exec.c index 2af94f582..418e8c67f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -444,7 +444,7 @@ isgooderr(int e, char *dir) /**/ void -execute(Cmdnam not_used_yet, int dash, int defpath) +execute(UNUSED(Cmdnam cmdname), int dash, int defpath) { Cmdnam cn; char buf[MAXCMDLEN], buf2[MAXCMDLEN]; @@ -3157,7 +3157,7 @@ extern int tracingcond; /**/ static int -execcond(Estate state, int do_exec) +execcond(Estate state, UNUSED(int do_exec)) { int stat; @@ -3182,7 +3182,7 @@ execcond(Estate state, int do_exec) /**/ static int -execarith(Estate state, int do_exec) +execarith(Estate state, UNUSED(int do_exec)) { char *e; mnumber val = zero_mnumber; @@ -3216,7 +3216,7 @@ execarith(Estate state, int do_exec) /**/ static int -exectime(Estate state, int do_exec) +exectime(Estate state, UNUSED(int do_exec)) { int jb; @@ -3234,7 +3234,7 @@ exectime(Estate state, int do_exec) /**/ static int -execfuncdef(Estate state, int do_exec) +execfuncdef(Estate state, UNUSED(int do_exec)) { Shfunc shf; char *s; @@ -3364,7 +3364,7 @@ execshfunc(Shfunc shf, LinkList args) /**/ static int -execautofn(Estate state, int do_exec) +execautofn(Estate state, UNUSED(int do_exec)) { Shfunc shf; char *oldscriptname; diff --git a/Src/glob.c b/Src/glob.c index 8eca74cb2..85111a190 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -2560,7 +2560,7 @@ remnulargs(char *s) /**/ static int -qualdev(char *name, struct stat *buf, off_t dv, char *dummy) +qualdev(UNUSED(char *name), struct stat *buf, off_t dv, UNUSED(char *dummy)) { return (off_t)buf->st_dev == dv; } @@ -2569,7 +2569,7 @@ qualdev(char *name, struct stat *buf, off_t dv, char *dummy) /**/ static int -qualnlink(char *name, struct stat *buf, off_t ct, char *dummy) +qualnlink(UNUSED(char *name), struct stat *buf, off_t ct, UNUSED(char *dummy)) { return (g_range < 0 ? buf->st_nlink < ct : g_range > 0 ? buf->st_nlink > ct : @@ -2580,7 +2580,7 @@ qualnlink(char *name, struct stat *buf, off_t ct, char *dummy) /**/ static int -qualuid(char *name, struct stat *buf, off_t uid, char *dummy) +qualuid(UNUSED(char *name), struct stat *buf, off_t uid, UNUSED(char *dummy)) { return buf->st_uid == uid; } @@ -2589,7 +2589,7 @@ qualuid(char *name, struct stat *buf, off_t uid, char *dummy) /**/ static int -qualgid(char *name, struct stat *buf, off_t gid, char *dummy) +qualgid(UNUSED(char *name), struct stat *buf, off_t gid, UNUSED(char *dummy)) { return buf->st_gid == gid; } @@ -2598,7 +2598,7 @@ qualgid(char *name, struct stat *buf, off_t gid, char *dummy) /**/ static int -qualisdev(char *name, struct stat *buf, off_t junk, char *dummy) +qualisdev(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISBLK(buf->st_mode) || S_ISCHR(buf->st_mode); } @@ -2607,7 +2607,7 @@ qualisdev(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualisblk(char *name, struct stat *buf, off_t junk, char *dummy) +qualisblk(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISBLK(buf->st_mode); } @@ -2616,7 +2616,7 @@ qualisblk(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualischr(char *name, struct stat *buf, off_t junk, char *dummy) +qualischr(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISCHR(buf->st_mode); } @@ -2625,7 +2625,7 @@ qualischr(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualisdir(char *name, struct stat *buf, off_t junk, char *dummy) +qualisdir(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISDIR(buf->st_mode); } @@ -2634,7 +2634,7 @@ qualisdir(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualisfifo(char *name, struct stat *buf, off_t junk, char *dummy) +qualisfifo(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISFIFO(buf->st_mode); } @@ -2643,7 +2643,7 @@ qualisfifo(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualislnk(char *name, struct stat *buf, off_t junk, char *dummy) +qualislnk(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISLNK(buf->st_mode); } @@ -2652,7 +2652,7 @@ qualislnk(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualisreg(char *name, struct stat *buf, off_t junk, char *dummy) +qualisreg(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISREG(buf->st_mode); } @@ -2661,7 +2661,7 @@ qualisreg(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualissock(char *name, struct stat *buf, off_t junk, char *dummy) +qualissock(UNUSED(char *name), struct stat *buf, UNUSED(off_t junk), UNUSED(char *dummy)) { return S_ISSOCK(buf->st_mode); } @@ -2670,7 +2670,7 @@ qualissock(char *name, struct stat *buf, off_t junk, char *dummy) /**/ static int -qualflags(char *name, struct stat *buf, off_t mod, char *dummy) +qualflags(UNUSED(char *name), struct stat *buf, off_t mod, UNUSED(char *dummy)) { return mode_to_octal(buf->st_mode) & mod; } @@ -2679,7 +2679,7 @@ qualflags(char *name, struct stat *buf, off_t mod, char *dummy) /**/ static int -qualmodeflags(char *name, struct stat *buf, off_t mod, char *dummy) +qualmodeflags(UNUSED(char *name), struct stat *buf, off_t mod, UNUSED(char *dummy)) { long v = mode_to_octal(buf->st_mode), y = mod & 07777, n = mod >> 12; @@ -2690,7 +2690,7 @@ qualmodeflags(char *name, struct stat *buf, off_t mod, char *dummy) /**/ static int -qualiscom(char *name, struct stat *buf, off_t mod, char *dummy) +qualiscom(UNUSED(char *name), struct stat *buf, UNUSED(off_t mod), UNUSED(char *dummy)) { return S_ISREG(buf->st_mode) && (buf->st_mode & S_IXUGO); } @@ -2699,7 +2699,7 @@ qualiscom(char *name, struct stat *buf, off_t mod, char *dummy) /**/ static int -qualsize(char *name, struct stat *buf, off_t size, char *dummy) +qualsize(UNUSED(char *name), struct stat *buf, off_t size, UNUSED(char *dummy)) { #if defined(LONG_IS_64_BIT) || defined(OFF_T_IS_64_BIT) # define QS_CAST_SIZE() @@ -2734,7 +2734,7 @@ qualsize(char *name, struct stat *buf, off_t size, char *dummy) /**/ static int -qualtime(char *name, struct stat *buf, off_t days, char *dummy) +qualtime(UNUSED(char *name), struct stat *buf, off_t days, UNUSED(char *dummy)) { time_t now, diff; @@ -2769,7 +2769,7 @@ qualtime(char *name, struct stat *buf, off_t days, char *dummy) /**/ static int -qualsheval(char *name, struct stat *buf, off_t days, char *str) +qualsheval(char *name, UNUSED(struct stat *buf), UNUSED(off_t days), char *str) { Eprog prog; @@ -2805,7 +2805,7 @@ qualsheval(char *name, struct stat *buf, off_t days, char *str) /**/ static int -qualnonemptydir(char *name, struct stat *buf, off_t days, char *str) +qualnonemptydir(char *name, struct stat *buf, UNUSED(off_t days), UNUSED(char *str)) { DIR *dirh; struct dirent *de; diff --git a/Src/hashtable.c b/Src/hashtable.c index a47530f42..b06800b41 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -92,7 +92,7 @@ hasher(char *str) /**/ mod_export HashTable -newhashtable(int size, char const *name, PrintTableStats printinfo) +newhashtable(int size, UNUSED(char const *name), UNUSED(PrintTableStats printinfo)) { HashTable ht; @@ -315,7 +315,7 @@ removehashnode(HashTable ht, char *nam) /**/ void -disablehashnode(HashNode hn, int flags) +disablehashnode(HashNode hn, UNUSED(int flags)) { hn->flags |= DISABLED; } @@ -324,7 +324,7 @@ disablehashnode(HashNode hn, int flags) /**/ void -enablehashnode(HashNode hn, int flags) +enablehashnode(HashNode hn, UNUSED(int flags)) { hn->flags &= ~DISABLED; } @@ -670,7 +670,7 @@ hashdir(char **dirp) /**/ static void -fillcmdnamtable(HashTable ht) +fillcmdnamtable(UNUSED(HashTable ht)) { char **pq; @@ -794,7 +794,7 @@ createshfunctable(void) /**/ static HashNode -removeshfuncnode(HashTable ht, char *nam) +removeshfuncnode(UNUSED(HashTable ht), char *nam) { HashNode hn; int signum; @@ -813,7 +813,7 @@ removeshfuncnode(HashTable ht, char *nam) /**/ static void -disableshfuncnode(HashNode hn, int flags) +disableshfuncnode(HashNode hn, UNUSED(int flags)) { hn->flags |= DISABLED; if (!strncmp(hn->nam, "TRAP", 4)) { @@ -830,7 +830,7 @@ disableshfuncnode(HashNode hn, int flags) /**/ static void -enableshfuncnode(HashNode hn, int flags) +enableshfuncnode(HashNode hn, UNUSED(int flags)) { Shfunc shf = (Shfunc) hn; @@ -1274,7 +1274,7 @@ add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dumm /**/ static void -fillnameddirtable(HashTable ht) +fillnameddirtable(UNUSED(HashTable ht)) { if (!allusersadded) { #if defined(HAVE_NIS) || defined(HAVE_NIS_PLUS) diff --git a/Src/hist.c b/Src/hist.c index 139767dce..0a2226341 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -708,7 +708,7 @@ strinend(void) * they aren't needed */ static void -nohw(int c) +nohw(UNUSED(int c)) { } diff --git a/Src/init.c b/Src/init.c index 9591671da..60e7d3609 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1108,7 +1108,7 @@ noop_function(void) /**/ mod_export void -noop_function_int(int nothing) +noop_function_int(UNUSED(int nothing)) { /* do nothing */ } @@ -1158,7 +1158,7 @@ autoload_zleread(char *lp, char *rp, int ha, int con) /**/ mod_export unsigned char * -fallback_zleread(char *lp, char *rp, int ha, int con) +fallback_zleread(char *lp, UNUSED(char *rp), UNUSED(int ha), UNUSED(int con)) { char *pptbuf; int pptlen; @@ -1187,7 +1187,7 @@ mod_export CompctlReadFn compctlreadptr = fallback_compctlread; /**/ mod_export int -fallback_compctlread(char *name, char **args, Options ops, char *reply) +fallback_compctlread(char *name, UNUSED(char **args), UNUSED(Options ops), UNUSED(char *reply)) { zwarnnam(name, "option valid only in functions called from completion", NULL, 0); @@ -1201,7 +1201,7 @@ fallback_compctlread(char *name, char **args, Options ops, char *reply) /**/ mod_export int -zsh_main(int argc, char **argv) +zsh_main(UNUSED(int argc), char **argv) { char **t; int t0; diff --git a/Src/jobs.c b/Src/jobs.c index 4cef396da..a24208759 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1672,7 +1672,7 @@ bin_fg(char *name, char **argv, Options ops, int func) /**/ int -bin_kill(char *nam, char **argv, Options ops, int func) +bin_kill(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func)) { int sig = SIGTERM; int returnval = 0; @@ -1816,7 +1816,7 @@ bin_kill(char *nam, char **argv, Options ops, int func) /**/ int -bin_suspend(char *name, char **argv, Options ops, int func) +bin_suspend(char *name, UNUSED(char **argv), Options ops, UNUSED(int func)) { /* won't suspend a login shell, unless forced */ if (islogin && !OPT_ISSET(ops,'f')) { diff --git a/Src/loop.c b/Src/loop.c index ecb9821ad..f52f5e74e 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -196,7 +196,7 @@ execfor(Estate state, int do_exec) /**/ int -execselect(Estate state, int do_exec) +execselect(Estate state, UNUSED(int do_exec)) { Wordcode end, loop; wordcode code = state->pc[-1]; @@ -368,7 +368,7 @@ selectlist(LinkList l, size_t start) /**/ int -execwhile(Estate state, int do_exec) +execwhile(Estate state, UNUSED(int do_exec)) { Wordcode end, loop; wordcode code = state->pc[-1]; @@ -437,7 +437,7 @@ execwhile(Estate state, int do_exec) /**/ int -execrepeat(Estate state, int do_exec) +execrepeat(Estate state, UNUSED(int do_exec)) { Wordcode end, loop; wordcode code = state->pc[-1]; diff --git a/Src/mem.c b/Src/mem.c index b944c4d08..16537eba5 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -1462,7 +1462,7 @@ bin_mem(char *name, char **argv, Options ops, int func) /**/ mod_export void -zfree(void *p, int sz) +zfree(void *p, UNUSED(int sz)) { if (p) free(p); diff --git a/Src/module.c b/Src/module.c index 4a4807a31..3e1c0b177 100644 --- a/Src/module.c +++ b/Src/module.c @@ -42,28 +42,28 @@ LinkList linkedmodules; /**/ int -setup_(Module m) +setup_(UNUSED(Module m)) { return 0; } /**/ int -boot_(Module m) +boot_(UNUSED(Module m)) { return 0; } /**/ int -cleanup_(Module m) +cleanup_(UNUSED(Module m)) { return 0; } /**/ int -finish_(Module m) +finish_(UNUSED(Module m)) { return 0; } @@ -869,7 +869,7 @@ load_module(char const *name) /**/ mod_export int -require_module(char *nam, const char *module, int res, int test) +require_module(char *nam, const char *module, UNUSED(int res), int test) { Module m = NULL; LinkNode node; @@ -956,7 +956,7 @@ autoloadscan(HashNode hn, int printflags) /**/ int -bin_zmodload(char *nam, char **args, Options ops, int func) +bin_zmodload(char *nam, char **args, Options ops, UNUSED(int func)) { int ops_bcpf = OPT_ISSET(ops,'b') || OPT_ISSET(ops,'c') || OPT_ISSET(ops,'p') || OPT_ISSET(ops,'f'); @@ -1128,7 +1128,7 @@ bin_zmodload_alias(char *nam, char **args, Options ops) /**/ static int -bin_zmodload_exist(char *nam, char **args, Options ops) +bin_zmodload_exist(UNUSED(char *nam), char **args, Options ops) { LinkNode node; Module m; @@ -1167,7 +1167,7 @@ bin_zmodload_exist(char *nam, char **args, Options ops) /**/ static int -bin_zmodload_dep(char *nam, char **args, Options ops) +bin_zmodload_dep(UNUSED(char *nam), char **args, Options ops) { LinkNode node; Module m; @@ -1783,7 +1783,7 @@ deletehookdef(Hookdef h) /**/ mod_export int -deletehookdefs(char const *nam, Hookdef h, int size) +deletehookdefs(UNUSED(char const *nam), Hookdef h, int size) { while (size--) { deletehookdef(h); @@ -1932,7 +1932,7 @@ deleteparamdef(Paramdef d) /**/ mod_export int -deleteparamdefs(char const *nam, Paramdef d, int size) +deleteparamdefs(UNUSED(char const *nam), Paramdef d, int size) { while (size--) { deleteparamdef(d); diff --git a/Src/options.c b/Src/options.c index 1172f4728..21d9d00ed 100644 --- a/Src/options.c +++ b/Src/options.c @@ -486,7 +486,7 @@ setoption(HashNode hn, int value) /**/ int -bin_setopt(char *nam, char **args, Options ops, int isun) +bin_setopt(char *nam, char **args, UNUSED(Options ops), int isun) { int action, optno, match = 0; @@ -697,7 +697,7 @@ dosetopt(int optno, int value, int force) /**/ char * -dashgetfn(Param pm) +dashgetfn(UNUSED(Param pm)) { static char buf[LAST_OPT - FIRST_OPT + 2]; char *val = buf; @@ -763,7 +763,7 @@ printoptionlist(void) /**/ static void -printoptionlist_printoption(HashNode hn, int ignored) +printoptionlist_printoption(HashNode hn, UNUSED(int ignored)) { Optname on = (Optname) hn; diff --git a/Src/params.c b/Src/params.c index 3726fe720..8b0c87dac 100644 --- a/Src/params.c +++ b/Src/params.c @@ -329,7 +329,7 @@ static HashTable outtable; /**/ static void -scancopyparams(HashNode hn, int flags) +scancopyparams(HashNode hn, UNUSED(int flags)) { /* Going into a real parameter, so always use permanent storage */ Param pm = (Param)hn; @@ -372,7 +372,7 @@ static unsigned numparamvals; /**/ mod_export void -scancountparams(HashNode hn, int flags) +scancountparams(UNUSED(HashNode hn), int flags) { ++numparamvals; if ((flags & SCANPM_WANTKEYS) && (flags & SCANPM_WANTVALS)) @@ -2311,7 +2311,7 @@ unsetparam_pm(Param pm, int altflag, int exp) /**/ mod_export void -stdunsetfn(Param pm, int exp) +stdunsetfn(Param pm, UNUSED(int exp)) { switch (PM_TYPE(pm->flags)) { case PM_SCALAR: pm->sets.cfn(pm, NULL); break; @@ -2482,14 +2482,14 @@ arrhashsetfn(Param pm, char **val, int augment) /**/ void -nullstrsetfn(Param pm, char *x) +nullstrsetfn(UNUSED(Param pm), char *x) { zsfree(x); } /**/ void -nullintsetfn(Param pm, zlong x) +nullintsetfn(UNUSED(Param pm), UNUSED(zlong x)) {} @@ -2671,7 +2671,7 @@ tiedarrsetfn(Param pm, char *x) /**/ void -tiedarrunsetfn(Param pm, int exp) +tiedarrunsetfn(Param pm, UNUSED(int exp)) { /* * Special unset function because we allocated a struct tieddata @@ -2724,7 +2724,7 @@ zhuniqarray(char **x) /**/ zlong -poundgetfn(Param pm) +poundgetfn(UNUSED(Param pm)) { return arrlen(pparams); } @@ -2733,7 +2733,7 @@ poundgetfn(Param pm) /**/ zlong -randomgetfn(Param pm) +randomgetfn(UNUSED(Param pm)) { return rand() & 0x7fff; } @@ -2742,7 +2742,7 @@ randomgetfn(Param pm) /**/ void -randomsetfn(Param pm, zlong v) +randomsetfn(UNUSED(Param pm), zlong v) { srand((unsigned int)v); } @@ -2767,7 +2767,7 @@ intsecondssetfn(Param pm, zlong x) /**/ double -floatsecondsgetfn(Param pm) +floatsecondsgetfn(UNUSED(Param pm)) { struct timeval now; struct timezone dummy_tz; @@ -2780,7 +2780,7 @@ floatsecondsgetfn(Param pm) /**/ void -floatsecondssetfn(Param pm, double x) +floatsecondssetfn(UNUSED(Param pm), double x) { struct timeval now; struct timezone dummy_tz; @@ -2832,7 +2832,7 @@ setsecondstype(Param pm, int on, int off) /**/ char * -usernamegetfn(Param pm) +usernamegetfn(UNUSED(Param pm)) { return get_username(); } @@ -2841,7 +2841,7 @@ usernamegetfn(Param pm) /**/ void -usernamesetfn(Param pm, char *x) +usernamesetfn(UNUSED(Param pm), char *x) { #if defined(HAVE_SETUID) && defined(HAVE_GETPWNAM) struct passwd *pswd; @@ -2864,7 +2864,7 @@ usernamesetfn(Param pm, char *x) /**/ zlong -uidgetfn(Param pm) +uidgetfn(UNUSED(Param pm)) { return getuid(); } @@ -2873,7 +2873,7 @@ uidgetfn(Param pm) /**/ void -uidsetfn(Param pm, uid_t x) +uidsetfn(UNUSED(Param pm), uid_t x) { #ifdef HAVE_SETUID setuid(x); @@ -2884,7 +2884,7 @@ uidsetfn(Param pm, uid_t x) /**/ zlong -euidgetfn(Param pm) +euidgetfn(UNUSED(Param pm)) { return geteuid(); } @@ -2893,7 +2893,7 @@ euidgetfn(Param pm) /**/ void -euidsetfn(Param pm, uid_t x) +euidsetfn(UNUSED(Param pm), uid_t x) { #ifdef HAVE_SETEUID seteuid(x); @@ -2904,7 +2904,7 @@ euidsetfn(Param pm, uid_t x) /**/ zlong -gidgetfn(Param pm) +gidgetfn(UNUSED(Param pm)) { return getgid(); } @@ -2913,7 +2913,7 @@ gidgetfn(Param pm) /**/ void -gidsetfn(Param pm, gid_t x) +gidsetfn(UNUSED(Param pm), gid_t x) { #ifdef HAVE_SETUID setgid(x); @@ -2924,7 +2924,7 @@ gidsetfn(Param pm, gid_t x) /**/ zlong -egidgetfn(Param pm) +egidgetfn(UNUSED(Param pm)) { return getegid(); } @@ -2933,7 +2933,7 @@ egidgetfn(Param pm) /**/ void -egidsetfn(Param pm, gid_t x) +egidsetfn(UNUSED(Param pm), gid_t x) { #ifdef HAVE_SETEUID setegid(x); @@ -2942,7 +2942,7 @@ egidsetfn(Param pm, gid_t x) /**/ zlong -ttyidlegetfn(Param pm) +ttyidlegetfn(UNUSED(Param pm)) { struct stat ttystat; @@ -2955,7 +2955,7 @@ ttyidlegetfn(Param pm) /**/ char * -ifsgetfn(Param pm) +ifsgetfn(UNUSED(Param pm)) { return ifs; } @@ -2964,7 +2964,7 @@ ifsgetfn(Param pm) /**/ void -ifssetfn(Param pm, char *x) +ifssetfn(UNUSED(Param pm), char *x) { zsfree(ifs); ifs = x; @@ -3056,7 +3056,7 @@ lcsetfn(Param pm, char *x) /**/ zlong -histsizegetfn(Param pm) +histsizegetfn(UNUSED(Param pm)) { return histsiz; } @@ -3065,7 +3065,7 @@ histsizegetfn(Param pm) /**/ void -histsizesetfn(Param pm, zlong v) +histsizesetfn(UNUSED(Param pm), zlong v) { if ((histsiz = v) < 1) histsiz = 1; @@ -3076,7 +3076,7 @@ histsizesetfn(Param pm, zlong v) /**/ zlong -savehistsizegetfn(Param pm) +savehistsizegetfn(UNUSED(Param pm)) { return savehistsiz; } @@ -3085,7 +3085,7 @@ savehistsizegetfn(Param pm) /**/ void -savehistsizesetfn(Param pm, zlong v) +savehistsizesetfn(UNUSED(Param pm), zlong v) { if ((savehistsiz = v) < 0) savehistsiz = 0; @@ -3095,7 +3095,7 @@ savehistsizesetfn(Param pm, zlong v) /**/ void -errnosetfn(Param pm, zlong x) +errnosetfn(UNUSED(Param pm), zlong x) { errno = (int)x; } @@ -3104,7 +3104,7 @@ errnosetfn(Param pm, zlong x) /**/ zlong -errnogetfn(Param pm) +errnogetfn(UNUSED(Param pm)) { return errno; } @@ -3113,7 +3113,7 @@ errnogetfn(Param pm) /**/ char * -histcharsgetfn(Param pm) +histcharsgetfn(UNUSED(Param pm)) { static char buf[4]; @@ -3128,7 +3128,7 @@ histcharsgetfn(Param pm) /**/ void -histcharssetfn(Param pm, char *x) +histcharssetfn(UNUSED(Param pm), char *x) { if (x) { bangchar = x[0]; @@ -3147,7 +3147,7 @@ histcharssetfn(Param pm, char *x) /**/ char * -homegetfn(Param pm) +homegetfn(UNUSED(Param pm)) { return home; } @@ -3156,7 +3156,7 @@ homegetfn(Param pm) /**/ void -homesetfn(Param pm, char *x) +homesetfn(UNUSED(Param pm), char *x) { zsfree(home); if (x && isset(CHASELINKS) && (home = xsymlink(x))) @@ -3170,7 +3170,7 @@ homesetfn(Param pm, char *x) /**/ char * -wordcharsgetfn(Param pm) +wordcharsgetfn(UNUSED(Param pm)) { return wordchars; } @@ -3179,7 +3179,7 @@ wordcharsgetfn(Param pm) /**/ void -wordcharssetfn(Param pm, char *x) +wordcharssetfn(UNUSED(Param pm), char *x) { zsfree(wordchars); wordchars = x; @@ -3190,7 +3190,7 @@ wordcharssetfn(Param pm, char *x) /**/ char * -underscoregetfn(Param pm) +underscoregetfn(UNUSED(Param pm)) { char *u = dupstring(underscore); @@ -3202,7 +3202,7 @@ underscoregetfn(Param pm) /**/ char * -termgetfn(Param pm) +termgetfn(UNUSED(Param pm)) { return term; } @@ -3211,7 +3211,7 @@ termgetfn(Param pm) /**/ void -termsetfn(Param pm, char *x) +termsetfn(UNUSED(Param pm), char *x) { zsfree(term); term = x ? x : ztrdup(""); @@ -3227,7 +3227,7 @@ termsetfn(Param pm, char *x) /**/ static char ** -pipestatgetfn(Param pm) +pipestatgetfn(UNUSED(Param pm)) { char **x = (char **) zhalloc((numpipestats + 1) * sizeof(char *)); char buf[20], **p; @@ -3246,7 +3246,7 @@ pipestatgetfn(Param pm) /**/ static void -pipestatsetfn(Param pm, char **x) +pipestatsetfn(UNUSED(Param pm), char **x) { if (x) { int i; @@ -3591,7 +3591,7 @@ endparamscope(void) /**/ static void -scanendscope(HashNode hn, int flags) +scanendscope(HashNode hn, UNUSED(int flags)) { Param pm = (Param)hn; if (pm->level > locallevel) { diff --git a/Src/parse.c b/Src/parse.c index b58652fe4..2f9319977 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -2400,7 +2400,7 @@ dump_find_func(Wordcode h, char *name) /**/ int -bin_zcompile(char *nam, char **args, Options ops, int func) +bin_zcompile(char *nam, char **args, Options ops, UNUSED(int func)) { int map, flags, ret; char *dump; diff --git a/Src/subst.c b/Src/subst.c index f281bda50..189ecda6e 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -280,7 +280,7 @@ static int mult_isarr; /**/ static int -multsub(char **s, char ***a, int *isarr, char *sep) +multsub(char **s, char ***a, int *isarr, UNUSED(char *sep)) { int l, omi = mult_isarr; char **r, **p; diff --git a/Src/utils.c b/Src/utils.c index 8b3bba5d8..678376eae 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -476,7 +476,7 @@ static int finddir_best; /**/ static void -finddir_scan(HashNode hn, int flags) +finddir_scan(HashNode hn, UNUSED(int flags)) { Nameddir nd = (Nameddir) hn; @@ -1551,7 +1551,7 @@ static char *guess, *best; /**/ static void -spscan(HashNode hn, int scanflags) +spscan(HashNode hn, UNUSED(int scanflags)) { int nd; diff --git a/Src/watch.c b/Src/watch.c index e2a65207c..c12625c85 100644 --- a/Src/watch.c +++ b/Src/watch.c @@ -559,7 +559,7 @@ dowatch(void) /**/ int -bin_log(char *nam, char **argv, Options ops, int func) +bin_log(UNUSED(char *nam), UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { if (!watch) return 1; |