From 8fc74498394810e3744518e76d2e73b18c2dce8e Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Fri, 29 Jan 2010 19:17:02 -0500 Subject: [PATCH] uemacs: fix sparse warnings, making file-local symbols static. ansi.c:255:6: warning: symbol 'ansihello' was not declared. Should it be static? epath.h:11:6: warning: symbol 'pathname' was not declared. Should it be static? display.c:36:7: warning: symbol 'vscreen' was not declared. Should it be static? display.c:38:7: warning: symbol 'pscreen' was not declared. Should it be static? display.c:927:5: warning: symbol 'updateline' was not declared. Should it be static? evar.h:20:6: warning: symbol 'uv' was not declared. Should it be static? evar.h:24:6: warning: symbol 'envars' was not declared. Should it be static? evar.h:128:7: warning: symbol 'funcs' was not declared. Should it be static? fileio.c:14:6: warning: symbol 'ffp' was not declared. Should it be static? fileio.c:15:5: warning: symbol 'eofflag' was not declared. Should it be static? ibmpc.c:505:6: warning: symbol 'ibmhello' was not declared. Should it be static? isearch.c:36:5: warning: symbol 'saved_get_char' was not declared. Should it be static? isearch.c:37:5: warning: symbol 'eaten_char' was not declared. Should it be static? isearch.c:41:5: warning: symbol 'cmd_buff' was not declared. Should it be static? isearch.c:42:5: warning: symbol 'cmd_offset' was not declared. Should it be static? isearch.c:43:5: warning: symbol 'cmd_reexecute' was not declared. Should it be static? line.c:21:6: warning: symbol 'ykbuf' was not declared. Should it be static? line.c:22:5: warning: symbol 'ykboff' was not declared. Should it be static? lock.c:17:6: warning: symbol 'lname' was not declared. Should it be static? lock.c:18:5: warning: symbol 'numlocks' was not declared. Should it be static? vmsvt.c:521:6: warning: symbol 'hellovms' was not declared. Should it be static? vt52.c:181:6: warning: symbol 'vt52hello' was not declared. Should it be static? Signed-off-by: Thiago Farina Signed-off-by: Linus Torvalds --- ansi.c | 2 +- display.c | 6 +++--- epath.h | 2 +- evar.h | 6 +++--- fileio.c | 4 ++-- ibmpc.c | 2 +- isearch.c | 14 +++++++------- line.c | 4 ++-- lock.c | 4 ++-- termio.c | 12 ++++++------ vmsvt.c | 2 +- vt52.c | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ansi.c b/ansi.c index 1658d0d..9b1072c 100644 --- a/ansi.c +++ b/ansi.c @@ -252,7 +252,7 @@ int f, n; /* default flag, numeric argument [unused] */ } #endif #else -void ansihello(void) +static void ansihello(void) { } #endif diff --git a/display.c b/display.c index 2129d2b..67a0636 100644 --- a/display.c +++ b/display.c @@ -33,9 +33,9 @@ typedef struct VIDEO { #define VFREQ 0x0008 /* reverse video request */ #define VFCOL 0x0010 /* color change requested */ -VIDEO **vscreen; /* Virtual screen. */ +static VIDEO **vscreen; /* Virtual screen. */ #if MEMMAP == 0 || SCROLLCODE -VIDEO **pscreen; /* Physical screen. */ +static VIDEO **pscreen; /* Physical screen. */ #endif static int displaying = TRUE; @@ -924,7 +924,7 @@ static int updateline(int row, struct VIDEO *vp1, struct VIDEO *vp2) * struct VIDEO *vp1; virtual screen image * struct VIDEO *vp2; physical screen image */ -int updateline(int row, struct VIDEO *vp1, struct VIDEO *vp2) +static int updateline(int row, struct VIDEO *vp1, struct VIDEO *vp2) { #if RAINBOW /* UPDATELINE specific code for the DEC rainbow 100 micro */ diff --git a/epath.h b/epath.h index 5a3705a..1a6b7fe 100644 --- a/epath.h +++ b/epath.h @@ -8,7 +8,7 @@ /* possible names and paths of help files under different OSs */ -char *pathname[] = +static char *pathname[] = #if MSDOS { "emacs.rc", diff --git a/evar.h b/evar.h index d693176..9d9e9f7 100644 --- a/evar.h +++ b/evar.h @@ -17,11 +17,11 @@ typedef struct UVAR { #define MAXVARS 255 -UVAR uv[MAXVARS + 1]; /* user variables */ +static UVAR uv[MAXVARS + 1]; /* user variables */ /* list of recognized environment variables */ -char *envars[] = { +static char *envars[] = { "fillcol", /* current fill column */ "pagelen", /* number of lines used by editor */ "curcol", /* current column pos of cursor */ @@ -125,7 +125,7 @@ typedef struct UFUNC { #define DYNAMIC 2 #define TRINAMIC 3 -UFUNC funcs[] = { +static UFUNC funcs[] = { { "add", DYNAMIC }, /* add two numbers together */ { "sub", DYNAMIC }, /* subtraction */ { "tim", DYNAMIC }, /* multiplication */ diff --git a/fileio.c b/fileio.c index e3b12c7..6860585 100644 --- a/fileio.c +++ b/fileio.c @@ -11,8 +11,8 @@ #include "edef.h" #include "efunc.h" -FILE *ffp; /* File pointer, all functions. */ -int eofflag; /* end-of-file flag */ +static FILE *ffp; /* File pointer, all functions. */ +static int eofflag; /* end-of-file flag */ /* * Open a file for reading. diff --git a/ibmpc.c b/ibmpc.c index 3c09f4c..f184abc 100644 --- a/ibmpc.c +++ b/ibmpc.c @@ -502,7 +502,7 @@ int f, n; /* default flag, numeric argument [unused] */ } #endif #else -void ibmhello(void) +static void ibmhello(void) { } #endif diff --git a/isearch.c b/isearch.c index cf6b9f1..43b5e07 100644 --- a/isearch.c +++ b/isearch.c @@ -2,7 +2,7 @@ * * The functions in this file implement commands that perform incremental * searches in the forward and backward directions. This "ISearch" command - * is intended to emulate the same command from the original EMACS + * is intended to emulate the same command from the original EMACS * implementation (ITS). Contains references to routines internal to * SEARCH.C. * @@ -19,7 +19,7 @@ * checknext(), since there were no circumstances where * it ever equalled FALSE. * - * modified by Petri Kutvonen + * modified by Petri Kutvonen */ #include @@ -33,14 +33,14 @@ static int echo_char(int c, int col); /* A couple of "own" variables for re-eat */ -int (*saved_get_char) (); /* Get character routine */ -int eaten_char = -1; /* Re-eaten char */ +static int (*saved_get_char) (); /* Get character routine */ +static int eaten_char = -1; /* Re-eaten char */ /* A couple more "own" variables for the command string */ -int cmd_buff[CMDBUFLEN]; /* Save the command args here */ -int cmd_offset; /* Current offset into command buff */ -int cmd_reexecute = -1; /* > 0 if re-executing command */ +static int cmd_buff[CMDBUFLEN]; /* Save the command args here */ +static int cmd_offset; /* Current offset into command buff */ +static int cmd_reexecute = -1; /* > 0 if re-executing command */ /* diff --git a/line.c b/line.c index f4f9809..ece0093 100644 --- a/line.c +++ b/line.c @@ -18,8 +18,8 @@ #include "edef.h" #include "efunc.h" -KILL *ykbuf; /* ptr to current kill buffer chunk being yanked */ -int ykboff; /* offset into that chunk */ +static KILL *ykbuf; /* ptr to current kill buffer chunk being yanked */ +static int ykboff; /* offset into that chunk */ /* * This routine allocates a block of memory large enough to hold a LINE diff --git a/lock.c b/lock.c index 117bcd8..628e2ba 100644 --- a/lock.c +++ b/lock.c @@ -14,8 +14,8 @@ #if BSD | SVR4 #include -char *lname[NLOCKS]; /* names of all locked files */ -int numlocks; /* # of current locks active */ +static char *lname[NLOCKS]; /* names of all locked files */ +static int numlocks; /* # of current locks active */ /* * lockchk: diff --git a/termio.c b/termio.c index fb58672..3588256 100644 --- a/termio.c +++ b/termio.c @@ -97,7 +97,7 @@ char tobuf[TBUFSIZ]; /* terminal output buffer */ * On VMS, it translates TT until it finds the terminal, then assigns * a channel to it and sets it raw. On CPM it is a no-op. */ -ttopen() +void ttopen(void) { #if VMS struct dsc$descriptor idsc; @@ -168,7 +168,7 @@ ttopen() ntermio.c_line = otermio.c_line; ntermio.c_cc[VMIN] = 1; ntermio.c_cc[VTIME] = 0; -#if PKCODE +#if PKCODE ioctl(0, TCSETAW, &ntermio); /* and activate them */ #else ioctl(0, TCSETA, &ntermio); /* and activate them */ @@ -222,7 +222,7 @@ ttopen() * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -ttclose() +void ttclose(void) { #if VMS int status; @@ -269,7 +269,7 @@ ttclose() * On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on * MS-DOS (use the very very raw console output routine). */ -ttputc(c) +void ttputc(c) { #if VMS if (nobuf >= NOBUF) @@ -290,7 +290,7 @@ ttputc(c) * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -ttflush() +int ttflush(void) { #if VMS int status; @@ -305,7 +305,7 @@ ttflush() status = iosb[0] & 0xFFFF; nobuf = 0; } - return (status); + return status; #endif #if MSDOS diff --git a/vmsvt.c b/vmsvt.c index 338831d..9eaaf11 100644 --- a/vmsvt.c +++ b/vmsvt.c @@ -518,7 +518,7 @@ spal() * * Nothing returned ***/ -void hellovms(void) +static void hellovms(void) { } diff --git a/vt52.c b/vt52.c index 6e17683..190526e 100644 --- a/vt52.c +++ b/vt52.c @@ -178,7 +178,7 @@ int f, n; /* default flag, numeric argument [unused] */ #endif #else -void vt52hello(void) +static void vt52hello(void) { }