Remove (RET)SIGTYPE; it is identical to void on all supported systems.
authorGlenn Morris <rgm@gnu.org>
Sun, 27 Mar 2011 02:27:11 +0000 (19:27 -0700)
committerGlenn Morris <rgm@gnu.org>
Sun, 27 Mar 2011 02:27:11 +0000 (19:27 -0700)
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.

22 files changed:
ChangeLog
admin/CPP-DEFINES
configure.in
lib-src/ChangeLog
lib-src/emacsclient.c
nt/ChangeLog
nt/config.nt
src/ChangeLog
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/s/template.h
src/s/usg5-4-common.h
src/sysdep.c
src/syssignal.h
src/xterm.c

index 2129d29..ef040cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro.
+       (AH_BOTTOM): Do not define SIGTYPE.
+
 2011-03-26  Glenn Morris  <rgm@gnu.org>
 
        * configure.in: Replace obsolete macros AC_TRY_COMPILE, AC_TRY_LINK,
index dae6202..7f6a18f 100644 (file)
@@ -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
index fb71b82..77deef8 100644 (file)
@@ -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 <utime.h>.])
 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 <termios.h>]], [[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
index 672fe8c..f594efa 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * emacsclient.c: Replace SIGTYPE with void.
+
 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
 
        * ntlib.c: Include <ctype.h>.
index abc9aee..737a8d8 100644 (file)
@@ -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;
index f041bac..a0603fd 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void).
+
 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
 
        * addpm.c (main): Remove unused variable `retval'.
index 26fbc1c..1d9a5fa 100644 (file)
@@ -393,15 +393,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #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
index 06972a5..54b24c5 100644 (file)
@@ -1,3 +1,12 @@
+2011-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * 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  <eliz@gnu.org>
 
        * xdisp.c (redisplay_window): Don't check buffer's clip_changed
index e10add9..b947ea5 100644 (file)
@@ -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
index 01aafbc..36a64d8 100644 (file)
@@ -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);
index 093ed95..a15b5f4 100644 (file)
@@ -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.  */
 {
index 0382ade..6bdd255 100644 (file)
@@ -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;
 {
index bc03509..1232fc0 100644 (file)
@@ -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.  */)
 }
 \f
 #ifdef FLOAT_CATCH_SIGILL
-static SIGTYPE
+static void
 float_error (signo)
      int signo;
 {
index c4ef279..06f375e 100644 (file)
@@ -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. */
 {
index ba3c909..2ff3703 100644 (file)
@@ -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);
index e98172e..8c7d4da 100644 (file)
@@ -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);
index 639b6a4..148f5b5 100644 (file)
@@ -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;
index ee5afa8..4e0400e 100644 (file)
@@ -77,15 +77,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    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 ':' */
index aeedd7f..236f71e 100644 (file)
@@ -38,9 +38,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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 <sys/filio.h>.  Get <sys/ttold.h> to get struct tchars.
    But get <termio.h> first to make sure ttold.h doesn't interfere.
    And don't try to use SIGIO yet.  */
index 14db0fd..1bb4004 100644 (file)
@@ -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++;
     }
 }
index 7b40703..0376816 100644 (file)
@@ -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);
index f87c229..0b18356 100644 (file)
@@ -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);