First batch of changes from FailSafeC
This is all tiny stuff - allow overriding WIDENED_PROTOTYPES from the hints file, missing NO_SIGNAL conditionals, remove a GCC-ism, conditional indentation, void return in a non-void function.
This commit is contained in:
@@ -215,31 +215,33 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
|||||||
* prototypes to match the standard and thus lose the typechecking.
|
* prototypes to match the standard and thus lose the typechecking.
|
||||||
*/
|
*/
|
||||||
#if defined(MSDOS) && !defined(__GO32__)
|
#if defined(MSDOS) && !defined(__GO32__)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(AMIGA) && !defined(AZTEC_50)
|
#if defined(AMIGA) && !defined(AZTEC_50)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(macintosh) && (defined(__SC__) || defined(__MRC__))
|
#if defined(macintosh) && (defined(__SC__) || defined(__MRC__))
|
||||||
#define WIDENED_PROTOTYPES
|
# define WIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(__MWERKS__) && defined(__BEOS__)
|
#if defined(__MWERKS__) && defined(__BEOS__)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ULTRIX_PROTO) && defined(ULTRIX_CC20)
|
#if defined(ULTRIX_PROTO) && defined(ULTRIX_CC20)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(apollo)
|
#if defined(apollo)
|
||||||
#define UNWIDENED_PROTOTYPES
|
# define UNWIDENED_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UNWIDENED_PROTOTYPES
|
#ifndef UNWIDENED_PROTOTYPES
|
||||||
# if defined(NHSTDC) || defined(ULTRIX_PROTO) || defined(THINK_C)
|
# if defined(NHSTDC) || defined(ULTRIX_PROTO) || defined(THINK_C)
|
||||||
# define WIDENED_PROTOTYPES
|
# ifndef WIDENED_PROTOTYPES
|
||||||
|
# define WIDENED_PROTOTYPES
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -228,13 +228,14 @@ NH_panictrace_gdb(){
|
|||||||
char *gdbpath = GDBPATH;
|
char *gdbpath = GDBPATH;
|
||||||
char *greppath = GREPPATH;
|
char *greppath = GREPPATH;
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
|
FILE *gdb;
|
||||||
|
|
||||||
if(gdbpath == NULL || gdbpath[0] == 0) return FALSE;
|
if(gdbpath == NULL || gdbpath[0] == 0) return FALSE;
|
||||||
if(greppath == NULL || greppath[0] == 0) return FALSE;
|
if(greppath == NULL || greppath[0] == 0) return FALSE;
|
||||||
|
|
||||||
sprintf(buf, "%s -n -q %s %d 2>&1 | %s '^#'",
|
sprintf(buf, "%s -n -q %s %d 2>&1 | %s '^#'",
|
||||||
gdbpath, ARGV0, getpid(), greppath);
|
gdbpath, ARGV0, getpid(), greppath);
|
||||||
FILE *gdb = popen(buf, "w");
|
gdb = popen(buf, "w");
|
||||||
if(gdb){
|
if(gdb){
|
||||||
raw_print("Generating more information you may report:\n");
|
raw_print("Generating more information you may report:\n");
|
||||||
fprintf(gdb, "bt\nquit\ny");
|
fprintf(gdb, "bt\nquit\ny");
|
||||||
@@ -327,7 +328,9 @@ done2()
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
if ((c = ynq(tmp)) == 'y') {
|
if ((c = ynq(tmp)) == 'y') {
|
||||||
|
# ifndef NO_SIGNAL
|
||||||
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
||||||
|
# endif
|
||||||
exit_nhwindows((char *)0);
|
exit_nhwindows((char *)0);
|
||||||
NH_abort();
|
NH_abort();
|
||||||
} else if (c == 'q') done_stopprint++;
|
} else if (c == 'q') done_stopprint++;
|
||||||
|
|||||||
14
src/files.c
14
src/files.c
@@ -1281,13 +1281,23 @@ boolean uncomp;
|
|||||||
uncomp ? "un" : "", filename);
|
uncomp ? "un" : "", filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
# ifndef NO_SIGNAL
|
||||||
(void) signal(SIGINT, SIG_IGN);
|
(void) signal(SIGINT, SIG_IGN);
|
||||||
(void) signal(SIGQUIT, SIG_IGN);
|
(void) signal(SIGQUIT, SIG_IGN);
|
||||||
(void) wait((int *)&i);
|
(void) wait((int *)&i);
|
||||||
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
||||||
# ifdef WIZARD
|
# ifdef WIZARD
|
||||||
if (wizard) (void) signal(SIGQUIT, SIG_DFL);
|
if (wizard) (void) signal(SIGQUIT, SIG_DFL);
|
||||||
# endif
|
# endif
|
||||||
|
#else
|
||||||
|
/* I don't think we can really cope with external compression
|
||||||
|
* without signals, so we'll declare that compress failed and
|
||||||
|
* go on. (We could do a better job by forcing off external
|
||||||
|
* compression if there are no signals, but we want this for
|
||||||
|
* testing with FailSafeC
|
||||||
|
*/
|
||||||
|
i = 1;
|
||||||
|
#endif
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
/* (un)compress succeeded: remove file left behind */
|
/* (un)compress succeeded: remove file left behind */
|
||||||
if (uncomp)
|
if (uncomp)
|
||||||
|
|||||||
@@ -162,10 +162,10 @@ dosuspend()
|
|||||||
|| !check_user_string(sysopt.shellers)
|
|| !check_user_string(sysopt.shellers)
|
||||||
){
|
){
|
||||||
Norep("Suspend command not available.");
|
Norep("Suspend command not available.");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
# ifdef SIGTSTP
|
# if defined(SIGTSTP) && !defined(NO_SIGNAL)
|
||||||
if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
|
if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
|
||||||
suspend_nhwindows((char *)0);
|
suspend_nhwindows((char *)0);
|
||||||
# ifdef _M_UNIX
|
# ifdef _M_UNIX
|
||||||
|
|||||||
@@ -183,7 +183,9 @@ char *argv[];
|
|||||||
*/
|
*/
|
||||||
u.uhp = 1; /* prevent RIP on early quits */
|
u.uhp = 1; /* prevent RIP on early quits */
|
||||||
program_state.preserve_locks = 1;
|
program_state.preserve_locks = 1;
|
||||||
|
#ifndef NO_SIGNAL
|
||||||
sethanguphandler((SIG_RET_TYPE)hangup);
|
sethanguphandler((SIG_RET_TYPE)hangup);
|
||||||
|
#endif
|
||||||
|
|
||||||
process_options(argc, argv); /* command line options */
|
process_options(argc, argv); /* command line options */
|
||||||
init_nhwindows(&argc, argv); /* now we can set up window system */
|
init_nhwindows(&argc, argv); /* now we can set up window system */
|
||||||
@@ -268,7 +270,9 @@ char *argv[];
|
|||||||
const char *fq_save = fqname(SAVEF, SAVEPREFIX, 1);
|
const char *fq_save = fqname(SAVEF, SAVEPREFIX, 1);
|
||||||
|
|
||||||
(void) chmod(fq_save,0); /* disallow parallel restores */
|
(void) chmod(fq_save,0); /* disallow parallel restores */
|
||||||
|
#ifndef NO_SIGNAL
|
||||||
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
||||||
|
#endif
|
||||||
#ifdef NEWS
|
#ifdef NEWS
|
||||||
if(iflags.news) {
|
if(iflags.news) {
|
||||||
display_file(NEWS, FALSE);
|
display_file(NEWS, FALSE);
|
||||||
|
|||||||
@@ -298,8 +298,10 @@ int wt;
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
/* fork succeeded; wait for child to exit */
|
/* fork succeeded; wait for child to exit */
|
||||||
|
#ifndef NO_SIGNAL
|
||||||
(void) signal(SIGINT,SIG_IGN);
|
(void) signal(SIGINT,SIG_IGN);
|
||||||
(void) signal(SIGQUIT,SIG_IGN);
|
(void) signal(SIGQUIT,SIG_IGN);
|
||||||
|
#endif
|
||||||
(void) wait( (int *) 0);
|
(void) wait( (int *) 0);
|
||||||
#ifdef _M_UNIX
|
#ifdef _M_UNIX
|
||||||
sco_mapoff();
|
sco_mapoff();
|
||||||
@@ -307,9 +309,11 @@ int wt;
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
linux_mapoff();
|
linux_mapoff();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef NO_SIGNAL
|
||||||
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
||||||
#ifdef WIZARD
|
# ifdef WIZARD
|
||||||
if(wizard) (void) signal(SIGQUIT,SIG_DFL);
|
if(wizard) (void) signal(SIGQUIT,SIG_DFL);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
if(wt) {
|
if(wt) {
|
||||||
raw_print("");
|
raw_print("");
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ char** argv;
|
|||||||
|
|
||||||
ttyDisplay->lastwin = WIN_ERR;
|
ttyDisplay->lastwin = WIN_ERR;
|
||||||
|
|
||||||
#if defined(SIGWINCH) && defined(CLIPPING)
|
#if defined(SIGWINCH) && defined(CLIPPING) && !defined(NO_SIGNAL)
|
||||||
(void) signal(SIGWINCH, winch);
|
(void) signal(SIGWINCH, winch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user