From df349fa061c899adc7b31a9eb70d4607405d6cb0 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Tue, 8 Oct 2013 10:20:01 +0800 Subject: [PATCH] Recompile under CYGWIN64. Move DEBUGM code to eval and exec. --- Makefile | 7 +++---- edef.h | 5 ----- estruct.h | 1 - eval.c | 13 +++++++++---- eval.h | 10 ++++++++++ exec.c | 9 ++++----- globals.c | 6 ------ 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 16f33b6..25c9dbb 100644 --- a/Makefile +++ b/Makefile @@ -170,7 +170,7 @@ isearch.o: isearch.c isearch.h basic.h buffer.h crypt.h line.h utf8.h \ line.o: line.c line.h utf8.h buffer.h crypt.h edef.h estruct.h retcode.h \ log.h window.h defines.h lock.o: lock.c lock.h estruct.h retcode.h display.h edef.h buffer.h \ - crypt.h line.h utf8.h input.h pklock.h + crypt.h line.h utf8.h input.h log.o: log.c log.h retcode.h main.o: main.c basic.h bind.h edef.h buffer.h crypt.h line.h utf8.h \ estruct.h retcode.h bindable.h display.h eval.h execute.h file.h input.h \ @@ -181,8 +181,7 @@ names.o: names.c names.h basic.h bind.h edef.h buffer.h crypt.h line.h \ isearch.h region.h random.h search.h spawn.h window.h defines.h word.h pklock.o: pklock.c pklock.h estruct.h retcode.h edef.h buffer.h crypt.h \ line.h utf8.h -posix.o: posix.c termio.h estruct.h retcode.h edef.h buffer.h crypt.h \ - line.h utf8.h +posix.o: posix.c termio.h random.o: random.c random.h basic.h buffer.h crypt.h line.h utf8.h \ display.h estruct.h retcode.h edef.h execute.h input.h log.h search.h \ terminal.h defines.h window.h @@ -196,7 +195,7 @@ spawn.o: spawn.c spawn.h defines.h buffer.h crypt.h line.h utf8.h \ terminal.h window.h tcap.o: tcap.c terminal.h defines.h display.h estruct.h retcode.h edef.h \ buffer.h crypt.h line.h utf8.h termio.h -termio.o: termio.c termio.h +termio.o: termio.c termio.h estruct.h retcode.h utf8.h utf8.o: utf8.c utf8.h vmsvt.o: vmsvt.c estruct.h retcode.h edef.h buffer.h crypt.h line.h \ utf8.h diff --git a/edef.h b/edef.h index 821e456..093e803 100644 --- a/edef.h +++ b/edef.h @@ -86,9 +86,4 @@ extern struct buffer *blistp; /* Buffer for C-X C-B */ extern char sres[NBUFN]; /* Current screen resolution. */ -#if DEBUGM -/* Vars needed for macro debugging output. */ -extern char outline[]; /* Global string to hold debug line text. */ -#endif - #endif /* EDEF_H_ */ diff --git a/estruct.h b/estruct.h index 60ff1b0..d756b32 100644 --- a/estruct.h +++ b/estruct.h @@ -129,7 +129,6 @@ #define CLRMSG 0 /* space clears the message line with no insert */ #define CFENCE 1 /* fench matching in CMODE */ #define TYPEAH 1 /* type ahead causes update to be skipped */ -#define DEBUGM 1 /* $debug triggers macro debugging */ #define VISMAC 0 /* update display during keyboard macros */ #define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ #define ADDCR 0 /* ajout d'un CR en fin de chaque ligne (ST520) */ diff --git a/eval.c b/eval.c index 89b6ef8..f11220d 100644 --- a/eval.c +++ b/eval.c @@ -32,6 +32,11 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#if DEBUGM +/* vars needed for macro debugging output */ +char outline[ NSTRING] ; /* global string to hold debug line text */ +#endif + /* Max #chars in a var name. */ #define NVSIZE 10 @@ -587,10 +592,6 @@ char *gtenv(char *vname) int setvar(int f, int n) { int status; /* status return */ -#if DEBUGM - char *sp; /* temp string pointer */ - char *ep; /* ptr to end of outline */ -#endif struct variable_description vd; /* variable num/type */ char var[NVSIZE + 1]; /* name of variable to fetch */ char value[NSTRING]; /* value to set variable to */ @@ -631,6 +632,8 @@ int setvar(int f, int n) that effect here. */ if (macbug) { + char *sp ; /* temp string pointer */ + strcpy(outline, "((("); /* assignment status */ @@ -649,6 +652,8 @@ int setvar(int f, int n) sp = outline; while (*sp) if (*sp++ == '%') { + char *ep ; /* ptr to end of outline */ + /* advance to the end */ ep = --sp; while (*ep++); diff --git a/eval.h b/eval.h index 85dd60e..378c72a 100644 --- a/eval.h +++ b/eval.h @@ -1,6 +1,16 @@ #ifndef _EVAL_H_ #define _EVAL_H_ + +#define DEBUGM 1 /* $debug triggers macro debugging */ + + +#if DEBUGM +/* Vars needed for macro debugging output. */ +extern char outline[] ; /* Global string to hold debug line text. */ +#endif + + /* Macro argument token types */ #define TKNUL 0 /* end-of-string */ diff --git a/exec.c b/exec.c index bc78ac0..77cc2f0 100644 --- a/exec.c +++ b/exec.c @@ -495,11 +495,6 @@ static int dobuf(struct buffer *bp) char *eline; /* text of line to execute */ char tkn[NSTRING]; /* buffer to evaluate an expresion in */ -#if DEBUGM - char *sp; /* temp for building debug string */ - char *ep; /* ptr to end of outline */ -#endif - /* clear IF level flags/while ptr */ execlevel = 0; whlist = NULL; @@ -616,6 +611,8 @@ static int dobuf(struct buffer *bp) ^G will abort the command */ if (macbug) { + char *sp ; /* temp for building debug string */ + strcpy(outline, "<<<"); /* debug macro name */ @@ -634,6 +631,8 @@ static int dobuf(struct buffer *bp) sp = outline; while (*sp) if (*sp++ == '%') { + char *ep ; /* ptr to end of outline */ + /* advance to the end */ ep = --sp; while (*ep++); diff --git a/globals.c b/globals.c index e9d2f4a..627d58b 100644 --- a/globals.c +++ b/globals.c @@ -54,9 +54,3 @@ struct buffer *bheadp; /* Head of list of buffers */ struct buffer *blistp; /* Buffer for C-X C-B */ char sres[NBUFN]; /* current screen resolution */ - - -#if DEBUGM -/* vars needed for macro debugging output */ -char outline[NSTRING]; /* global string to hold debug line text */ -#endif