mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-24 01:56:26 -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:
parent
1dcc35b309
commit
74336ca924
4
edef.h
4
edef.h
@ -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 */
|
||||||
|
@ -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 */
|
||||||
|
@ -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 */
|
||||||
|
27
main.c
27
main.c
@ -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,19 +298,12 @@ 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;
|
||||||
|
|
||||||
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user