]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libiberty/strsignal.c
Add prange entries in gimple-range-op.cc.
[thirdparty/gcc.git] / libiberty / strsignal.c
index 1ff984debc3733aaaa5c597c0415b2623b7fc70b..36b41f17e1232e171c1c1c8e2266fe1d0f549b9b 100644 (file)
@@ -9,7 +9,7 @@
 /* We need to declare sys_siglist, because even if the system provides
    it we can't assume that it is declared in <signal.h> (for example,
    SunOS provides sys_siglist, but it does not declare it in any
-   header file).  fHowever, we can't declare sys_siglist portably,
+   header file).  However, we can't declare sys_siglist portably,
    because on some systems it is declared with const and on some
    systems it is declared without const.  If we were using autoconf,
    we could work out the right declaration.  Until, then we just
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #else
-extern PTR malloc ();
+extern void *malloc ();
 #endif
 
 #ifdef HAVE_STRING_H
 #include <string.h>
 #else
-extern PTR memset ();
+extern void *memset ();
 #endif
 
 /* Undefine the macro we used to hide the definition of sys_siglist
@@ -41,18 +41,14 @@ extern PTR memset ();
 #undef sys_nsig
 
 #ifndef NULL
-#  ifdef ANSI_PROTOTYPES
-#    define NULL (void *) 0
-#  else
-#    define NULL 0
-#  endif
+#  define NULL (void *) 0
 #endif
 
 #ifndef MAX
 #  define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
-static void init_signal_tables PARAMS ((void));
+static void init_signal_tables (void);
 
 /* Translation table for signal values.
 
@@ -288,7 +284,7 @@ BUGS
 */
 
 static void
-init_signal_tables ()
+init_signal_tables (void)
 {
   const struct signal_info *eip;
   int nbytes;
@@ -369,7 +365,7 @@ symbolic name or message.
 */
 
 int
-signo_max ()
+signo_max (void)
 {
   int maxsize;
 
@@ -408,11 +404,10 @@ call to @code{strsignal}.
 
 #ifndef HAVE_STRSIGNAL
 
-const char *
-strsignal (signo)
-  int signo;
+char *
+strsignal (int signo)
 {
-  const char *msg;
+  char *msg;
   static char buf[32];
 
 #ifndef HAVE_SYS_SIGLIST
@@ -433,14 +428,16 @@ strsignal (signo)
     {
       /* In range, but no sys_siglist or no entry at this index. */
       sprintf (buf, "Signal %d", signo);
-      msg = (const char *) buf;
+      msg = buf;
     }
   else
     {
-      /* In range, and a valid message.  Just return the message. */
-      msg = (const char *) sys_siglist[signo];
+      /* In range, and a valid message.  Just return the message.  We
+        can safely cast away const, since POSIX says the user must
+        not modify the result.  */
+      msg = (char *) sys_siglist[signo];
     }
-  
+
   return (msg);
 }
 
@@ -469,8 +466,7 @@ valid until the next call to @code{strsigno}.
 */
 
 const char *
-strsigno (signo)
-  int signo;
+strsigno (int signo)
 {
   const char *name;
   static char buf[32];
@@ -513,8 +509,7 @@ translation is found, returns 0.
 */
 
 int
-strtosigno (name)
-     const char *name;
+strtosigno (const char *name)
 {
   int signo = 0;
 
@@ -543,7 +538,7 @@ strtosigno (name)
 
 /*
 
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
+@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
 
 Print @var{message} to the standard error, followed by a colon,
 followed by the description of the signal specified by @var{signo},
@@ -556,9 +551,7 @@ followed by a newline.
 #ifndef HAVE_PSIGNAL
 
 void
-psignal (signo, message)
-  unsigned signo;
-  char *message;
+psignal (int signo, char *message)
 {
   if (signal_names == NULL)
     {
@@ -585,7 +578,7 @@ psignal (signo, message)
 #include <stdio.h>
 
 int
-main ()
+main (void)
 {
   int signo;
   int maxsigno;