From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11935 invoked by alias); 2 Feb 2016 15:45:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37868 Received: (qmail 14629 invoked from network); 2 Feb 2016 15:45:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [PATCH] add 'static' to file local variables Message-Id: <01700BC0-E152-4EA9-B650-70091DCE79CC@kba.biglobe.ne.jp> Date: Wed, 3 Feb 2016 00:06:39 +0900 To: zsh-workers@zsh.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 62340 Based on warnings from 'clang -Wmissing-variable-declarations'. In cond.c, add /**/ to tracingcond, which is global. --- Src/Modules/curses.c | 2 +- Src/Modules/param_private.c | 10 +++++----- Src/Modules/tcp.c | 2 +- Src/Modules/termcap.c | 2 +- Src/Modules/zftp.c | 8 ++++---- Src/Zle/complist.c | 2 +- Src/Zle/zle_misc.c | 2 +- Src/Zle/zle_utils.c | 4 ++-- Src/cond.c | 3 ++- Src/exec.c | 2 -- Src/glob.c | 2 +- Src/jobs.c | 6 +++--- Src/params.c | 2 +- Src/prompt.c | 2 +- Src/utils.c | 4 ++-- 15 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c index b8a79ed..a04841a 100644 --- a/Src/Modules/curses.c +++ b/Src/Modules/curses.c @@ -202,7 +202,7 @@ static const struct zcurses_mouse_event = zcurses_mouse_map[] =3D { { 0, 0, 0 } }; =20 -mmask_t zcurses_mouse_mask =3D ALL_MOUSE_EVENTS; +static mmask_t zcurses_mouse_mask =3D ALL_MOUSE_EVENTS; =20 #endif =20 diff --git a/Src/Modules/param_private.c b/Src/Modules/param_private.c index 2f51cb0..86416c5 100644 --- a/Src/Modules/param_private.c +++ b/Src/Modules/param_private.c @@ -42,19 +42,19 @@ struct gsu_closure { void *g; }; =20 -const struct gsu_scalar scalar_private_gsu =3D +static const struct gsu_scalar scalar_private_gsu =3D { pps_getfn, pps_setfn, pps_unsetfn }; =20 -const struct gsu_integer integer_private_gsu =3D +static const struct gsu_integer integer_private_gsu =3D { ppi_getfn, ppi_setfn, ppi_unsetfn }; =20 -const struct gsu_float float_private_gsu =3D +static const struct gsu_float float_private_gsu =3D { ppf_getfn, ppf_setfn, ppf_unsetfn }; =20 -const struct gsu_array array_private_gsu =3D +static const struct gsu_array array_private_gsu =3D { ppa_getfn, ppa_setfn, ppa_unsetfn }; =20 -const struct gsu_hash hash_private_gsu =3D +static const struct gsu_hash hash_private_gsu =3D { pph_getfn, pph_setfn, pph_unsetfn }; =20 /* diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index 5af6883..dec1214 100644 --- a/Src/Modules/tcp.c +++ b/Src/Modules/tcp.c @@ -208,7 +208,7 @@ freehostent(UNUSED(struct hostent *ptr)) /**/ #endif /* !HAVE_GETIPNODEBYNAME */ =20 -LinkList ztcp_sessions; +static LinkList ztcp_sessions; =20 /* "allocate" a tcp_session */ static Tcp_session diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c index 29c2836..60a6e13 100644 --- a/Src/Modules/termcap.c +++ b/Src/Modules/termcap.c @@ -295,7 +295,7 @@ scantermcap(UNUSED(HashTable ht), ScanFunc func, int = flags) } } =20 -struct paramdef partab[] =3D { +static struct paramdef partab[] =3D { SPECIALPMDEF("termcap", PM_READONLY, NULL, gettermcap, scantermcap) }; =20 diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index b4081df..deed35e 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -344,10 +344,10 @@ static int zfsesscnt; */ =20 /* flags for alarm set, alarm gone off */ -int zfalarmed, zfdrrrring; +static int zfalarmed, zfdrrrring; /* remember old alarm status */ -time_t oaltime; -unsigned int oalremain; +static time_t oaltime; +static unsigned int oalremain; =20 /* * Where to jump to when the alarm goes off. This is much @@ -357,7 +357,7 @@ unsigned int oalremain; * * gcc -O gives apparently spurious `may be clobbered by longjmp' = warnings. */ -jmp_buf zfalrmbuf; +static jmp_buf zfalrmbuf; =20 /* The signal handler itself */ =20 diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 0ccb885..06a07a4 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -113,7 +113,7 @@ static Cmgroup *mgtab, *mgtabp; * Allow us to keep track of pointer arithmetic for mgtab; could * just as well have been for mtab but wasn't. */ -int mgtabsize; +static int mgtabsize; #endif =20 /* diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 0483f75..25f65b3 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -1497,7 +1497,7 @@ struct suffixset { }; =20 /* The list of suffix structures */ -struct suffixset *suffixlist; +static struct suffixset *suffixlist; =20 /* Shell function to call to remove the suffix. */ =20 diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index a2c8810..68794c6 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -587,7 +587,7 @@ struct zle_position { }; =20 /* LIFO stack of positions */ -struct zle_position *zle_positions; +static struct zle_position *zle_positions; =20 /* * Save positions including cursor, end-of-line and @@ -1412,7 +1412,7 @@ zlong undo_changeno; =20 /* If positive, don't undo beyond this point */ =20 -zlong undo_limitno; +static zlong undo_limitno; =20 /**/ void diff --git a/Src/cond.c b/Src/cond.c index c5ab65e..0381fe9 100644 --- a/Src/cond.c +++ b/Src/cond.c @@ -30,7 +30,8 @@ #include "zsh.mdh" #include "cond.pro" =20 -int tracingcond; +/**/ +int tracingcond; /* updated by execcond() in exec.c */ =20 static char *condstr[COND_MOD] =3D { "!", "&&", "||", "=3D=3D", "!=3D", "<", ">", "-nt", "-ot", "-ef", = "-eq", diff --git a/Src/exec.c b/Src/exec.c index 352615c..b60fc90 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4518,8 +4518,6 @@ spawnpipes(LinkList l, int nullexec) } } =20 -extern int tracingcond; - /* evaluate a [[ ... ]] */ =20 /**/ diff --git a/Src/glob.c b/Src/glob.c index 69de155..2051016 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -306,7 +306,7 @@ statfullpath(const char *s, struct stat *st, int l) /* This may be set by qualifier functions to an array of strings to = insert * into the list instead of the original string. */ =20 -char **inserts; +static char **inserts; =20 /* add a match to the list */ =20 diff --git a/Src/jobs.c b/Src/jobs.c index b47ba8c..2a9dbe7 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1970,9 +1970,9 @@ struct bgstatus { }; typedef struct bgstatus *Bgstatus; /* The list of those entries */ -LinkList bgstatus_list; +static LinkList bgstatus_list; /* Count of entries. Reaches value of _SC_CHILD_MAX and stops. */ -long bgstatus_count; +static long bgstatus_count; =20 /* * Remove and free a bgstatus entry. @@ -2372,7 +2372,7 @@ bin_fg(char *name, char **argv, Options ops, int = func) return retval; } =20 -const struct { +static const struct { const char *name; int num; } alt_sigs[] =3D { diff --git a/Src/params.c b/Src/params.c index a1f0292..76ed61c 100644 --- a/Src/params.c +++ b/Src/params.c @@ -416,7 +416,7 @@ IPDEF10("pipestatus", pipestatus_gsu), * and $@, this is not readonly. This parameter is not directly * visible in user space. */ -initparam argvparam_pm =3D IPDEF9F("", &pparams, NULL, \ +static initparam argvparam_pm =3D IPDEF9F("", &pparams, NULL, \ PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT); =20 #undef BR diff --git a/Src/prompt.c b/Src/prompt.c index be067ee..831c4f9 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -1831,7 +1831,7 @@ struct colour_sequences { char *end; /* Escape sequence terminator */ char *def; /* Code to reset default colour */ }; -struct colour_sequences fg_bg_sequences[2]; +static struct colour_sequences fg_bg_sequences[2]; =20 /* * We need a buffer for colour sequence composition. It may diff --git a/Src/utils.c b/Src/utils.c index 053731c..de4af5a 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -56,12 +56,12 @@ typedef struct widechar_array *Widechar_array; * The wordchars variable turned into a wide character array. * This is much more convenient for testing. */ -struct widechar_array wordchars_wide; +static struct widechar_array wordchars_wide; =20 /* * The same for the separators (IFS) array. */ -struct widechar_array ifs_wide; +static struct widechar_array ifs_wide; =20 /* Function to set one of the above from the multibyte array */ =20 --=20 1.9.5 (Apple Git-50.3)