zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fix compiler warnings
@ 2001-04-09 20:12 Wayne Davison
  2001-04-09 20:25 ` Wayne Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Wayne Davison @ 2001-04-09 20:12 UTC (permalink / raw)
  To: Zsh Workers

[-- Attachment #1: Type: TEXT/PLAIN, Size: 324 bytes --]

The attached patch fixes an unused-variable warning, two warnings
about static variables that were defined but never used, and several
warnings about prototyped static functions that are never defined.
(All these warnings only showed up if HAVE_TIGETSTR was not defined.)

I went ahead and checked this into CVS.

..wayne..

[-- Attachment #2: silence some compiler warnings --]
[-- Type: TEXT/PLAIN, Size: 988 bytes --]

Index: Src/Modules/terminfo.c
@@ -30,13 +30,14 @@
 #include "terminfo.mdh"
 #include "terminfo.pro"
 
+/**/
+#ifdef HAVE_TIGETSTR
+
 static char terminfo_nam[] = "terminfo";
 static Param terminfo_pm;
 
 /* echoti: output a terminfo capability */
 
-#ifdef HAVE_TIGETSTR
-
 /**/
 static int
 bin_echoti(char *name, char **argv, char *ops, int func)
@@ -79,11 +80,13 @@
     return 0;
 }
 
-#else
+/**/
+#else /* !HAVE_TIGETSTR */
 
 #define bin_echoti bin_notavail
 
-#endif
+/**/
+#endif /* !HAVE_TIGETSTR */
 
 static struct builtin bintab[] = {
     BUILTIN("echoti", 0, bin_echoti, 1, -1, 0, NULL, NULL),
@@ -93,6 +96,7 @@
 
 static int incleanup;
 
+/**/
 #ifdef HAVE_TIGETSTR
 
 /* Empty dummy function for special hash parameters. */
@@ -195,6 +199,7 @@
 {
 }
 
+/**/
 #endif /* HAVE_TIGETSTR */
 
 /**/
@@ -225,7 +230,9 @@
 int
 cleanup_(Module m)
 {
+#ifdef HAVE_TIGETSTR
     Param pm;
+#endif
 
     incleanup = 1;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: fix compiler warnings
  2001-04-09 20:12 PATCH: fix compiler warnings Wayne Davison
@ 2001-04-09 20:25 ` Wayne Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Wayne Davison @ 2001-04-09 20:25 UTC (permalink / raw)
  To: Zsh Workers

On Mon, 9 Apr 2001, Wayne Davison wrote:
> The attached patch fixes [...] two warnings about static variables
> that were defined but never used

Sigh.  Bart's unposted change made one of the variables necessary in
the HAVE_TIGETSTR case, but I checked my change in before recompiling.
(Bad! Bad Wayne!)  I've fixed this in CVS.  The change looks like
this:

Index: Src/Modules/terminfo.c
@@ -30,10 +30,11 @@
 #include "terminfo.mdh"
 #include "terminfo.pro"

+static char terminfo_nam[] = "terminfo";
+
 /**/
 #ifdef HAVE_TIGETSTR

-static char terminfo_nam[] = "terminfo";
 static Param terminfo_pm;

 /* echoti: output a terminfo capability */

..wayne..


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-09 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-09 20:12 PATCH: fix compiler warnings Wayne Davison
2001-04-09 20:25 ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).