1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-19 02:56:08 -05:00

uemacs: Get rid of the CALLED macro.

uemacs is not a subprogram and doesn't seem it will be, so there is no reason
to leave this macro. And this macro is defined to 0, so we never reach the path
where we test for this macro.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thiago Farina 2010-08-29 23:28:34 -03:00 committed by Linus Torvalds
parent 1dcc35b309
commit 74336ca924
4 changed files with 5 additions and 35 deletions

4
edef.h
View File

@ -86,10 +86,6 @@ extern int saveflag; /* Flags, saved with the $target var */
extern char *fline; /* dynamic return line */ extern char *fline; /* dynamic return line */
extern int flen; /* current length of fline */ extern int flen; /* current length of fline */
extern int rval; /* return value of a subprocess */ extern int rval; /* return value of a subprocess */
#if CALLED
extern int eexitflag; /* EMACS exit flag */
extern int eexitval; /* and the exit return value */
#endif
#if PKCODE #if PKCODE
extern int nullflag; extern int nullflag;
extern int justflag; /* justify, don't fill */ extern int justflag; /* justify, don't fill */

View File

@ -156,7 +156,6 @@
#define AEDIT 1 /* advanced editing options: en/detabbing */ #define AEDIT 1 /* advanced editing options: en/detabbing */
#define PROC 1 /* named procedures */ #define PROC 1 /* named procedures */
#define CLEAN 0 /* de-alloc memory on exit */ #define CLEAN 0 /* de-alloc memory on exit */
#define CALLED 0 /* is emacs a called subroutine? or stand alone */
#define ASCII 1 /* always using ASCII char sequences for now */ #define ASCII 1 /* always using ASCII char sequences for now */
#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ #define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */

View File

@ -81,10 +81,6 @@ int saveflag = 0; /* Flags, saved with the $target var */
char *fline = NULL; /* dynamic return line */ char *fline = NULL; /* dynamic return line */
int flen = 0; /* current length of fline */ int flen = 0; /* current length of fline */
int rval = 0; /* return value of a subprocess */ int rval = 0; /* return value of a subprocess */
#if CALLED
int eexitflag = FALSE; /* EMACS exit flag */
int eexitval = 0; /* and the exit return value */
#endif
#if PKCODE #if PKCODE
int nullflag = FALSE; /* accept null characters */ int nullflag = FALSE; /* accept null characters */
int justflag = FALSE; /* justify, don't fill */ int justflag = FALSE; /* justify, don't fill */

31
main.c
View File

@ -100,11 +100,7 @@ void usage(int status)
exit(status); exit(status);
} }
#if CALLED
int emacs(int argc, char **argv)
#else
int main(int argc, char **argv) int main(int argc, char **argv)
#endif
{ {
int c = -1; /* command character */ int c = -1; /* command character */
int f; /* default flag */ int f; /* default flag */
@ -166,9 +162,6 @@ int main(int argc, char **argv)
#if CRYPT #if CRYPT
cryptflag = FALSE; /* no encryption by default */ cryptflag = FALSE; /* no encryption by default */
#endif #endif
#if CALLED
eexitflag = FALSE; /* not time to exit yet */
#endif
/* Parse the command line */ /* Parse the command line */
for (carg = 1; carg < argc; ++carg) { for (carg = 1; carg < argc; ++carg) {
@ -305,23 +298,16 @@ int main(int argc, char **argv)
update(FALSE); update(FALSE);
} }
/* setup to process commands */ /* Setup to process commands. */
lastflag = 0; /* Fake last flags. */ lastflag = 0; /* Fake last flags. */
loop: loop:
/* Execute the "command" macro...normally null. */
#if CALLED saveflag = lastflag; /* Preserve lastflag through this. */
/* if we were called as a subroutine and want to leave, do so */
if (eexitflag)
return eexitval;
#endif
/* execute the "command" macro...normally null */
saveflag = lastflag; /* preserve lastflag through this */
execute(META | SPEC | 'C', FALSE, 1); execute(META | SPEC | 'C', FALSE, 1);
lastflag = saveflag; lastflag = saveflag;
#if TYPEAH && PKCODE #if TYPEAH && PKCODE
if (typahead()) { if (typahead()) {
newc = getcmd(); newc = getcmd();
update(FALSE); update(FALSE);
@ -865,14 +851,7 @@ int cexit(int status)
/* and the video buffers */ /* and the video buffers */
vtfree(); vtfree();
/* and now.. we leave [pick the return if we are a subprogram] */
#if CALLED
eexitflag = TRUE; /* flag a program exit */
eexitval = status;
return status;
#else
#undef exit #undef exit
exit(status); exit(status);
#endif
} }
#endif #endif