From 63e2f82211ae234275e07118cc6f1ad92f3e032a Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Sun, 29 Sep 2013 21:58:54 +0800 Subject: [PATCH] Move global variable to module scope (display, exec, input). --- display.c | 9 +++++++++ display.h | 2 ++ edef.h | 12 ------------ exec.c | 1 + globals.c | 10 ---------- input.c | 2 ++ 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/display.c b/display.c index 6255287..0542849 100644 --- a/display.c +++ b/display.c @@ -60,6 +60,15 @@ static int displaying = TRUE; int chg_width, chg_height; #endif +static int currow ; /* Cursor row */ +static int curcol ; /* Cursor column */ +static int vtrow = 0 ; /* Row location of SW cursor */ +static int vtcol = 0 ; /* Column location of SW cursor */ +static int lbound = 0 ; /* leftmost column of current line being displayed */ +static int taboff = 0 ; /* tab offset for display */ + +int mpresf = FALSE ; /* TRUE if message in last line */ + static int reframe(struct window *wp); static void updone(struct window *wp); static void updall(struct window *wp); diff --git a/display.h b/display.h index 74e2785..b5ecbd4 100644 --- a/display.h +++ b/display.h @@ -1,6 +1,8 @@ #ifndef _DISPLAY_H_ #define _DISPLAY_H_ +extern int mpresf ; /* Stuff in message line */ + void vtinit( void) ; void vtfree( void) ; void vttidy( void) ; diff --git a/edef.h b/edef.h index 07f45bc..10f2b08 100644 --- a/edef.h +++ b/edef.h @@ -38,23 +38,15 @@ extern int gbcolor; /* global backgrnd color (black) */ extern int gasave; /* global ASAVE size */ extern int gacount; /* count until next ASAVE */ extern int sgarbf; /* State of screen unknown */ -extern int mpresf; /* Stuff in message line */ extern int clexec; /* command line execution flag */ -extern int mstore; /* storing text to macro flag */ extern int discmd; /* display command flag */ extern int disinp; /* display input characters */ -extern int vtrow; /* Row location of SW cursor */ -extern int vtcol; /* Column location of SW cursor */ -extern int lbound; /* leftmost column of current line - being displayed */ -extern int taboff; /* tab offset for display */ extern int metac; /* current meta character */ extern int ctlxc; /* current control X prefix char */ extern int reptc; /* current universal repeat char */ extern int abortc; /* current abort command char */ -extern int quotec; /* quote char during mlreply() */ extern int tabmask; @@ -81,10 +73,6 @@ extern int scrollcount; /* number of lines to scroll */ /* Uninitialized global external declarations. */ -extern int currow; /* Cursor row */ -extern int curcol; /* Cursor column */ - - #define CFCPCN 0x0001 /* Last command was C-P, C-N */ #define CFKILL 0x0002 /* Last command was a kill */ diff --git a/exec.c b/exec.c index 44a2e9f..bc78ac0 100644 --- a/exec.c +++ b/exec.c @@ -67,6 +67,7 @@ static const char *dname[] = { static char golabel[ NPAT] = "" ; /* current line to go to */ static int execlevel = 0 ; /* execution IF level */ static struct buffer *bstore = NULL ; /* buffer to store macro text to */ +static int mstore = FALSE ; /* storing text to macro flag */ static int dobuf( struct buffer *bp) ; static void freewhile( struct while_block *wp) ; diff --git a/globals.c b/globals.c index 852e2f8..19ac809 100644 --- a/globals.c +++ b/globals.c @@ -48,23 +48,15 @@ int gbcolor = 0; /* global backgrnd color (black) */ int gasave = 256; /* global ASAVE size */ int gacount = 256; /* count until next ASAVE */ int sgarbf = TRUE; /* TRUE if screen is garbage */ -int mpresf = FALSE; /* TRUE if message in last line */ int clexec = FALSE; /* command line execution flag */ -int mstore = FALSE; /* storing text to macro flag */ int discmd = TRUE; /* display command flag */ int disinp = TRUE; /* display input characters */ -int vtrow = 0; /* Row location of SW cursor */ -int vtcol = 0; /* Column location of SW cursor */ -int lbound = 0; /* leftmost column of current line - being displayed */ -int taboff = 0; /* tab offset for display */ int metac = CONTROL | '['; /* current meta character */ int ctlxc = CONTROL | 'X'; /* current control X prefix char */ int reptc = CONTROL | 'U'; /* current universal repeat char */ int abortc = CONTROL | 'G'; /* current abort command char */ -int quotec = 0x11; /* quote char during mlreply() */ int tabmask = 0x07; /* tabulator mask */ @@ -82,8 +74,6 @@ int scrollcount = 1; /* number of lines to scroll */ /* uninitialized global definitions */ -int currow; /* Cursor row */ -int curcol; /* Cursor column */ int thisflag; /* Flags, this command */ int lastflag; /* Flags, last command */ int curgoal; /* Goal for C-P, C-N */ diff --git a/input.c b/input.c index 9201586..16c17db 100644 --- a/input.c +++ b/input.c @@ -38,6 +38,8 @@ int kbdm[ NKBDM] ; /* Macro */ int *kbdptr ; /* current position in keyboard buf */ int *kbdend = &kbdm[0] ; /* ptr to end of the keyboard */ +static const int quotec = 0x11 ; /* quote char during mlreply() */ + /* * Ask a yes or no question in the message line. Return either TRUE, FALSE, or * ABORT. The ABORT status is returned if the user bumps out of the question