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 int flen; /* current length of fline */
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
extern int nullflag;
extern int justflag; /* justify, don't fill */

View File

@ -156,7 +156,6 @@
#define AEDIT 1 /* advanced editing options: en/detabbing */
#define PROC 1 /* named procedures */
#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 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 */
int flen = 0; /* current length of fline */
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
int nullflag = FALSE; /* accept null characters */
int justflag = FALSE; /* justify, don't fill */

31
main.c
View File

@ -100,11 +100,7 @@ void usage(int status)
exit(status);
}
#if CALLED
int emacs(int argc, char **argv)
#else
int main(int argc, char **argv)
#endif
{
int c = -1; /* command character */
int f; /* default flag */
@ -166,9 +162,6 @@ int main(int argc, char **argv)
#if CRYPT
cryptflag = FALSE; /* no encryption by default */
#endif
#if CALLED
eexitflag = FALSE; /* not time to exit yet */
#endif
/* Parse the command line */
for (carg = 1; carg < argc; ++carg) {
@ -305,23 +298,16 @@ int main(int argc, char **argv)
update(FALSE);
}
/* setup to process commands */
lastflag = 0; /* Fake last flags. */
/* Setup to process commands. */
lastflag = 0; /* Fake last flags. */
loop:
#if CALLED
/* 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 the "command" macro...normally null. */
saveflag = lastflag; /* Preserve lastflag through this. */
execute(META | SPEC | 'C', FALSE, 1);
lastflag = saveflag;
#if TYPEAH && PKCODE
#if TYPEAH && PKCODE
if (typahead()) {
newc = getcmd();
update(FALSE);
@ -865,14 +851,7 @@ int cexit(int status)
/* and the video buffers */
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
exit(status);
#endif
}
#endif