From 9af30bdf17f8371664bc0c5854c91c2e46257b5e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 26 Mar 2011 19:27:11 -0700 Subject: [PATCH] Remove (RET)SIGTYPE; it is identical to void on all supported systems. Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg01068.html * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro. (AH_BOTTOM): Do not define SIGTYPE. * lib-src/emacsclient.c: Replace SIGTYPE with void. * nt/config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void). * src/syssignal.h: Replace RETSIGTYPE with void. * src/atimer.c, src/data.c, src/dispnew.c, src/emacs.c, src/floatfns.c: * src/keyboard.c, src/keyboard.h, src/lisp.h, src/process.c, src/sysdep.c: * src/xterm.c: Replace SIGTYPE with void everywhere. * src/s/template.h (SIGTYPE): Remove commented out definition. * src/s/usg5-4-common.h (SIGTYPE): Remove definition. * admin/CPP-DEFINES: Remove SIGTYPE. --- ChangeLog | 5 +++++ admin/CPP-DEFINES | 2 -- configure.in | 8 -------- lib-src/ChangeLog | 4 ++++ lib-src/emacsclient.c | 6 +++--- nt/ChangeLog | 4 ++++ nt/config.nt | 9 --------- src/ChangeLog | 9 +++++++++ src/atimer.c | 4 ++-- src/data.c | 2 +- src/dispnew.c | 2 +- src/emacs.c | 4 ++-- src/floatfns.c | 6 +++--- src/keyboard.c | 12 ++++++------ src/keyboard.h | 2 +- src/lisp.h | 2 +- src/process.c | 8 ++++---- src/s/template.h | 9 --------- src/s/usg5-4-common.h | 3 --- src/sysdep.c | 4 ++-- src/syssignal.h | 2 +- src/xterm.c | 6 +++--- 22 files changed, 52 insertions(+), 61 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2129d2991b..ef040cdd2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-03-27 Glenn Morris + + * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro. + (AH_BOTTOM): Do not define SIGTYPE. + 2011-03-26 Glenn Morris * configure.in: Replace obsolete macros AC_TRY_COMPILE, AC_TRY_LINK, diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index dae6202b4e..7f6a18f7d5 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -58,7 +58,6 @@ HAVE_TERMIOS INTERRUPT_INPUT NARROWPROTO SEPCHAR -SIGTYPE SYSTEM_TYPE ** Machine specific macros, decribed in detail in src/m/template.h @@ -238,7 +237,6 @@ SIGNALS_VIA_CHARACTERS SIGPIPE SIGQUIT SIGTRAP -SIGTYPE SOLARIS2 STDC_HEADERS SYSTEM_PURESIZE_EXTRA diff --git a/configure.in b/configure.in index fb71b82c46..77deef8dba 100644 --- a/configure.in +++ b/configure.in @@ -1227,9 +1227,6 @@ if test $emacs_cv_struct_utimbuf = yes; then AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by .]) fi -dnl checks for typedefs -AC_TYPE_SIGNAL - dnl Check for speed_t typedef. AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[speed_t x = 1;]])], @@ -3493,11 +3490,6 @@ AH_BOTTOM([ # define SYSTEM_PURESIZE_EXTRA 30000 #endif -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 672fe8c854..f594efa588 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-27 Glenn Morris + + * emacsclient.c: Replace SIGTYPE with void. + 2011-03-23 Juanma Barranquero * ntlib.c: Include . diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index abc9aee37c..737a8d8858 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1116,7 +1116,7 @@ socket_status (char *name) /* A signal handler that passes the signal to the Emacs process. Useful for SIGWINCH. */ -static SIGTYPE +static void pass_signal_to_emacs (int signalnum) { int old_errno = errno; @@ -1131,7 +1131,7 @@ pass_signal_to_emacs (int signalnum) /* Signal handler for SIGCONT; notify the Emacs process that it can now resume our tty frame. */ -static SIGTYPE +static void handle_sigcont (int signalnum) { int old_errno = errno; @@ -1157,7 +1157,7 @@ handle_sigcont (int signalnum) reality, we may get a SIGTSTP on C-z. Handling this signal and notifying Emacs about it should get things under control again. */ -static SIGTYPE +static void handle_sigtstp (int signalnum) { int old_errno = errno; diff --git a/nt/ChangeLog b/nt/ChangeLog index f041bac736..a0603fd7c2 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2011-03-27 Glenn Morris + + * config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void). + 2011-03-25 Juanma Barranquero * addpm.c (main): Remove unused variable `retval'. diff --git a/nt/config.nt b/nt/config.nt index 26fbc1c67c..1d9a5faaf2 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -393,15 +393,6 @@ along with GNU Emacs. If not, see . */ #undef STACK_DIRECTION #endif -/* Define the return type of signal handlers if the s-xxx file - did not already do so. */ -#define RETSIGTYPE void - -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object diff --git a/src/ChangeLog b/src/ChangeLog index 06972a5bcb..54b24c50a1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-03-27 Glenn Morris + + * syssignal.h: Replace RETSIGTYPE with void. + * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c: + * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c: + Replace SIGTYPE with void everywhere. + * s/usg5-4-common.h (SIGTYPE): Remove definition. + * s/template.h (SIGTYPE): Remove commented out definition. + 2011-03-26 Eli Zaretskii * xdisp.c (redisplay_window): Don't check buffer's clip_changed diff --git a/src/atimer.c b/src/atimer.c index e10add961e..b947ea59cc 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -64,7 +64,7 @@ static void set_alarm (void); static void schedule_atimer (struct atimer *); static struct atimer *append_atimer_lists (struct atimer *, struct atimer *); -SIGTYPE alarm_signal_handler (int signo); +void alarm_signal_handler (int signo); /* Start a new atimer of type TYPE. TIME specifies when the timer is @@ -388,7 +388,7 @@ run_timers (void) /* Signal handler for SIGALRM. SIGNO is the signal number, i.e. SIGALRM. */ -SIGTYPE +void alarm_signal_handler (int signo) { #ifndef SYNC_INPUT diff --git a/src/data.c b/src/data.c index 01aafbcede..36a64d888d 100644 --- a/src/data.c +++ b/src/data.c @@ -3300,7 +3300,7 @@ syms_of_data (void) XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1; } -static SIGTYPE +static void arith_error (int signo) { sigsetmask (SIGEMPTYMASK); diff --git a/src/dispnew.c b/src/dispnew.c index 093ed9524e..a15b5f45e6 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5566,7 +5566,7 @@ marginal_area_string (struct window *w, enum window_part part, #ifdef SIGWINCH -static SIGTYPE +static void window_change_signal (int signalnum) /* If we don't have an argument, */ /* some compilers complain in signal calls. */ { diff --git a/src/emacs.c b/src/emacs.c index 0382ade728..6bdd2550ed 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -308,7 +308,7 @@ pthread_t main_thread; /* Handle bus errors, invalid instruction, etc. */ -SIGTYPE +void fatal_error_signal (int sig) { SIGNAL_THREAD_CHECK (sig); @@ -345,7 +345,7 @@ fatal_error_signal (int sig) #ifdef SIGDANGER /* Handler for SIGDANGER. */ -SIGTYPE +void memory_warning_signal (sig) int sig; { diff --git a/src/floatfns.c b/src/floatfns.c index bc03509b75..1232fc0afa 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -103,7 +103,7 @@ extern double logb (double); #endif #ifdef FLOAT_CATCH_SIGILL -static SIGTYPE float_error (); +static void float_error (); #endif /* Nonzero while executing in floating point. @@ -126,7 +126,7 @@ static const char *float_error_fn_name; Handle errors which may result in signals or may set errno. Note that float_error may be declared to return void, so you can't - just cast the zero after the colon to (SIGTYPE) to make the types + just cast the zero after the colon to (void) to make the types check properly. */ #ifdef FLOAT_CHECK_ERRNO @@ -960,7 +960,7 @@ Rounds the value toward zero. */) } #ifdef FLOAT_CATCH_SIGILL -static SIGTYPE +static void float_error (signo) int signo; { diff --git a/src/keyboard.c b/src/keyboard.c index c4ef2795f6..06f375e0d9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -434,15 +434,15 @@ static void restore_getcjmp (jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); -static SIGTYPE interrupt_signal (int signalnum); +static void interrupt_signal (int signalnum); #ifdef SIGIO -static SIGTYPE input_available_signal (int signo); +static void input_available_signal (int signo); #endif static void handle_interrupt (void); static void timer_start_idle (void); static void timer_stop_idle (void); static void timer_resume_idle (void); -static SIGTYPE handle_user_signal (int); +static void handle_user_signal (int); static char *find_user_signal_name (int); static int store_user_signal_events (void); @@ -7082,7 +7082,7 @@ process_pending_signals (void) #ifdef SIGIO /* for entire page */ /* Note SIGIO has been undef'd if FIONREAD is missing. */ -static SIGTYPE +static void input_available_signal (int signo) { /* Must preserve main program's value of errno. */ @@ -7160,7 +7160,7 @@ add_user_signal (int sig, const char *name) signal (sig, handle_user_signal); } -static SIGTYPE +static void handle_user_signal (int sig) { int old_errno = errno; @@ -10712,7 +10712,7 @@ clear_waiting_for_input (void) SIGINT was generated by C-g, so we call handle_interrupt. Otherwise, the handler kills Emacs. */ -static SIGTYPE +static void interrupt_signal (int signalnum) /* If we don't have an argument, some */ /* compilers complain in signal calls. */ { diff --git a/src/keyboard.h b/src/keyboard.h index ba3c909c4d..2ff370306b 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -485,7 +485,7 @@ extern void push_frame_kboard (struct frame *); extern void pop_kboard (void); extern void temporarily_switch_to_single_kboard (struct frame *); extern void record_asynch_buffer_change (void); -extern SIGTYPE input_poll_signal (int); +extern void input_poll_signal (int); extern void start_polling (void); extern void stop_polling (void); extern void set_poll_suppress_count (int); diff --git a/src/lisp.h b/src/lisp.h index e98172ec10..8c7d4da8aa 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3181,7 +3181,7 @@ extern Lisp_Object decode_env_path (const char *, const char *); extern Lisp_Object empty_unibyte_string, empty_multibyte_string; extern Lisp_Object Qfile_name_handler_alist; extern void (*fatal_error_signal_hook) (void); -extern SIGTYPE fatal_error_signal (int); +extern void fatal_error_signal (int); EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale (void); diff --git a/src/process.c b/src/process.c index 639b6a49fc..148f5b59f8 100644 --- a/src/process.c +++ b/src/process.c @@ -5470,7 +5470,7 @@ read_process_output (Lisp_Object proc, register int channel) jmp_buf send_process_frame; Lisp_Object process_sent_to; -static SIGTYPE +static void send_process_trap (int ignore) { SIGNAL_THREAD_CHECK (SIGPIPE); @@ -5497,7 +5497,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, EMACS_INT rv; struct coding_system *coding; struct gcpro gcpro1; - SIGTYPE (*volatile old_sigpipe) (int); + void (*volatile old_sigpipe) (int); GCPRO1 (object); @@ -5619,7 +5619,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, while (this > 0) { int outfd = p->outfd; - old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); + old_sigpipe = (void (*) (int)) signal (SIGPIPE, send_process_trap); #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CHAN_P (outfd)) { @@ -6379,7 +6379,7 @@ process has been transmitted to the serial port. */) indirectly; if it does, that is a bug */ #ifdef SIGCHLD -static SIGTYPE +static void sigchld_handler (int signo) { int old_errno = errno; diff --git a/src/s/template.h b/src/s/template.h index ee5afa81de..4e0400e99e 100644 --- a/src/s/template.h +++ b/src/s/template.h @@ -77,15 +77,6 @@ along with GNU Emacs. If not, see . */ a file that someone else has modified in his Emacs. */ #define CLASH_DETECTION -/* Define this if your operating system declares signal handlers to - have a type other than the usual. `The usual' is `void' for ANSI C - systems (i.e. when the __STDC__ macro is defined), and `int' for - pre-ANSI systems. If you're using GCC on an older system, __STDC__ - will be defined, but the system's include files will still say that - signal returns int or whatever; in situations like that, define - this to be what the system's include files want. */ -/* #define SIGTYPE int */ - /* If the character used to separate elements of the executable path is not ':', #define this to be the appropriate character constant. */ /* #define SEPCHAR ':' */ diff --git a/src/s/usg5-4-common.h b/src/s/usg5-4-common.h index aeedd7f4b1..236f71e300 100644 --- a/src/s/usg5-4-common.h +++ b/src/s/usg5-4-common.h @@ -38,9 +38,6 @@ along with GNU Emacs. If not, see . */ /* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */ #define HAVE_SYSV_SIGPAUSE -/* On USG systems signal handlers return void. */ -#define SIGTYPE void - /* Get FIONREAD from . Get to get struct tchars. But get first to make sure ttold.h doesn't interfere. And don't try to use SIGIO yet. */ diff --git a/src/sysdep.c b/src/sysdep.c index 14db0fd26d..1bb400421f 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -449,7 +449,7 @@ child_setup_tty (int out) struct save_signal { int code; - SIGTYPE (*handler) (int); + void (*handler) (int); }; static void save_signal_handlers (struct save_signal *); @@ -608,7 +608,7 @@ save_signal_handlers (struct save_signal *saved_handlers) while (saved_handlers->code) { saved_handlers->handler - = (SIGTYPE (*) (int)) signal (saved_handlers->code, SIG_IGN); + = (void (*) (int)) signal (saved_handlers->code, SIG_IGN); saved_handlers++; } } diff --git a/src/syssignal.h b/src/syssignal.h index 7b4070322d..03768168e2 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -69,7 +69,7 @@ extern sigset_t sys_sigmask (); /* Whether this is what all systems want or not, this is what appears to be assumed in the source, for example data.c:arith_error. */ -typedef RETSIGTYPE (*signal_handler_t) (int); +typedef void (*signal_handler_t) (int); signal_handler_t sys_signal (int signal_number, signal_handler_t action); sigset_t sys_sigblock (sigset_t new_mask); diff --git a/src/xterm.c b/src/xterm.c index f87c22912a..0b18356b0a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -349,7 +349,7 @@ static int handle_one_xevent (struct x_display_info *, XEvent *, int *, struct input_event *); /* Don't declare this NO_RETURN because we want no interference with debugging failing X calls. */ -static SIGTYPE x_connection_closed (Display *, const char *); +static void x_connection_closed (Display *, const char *); /* Flush display of frame F, or of all frames if F is null. */ @@ -7650,7 +7650,7 @@ x_trace_wire (void) SIGPIPE will fail, causing Xlib to invoke the X IO error handler, which will do the appropriate cleanup for us. */ -static SIGTYPE +static void x_connection_signal (int signalnum) /* If we don't have an argument, */ /* some compilers complain in signal calls. */ { @@ -7673,7 +7673,7 @@ static char *error_msg; /* Handle the loss of connection to display DPY. ERROR_MESSAGE is the text of an error message that lead to the connection loss. */ -static SIGTYPE +static void x_connection_closed (Display *dpy, const char *error_message) { struct x_display_info *dpyinfo = x_display_info_for_display (dpy); -- 2.20.1