summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/error.c b/error.c
index 71a6ea6..2d76a62 100644
--- a/error.c
+++ b/error.c
@@ -45,10 +45,10 @@ err_snprintf(buf, len, fmt, args)
}
}
-static void err_append _((char*));
+static void err_append _((const char*));
static void
err_print(fmt, args)
- char *fmt;
+ const char *fmt;
va_list args;
{
char buf[BUFSIZ];
@@ -59,10 +59,10 @@ err_print(fmt, args)
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_compile_error(char *fmt, ...)
+rb_compile_error(const char *fmt, ...)
#else
rb_compile_error(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -76,10 +76,10 @@ rb_compile_error(fmt, va_alist)
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_compile_error_append(char *fmt, ...)
+rb_compile_error_append(const char *fmt, ...)
#else
rb_compile_error_append(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -94,10 +94,10 @@ rb_compile_error_append(fmt, va_alist)
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_warn(char *fmt, ...)
+rb_warn(const char *fmt, ...)
#else
rb_warn(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -114,10 +114,10 @@ rb_warn(fmt, va_alist)
/* rb_warning() reports only in verbose mode */
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_warning(char *fmt, ...)
+rb_warning(const char *fmt, ...)
#else
rb_warning(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -135,10 +135,10 @@ rb_warning(fmt, va_alist)
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_bug(char *fmt, ...)
+rb_bug(const char *fmt, ...)
#else
rb_bug(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -156,7 +156,7 @@ rb_bug(fmt, va_alist)
static struct types {
int type;
- char *name;
+ const char *name;
} builtin_types[] = {
T_NIL, "nil",
T_OBJECT, "Object",
@@ -220,7 +220,10 @@ rb_check_type(x, t)
#include <errno.h>
VALUE rb_eException;
-VALUE rb_eSystemExit, rb_eInterrupt, rb_eFatal;
+VALUE rb_eSystemExit;
+VALUE rb_eInterrupt;
+VALUE rb_eSignal;
+VALUE rb_eFatal;
VALUE rb_eStandardError;
VALUE rb_eRuntimeError;
VALUE rb_eSyntaxError;
@@ -238,7 +241,7 @@ VALUE rb_mErrno;
VALUE
rb_exc_new(etype, ptr, len)
VALUE etype;
- char *ptr;
+ const char *ptr;
int len;
{
VALUE exc = rb_obj_alloc(etype);
@@ -250,7 +253,7 @@ rb_exc_new(etype, ptr, len)
VALUE
rb_exc_new2(etype, s)
VALUE etype;
- char *s;
+ const char *s;
{
return rb_exc_new(etype, s, strlen(s));
}
@@ -436,7 +439,7 @@ extern int sys_nerr;
static VALUE
set_syserr(i, name)
int i;
- char *name;
+ const char *name;
{
#ifdef __BEOS__
VALUE *list;
@@ -509,8 +512,10 @@ Init_Exception()
rb_define_method(rb_eException, "set_backtrace", exc_set_backtrace, 1);
rb_eSystemExit = rb_define_class("SystemExit", rb_eException);
- rb_eFatal = rb_define_class("fatal", rb_eException);
+ rb_eFatal = rb_define_class("fatal", rb_eException);
+ rb_eInterrupt = rb_define_class("Interrupt", rb_eException);
rb_eInterrupt = rb_define_class("Interrupt", rb_eException);
+ rb_eSignal = rb_define_class("SignalException", rb_eException);
rb_eStandardError = rb_define_class("StandardError", rb_eException);
rb_eSyntaxError = rb_define_class("SyntaxError", rb_eStandardError);
@@ -529,11 +534,11 @@ Init_Exception()
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_raise(VALUE exc, char *fmt, ...)
+rb_raise(VALUE exc, const char *fmt, ...)
#else
rb_raise(exc, fmt, va_alist)
VALUE exc;
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -548,10 +553,10 @@ rb_raise(exc, fmt, va_alist)
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_loaderror(char *fmt, ...)
+rb_loaderror(const char *fmt, ...)
#else
rb_loaderror(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -574,10 +579,10 @@ rb_notimplement()
void
#ifdef HAVE_STDARG_PROTOTYPES
-rb_fatal(char *fmt, ...)
+rb_fatal(const char *fmt, ...)
#else
rb_fatal(fmt, va_alist)
- char *fmt;
+ const char *fmt;
va_dcl
#endif
{
@@ -594,7 +599,7 @@ rb_fatal(fmt, va_alist)
void
rb_sys_fail(mesg)
- char *mesg;
+ const char *mesg;
{
#ifndef NT
char *strerror();
@@ -1043,7 +1048,7 @@ init_syserr()
static void
err_append(s)
- char *s;
+ const char *s;
{
extern VALUE ruby_errinfo;