Simplify __USEWIDE
[binutils-gdb.git] / libiberty / strsignal.c
index 4ca9e21d1133b565ad64c75b06cafeb6d6bf03aa..36b41f17e1232e171c1c1c8e2266fe1d0f549b9b 100644 (file)
 #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
@@ -404,10 +404,10 @@ call to @code{strsignal}.
 
 #ifndef HAVE_STRSIGNAL
 
-const char *
+char *
 strsignal (int signo)
 {
-  const char *msg;
+  char *msg;
   static char buf[32];
 
 #ifndef HAVE_SYS_SIGLIST
@@ -428,14 +428,16 @@ strsignal (int 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);
 }