* suppress warnings with -Wwrite-string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1b039e2a92
commit
075530a685
@ -1,3 +1,7 @@
|
|||||||
|
Sat May 31 18:28:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* suppress warnings with -Wwrite-string.
|
||||||
|
|
||||||
Sat May 31 18:26:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat May 31 18:26:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* array.c (rb_ary_delete_if): should return enumerator if no block
|
* array.c (rb_ary_delete_if): should return enumerator if no block
|
||||||
|
@ -134,7 +134,7 @@ static int iseq_set_optargs_table(rb_iseq_t *iseq);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
verify_list(ISEQ_ARG_DECLARE char *info, LINK_ANCHOR *anchor)
|
verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *anchor)
|
||||||
{
|
{
|
||||||
#if CPDEBUG
|
#if CPDEBUG
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
@ -2302,7 +2302,7 @@ static int
|
|||||||
defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
|
defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
|
||||||
NODE *node, LABEL **lfinish, VALUE needstr)
|
NODE *node, LABEL **lfinish, VALUE needstr)
|
||||||
{
|
{
|
||||||
char *estr = 0;
|
const char *estr = 0;
|
||||||
enum node_type type;
|
enum node_type type;
|
||||||
|
|
||||||
switch (type = nd_type(node)) {
|
switch (type = nd_type(node)) {
|
||||||
|
2
dir.c
2
dir.c
@ -458,7 +458,7 @@ dir_inspect(VALUE dir)
|
|||||||
|
|
||||||
Data_Get_Struct(dir, struct dir_data, dirp);
|
Data_Get_Struct(dir, struct dir_data, dirp);
|
||||||
if (dirp->path) {
|
if (dirp->path) {
|
||||||
char *c = rb_obj_classname(dir);
|
const char *c = rb_obj_classname(dir);
|
||||||
int len = strlen(c) + strlen(dirp->path) + 4;
|
int len = strlen(c) + strlen(dirp->path) + 4;
|
||||||
VALUE s = rb_str_new(0, len);
|
VALUE s = rb_str_new(0, len);
|
||||||
snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
|
snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
|
||||||
|
2
eval.c
2
eval.c
@ -326,7 +326,7 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
|
|||||||
void
|
void
|
||||||
rb_frozen_class_p(VALUE klass)
|
rb_frozen_class_p(VALUE klass)
|
||||||
{
|
{
|
||||||
char *desc = "something(?!)";
|
const char *desc = "something(?!)";
|
||||||
|
|
||||||
if (OBJ_FROZEN(klass)) {
|
if (OBJ_FROZEN(klass)) {
|
||||||
if (FL_TEST(klass, FL_SINGLETON))
|
if (FL_TEST(klass, FL_SINGLETON))
|
||||||
|
@ -69,7 +69,7 @@ error_print(void)
|
|||||||
VALUE errat = Qnil; /* OK */
|
VALUE errat = Qnil; /* OK */
|
||||||
VALUE errinfo = GET_THREAD()->errinfo;
|
VALUE errinfo = GET_THREAD()->errinfo;
|
||||||
volatile VALUE eclass, e;
|
volatile VALUE eclass, e;
|
||||||
char *einfo;
|
const char *einfo;
|
||||||
long elen;
|
long elen;
|
||||||
|
|
||||||
if (NIL_P(errinfo))
|
if (NIL_P(errinfo))
|
||||||
@ -188,7 +188,7 @@ ruby_error_print(void)
|
|||||||
void
|
void
|
||||||
rb_print_undef(VALUE klass, ID id, int scope)
|
rb_print_undef(VALUE klass, ID id, int scope)
|
||||||
{
|
{
|
||||||
char *v;
|
const char *v;
|
||||||
|
|
||||||
switch (scope) {
|
switch (scope) {
|
||||||
default:
|
default:
|
||||||
|
@ -583,7 +583,7 @@ VALUE rb_struct_iv_get(VALUE, const char*);
|
|||||||
VALUE rb_struct_s_members(VALUE);
|
VALUE rb_struct_s_members(VALUE);
|
||||||
VALUE rb_struct_members(VALUE);
|
VALUE rb_struct_members(VALUE);
|
||||||
VALUE rb_struct_alloc_noinit(VALUE);
|
VALUE rb_struct_alloc_noinit(VALUE);
|
||||||
VALUE rb_struct_define_without_accessor(char *, VALUE, rb_alloc_func_t, ...);
|
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
|
||||||
/* thread.c */
|
/* thread.c */
|
||||||
typedef void rb_unblock_function_t(void *);
|
typedef void rb_unblock_function_t(void *);
|
||||||
typedef VALUE rb_blocking_function_t(void *);
|
typedef VALUE rb_blocking_function_t(void *);
|
||||||
|
@ -778,8 +778,8 @@ VALUE rb_id2str(ID);
|
|||||||
rb_intern(str))
|
rb_intern(str))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *rb_class2name(VALUE);
|
const char *rb_class2name(VALUE);
|
||||||
char *rb_obj_classname(VALUE);
|
const char *rb_obj_classname(VALUE);
|
||||||
|
|
||||||
void rb_p(VALUE);
|
void rb_p(VALUE);
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ defined
|
|||||||
(VALUE val)
|
(VALUE val)
|
||||||
{
|
{
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
char *expr_type = 0;
|
const char *expr_type = 0;
|
||||||
val = Qnil;
|
val = Qnil;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
8
io.c
8
io.c
@ -1248,7 +1248,7 @@ static VALUE
|
|||||||
rb_io_inspect(VALUE obj)
|
rb_io_inspect(VALUE obj)
|
||||||
{
|
{
|
||||||
rb_io_t *fptr;
|
rb_io_t *fptr;
|
||||||
char *cname;
|
const char *cname;
|
||||||
const char *st = "";
|
const char *st = "";
|
||||||
|
|
||||||
fptr = RFILE(rb_io_taint_check(obj))->fptr;
|
fptr = RFILE(rb_io_taint_check(obj))->fptr;
|
||||||
@ -5057,7 +5057,7 @@ static VALUE
|
|||||||
rb_io_s_new(int argc, VALUE *argv, VALUE klass)
|
rb_io_s_new(int argc, VALUE *argv, VALUE klass)
|
||||||
{
|
{
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
char *cname = rb_class2name(klass);
|
const char *cname = rb_class2name(klass);
|
||||||
|
|
||||||
rb_warn("%s::new() does not take block; use %s::open() instead",
|
rb_warn("%s::new() does not take block; use %s::open() instead",
|
||||||
cname, cname);
|
cname, cname);
|
||||||
@ -6345,9 +6345,9 @@ struct copy_stream_struct {
|
|||||||
int close_src;
|
int close_src;
|
||||||
int close_dst;
|
int close_dst;
|
||||||
off_t total;
|
off_t total;
|
||||||
char *syserr;
|
const char *syserr;
|
||||||
int error_no;
|
int error_no;
|
||||||
char *notimp;
|
const char *notimp;
|
||||||
rb_fdset_t fds;
|
rb_fdset_t fds;
|
||||||
rb_thread_t *th;
|
rb_thread_t *th;
|
||||||
};
|
};
|
||||||
|
2
iseq.c
2
iseq.c
@ -774,7 +774,7 @@ ruby_iseq_disasm_insn(VALUE ret, VALUE *iseq, int pos,
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
catch_type(int type)
|
catch_type(int type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
2
keywords
2
keywords
@ -1,5 +1,5 @@
|
|||||||
%{
|
%{
|
||||||
struct kwtable {char *name; int id[2]; enum lex_state_e state;};
|
struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
|
||||||
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
%}
|
%}
|
||||||
|
@ -30,7 +30,7 @@ error "gperf generated tables don't work with this execution character set. Plea
|
|||||||
|
|
||||||
#line 1 "keywords"
|
#line 1 "keywords"
|
||||||
|
|
||||||
struct kwtable {char *name; int id[2]; enum lex_state_e state;};
|
struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
|
||||||
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
#line 7 "keywords"
|
#line 7 "keywords"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
%{
|
%{
|
||||||
struct kwtable {char *name; int id[2]; enum lex_state_e state;};
|
struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
|
||||||
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
%}
|
%}
|
||||||
|
@ -414,7 +414,7 @@ hash_each(VALUE key, VALUE value, struct dump_call_arg *arg)
|
|||||||
static void
|
static void
|
||||||
w_extended(VALUE klass, struct dump_arg *arg, int check)
|
w_extended(VALUE klass, struct dump_arg *arg, int check)
|
||||||
{
|
{
|
||||||
char *path;
|
const char *path;
|
||||||
|
|
||||||
if (check && FL_TEST(klass, FL_SINGLETON)) {
|
if (check && FL_TEST(klass, FL_SINGLETON)) {
|
||||||
if (RCLASS_M_TBL(klass)->num_entries ||
|
if (RCLASS_M_TBL(klass)->num_entries ||
|
||||||
|
2
math.c
2
math.c
@ -35,7 +35,7 @@ to_flo(VALUE x)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
domain_check(double x, char *msg)
|
domain_check(double x, const char *msg)
|
||||||
{
|
{
|
||||||
while(1) {
|
while(1) {
|
||||||
if (errno) {
|
if (errno) {
|
||||||
|
@ -217,7 +217,7 @@ typedef struct __sFILE {
|
|||||||
* I/O descriptors for __sfvwrite().
|
* I/O descriptors for __sfvwrite().
|
||||||
*/
|
*/
|
||||||
struct __siov {
|
struct __siov {
|
||||||
void *iov_base;
|
const void *iov_base;
|
||||||
size_t iov_len;
|
size_t iov_len;
|
||||||
};
|
};
|
||||||
struct __suio {
|
struct __suio {
|
||||||
@ -422,7 +422,7 @@ BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero, char *xdigs
|
|||||||
* use the given digits.
|
* use the given digits.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
BSD__ultoa(register u_long val, char *endp, int base, int octzero, char *xdigs)
|
BSD__ultoa(register u_long val, char *endp, int base, int octzero, const char *xdigs)
|
||||||
{
|
{
|
||||||
register char *cp = endp;
|
register char *cp = endp;
|
||||||
register long sval;
|
register long sval;
|
||||||
@ -523,10 +523,10 @@ static int exponent __P((char *, int, int));
|
|||||||
static int
|
static int
|
||||||
BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
|
BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
|
||||||
{
|
{
|
||||||
register char *fmt; /* format string */
|
register const char *fmt; /* format string */
|
||||||
register int ch; /* character from fmt */
|
register int ch; /* character from fmt */
|
||||||
register int n; /* handy integer (short term usage) */
|
register int n; /* handy integer (short term usage) */
|
||||||
register char *cp; /* handy char pointer (short term usage) */
|
register const char *cp;/* handy char pointer (short term usage) */
|
||||||
register struct __siov *iovp;/* for PRINT macro */
|
register struct __siov *iovp;/* for PRINT macro */
|
||||||
register int flags; /* flags as above */
|
register int flags; /* flags as above */
|
||||||
int ret; /* return value accumulator */
|
int ret; /* return value accumulator */
|
||||||
@ -550,12 +550,13 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
|
|||||||
int fieldsz; /* field size expanded by sign, etc */
|
int fieldsz; /* field size expanded by sign, etc */
|
||||||
int realsz; /* field size expanded by dprec */
|
int realsz; /* field size expanded by dprec */
|
||||||
int size; /* size of converted field or string */
|
int size; /* size of converted field or string */
|
||||||
char *xdigs = 0; /* digits for [xX] conversion */
|
const char *xdigs = 0; /* digits for [xX] conversion */
|
||||||
#define NIOV 8
|
#define NIOV 8
|
||||||
struct __suio uio; /* output information: summary */
|
struct __suio uio; /* output information: summary */
|
||||||
struct __siov iov[NIOV];/* ... and individual io vectors */
|
struct __siov iov[NIOV];/* ... and individual io vectors */
|
||||||
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
|
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
|
||||||
char ox[2]; /* space for 0x hex-prefix */
|
char ox[2]; /* space for 0x hex-prefix */
|
||||||
|
char *const ebuf = buf + sizeof(buf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Choose PADSIZE to trade efficiency vs. size. If larger printf
|
* Choose PADSIZE to trade efficiency vs. size. If larger printf
|
||||||
@ -616,7 +617,7 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
|
|||||||
fp->_file >= 0)
|
fp->_file >= 0)
|
||||||
return (BSD__sbprintf(fp, fmt0, ap));
|
return (BSD__sbprintf(fp, fmt0, ap));
|
||||||
|
|
||||||
fmt = (char *)fmt0;
|
fmt = fmt0;
|
||||||
uio.uio_iov = iovp = iov;
|
uio.uio_iov = iovp = iov;
|
||||||
uio.uio_resid = 0;
|
uio.uio_resid = 0;
|
||||||
uio.uio_iovcnt = 0;
|
uio.uio_iovcnt = 0;
|
||||||
@ -720,7 +721,8 @@ reswitch: switch (ch) {
|
|||||||
goto rflag;
|
goto rflag;
|
||||||
#endif /* _HAVE_SANE_QUAD_ */
|
#endif /* _HAVE_SANE_QUAD_ */
|
||||||
case 'c':
|
case 'c':
|
||||||
*(cp = buf) = va_arg(ap, int);
|
cp = buf;
|
||||||
|
*buf = (char)va_arg(ap, int);
|
||||||
size = 1;
|
size = 1;
|
||||||
sign = '\0';
|
sign = '\0';
|
||||||
break;
|
break;
|
||||||
@ -868,7 +870,7 @@ fp_begin: _double = va_arg(ap, double);
|
|||||||
* NUL in the first `prec' characters, and
|
* NUL in the first `prec' characters, and
|
||||||
* strlen() will go further.
|
* strlen() will go further.
|
||||||
*/
|
*/
|
||||||
char *p = (char *)memchr(cp, 0, prec);
|
const char *p = (char *)memchr(cp, 0, prec);
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
size = p - cp;
|
size = p - cp;
|
||||||
@ -930,28 +932,27 @@ number: if ((dprec = prec) >= 0)
|
|||||||
* explicit precision of zero is no characters.''
|
* explicit precision of zero is no characters.''
|
||||||
* -- ANSI X3J11
|
* -- ANSI X3J11
|
||||||
*/
|
*/
|
||||||
cp = buf + BUF;
|
|
||||||
#ifdef _HAVE_SANE_QUAD_
|
#ifdef _HAVE_SANE_QUAD_
|
||||||
if (flags & QUADINT) {
|
if (flags & QUADINT) {
|
||||||
if (uqval != 0 || prec != 0)
|
if (uqval != 0 || prec != 0)
|
||||||
cp = BSD__uqtoa(uqval, cp, base,
|
cp = BSD__uqtoa(uqval, ebuf, base,
|
||||||
flags & ALT, xdigs);
|
flags & ALT, xdigs);
|
||||||
} else
|
} else
|
||||||
#else /* _HAVE_SANE_QUAD_ */
|
#else /* _HAVE_SANE_QUAD_ */
|
||||||
#endif /* _HAVE_SANE_QUAD_ */
|
#endif /* _HAVE_SANE_QUAD_ */
|
||||||
{
|
{
|
||||||
if (ulval != 0 || prec != 0)
|
if (ulval != 0 || prec != 0)
|
||||||
cp = BSD__ultoa(ulval, cp, base,
|
cp = BSD__ultoa(ulval, ebuf, base,
|
||||||
flags & ALT, xdigs);
|
flags & ALT, xdigs);
|
||||||
}
|
}
|
||||||
size = buf + BUF - cp;
|
size = ebuf - cp;
|
||||||
break;
|
break;
|
||||||
default: /* "%?" prints ?, unless ? is NUL */
|
default: /* "%?" prints ?, unless ? is NUL */
|
||||||
if (ch == '\0')
|
if (ch == '\0')
|
||||||
goto done;
|
goto done;
|
||||||
/* pretend it was %c with argument ch */
|
/* pretend it was %c with argument ch */
|
||||||
cp = buf;
|
cp = buf;
|
||||||
*cp = ch;
|
*buf = ch;
|
||||||
size = 1;
|
size = 1;
|
||||||
sign = '\0';
|
sign = '\0';
|
||||||
break;
|
break;
|
||||||
|
11
object.c
11
object.c
@ -298,7 +298,7 @@ rb_obj_init_copy(VALUE obj, VALUE orig)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_any_to_s(VALUE obj)
|
rb_any_to_s(VALUE obj)
|
||||||
{
|
{
|
||||||
char *cname = rb_obj_classname(obj);
|
const char *cname = rb_obj_classname(obj);
|
||||||
VALUE str;
|
VALUE str;
|
||||||
|
|
||||||
str = rb_sprintf("#<%s:%p>", cname, (void*)obj);
|
str = rb_sprintf("#<%s:%p>", cname, (void*)obj);
|
||||||
@ -387,9 +387,8 @@ rb_obj_inspect(VALUE obj)
|
|||||||
|
|
||||||
if (has_ivar) {
|
if (has_ivar) {
|
||||||
VALUE str;
|
VALUE str;
|
||||||
char *c;
|
const char *c = rb_obj_classname(obj);
|
||||||
|
|
||||||
c = rb_obj_classname(obj);
|
|
||||||
str = rb_sprintf("-<%s:%p", c, (void*)obj);
|
str = rb_sprintf("-<%s:%p", c, (void*)obj);
|
||||||
return rb_exec_recursive(inspect_obj, obj, str);
|
return rb_exec_recursive(inspect_obj, obj, str);
|
||||||
}
|
}
|
||||||
@ -1916,7 +1915,7 @@ rb_convert_type(VALUE val, int type, const char *tname, const char *method)
|
|||||||
if (TYPE(val) == type) return val;
|
if (TYPE(val) == type) return val;
|
||||||
v = convert_type(val, tname, method, Qtrue);
|
v = convert_type(val, tname, method, Qtrue);
|
||||||
if (TYPE(v) != type) {
|
if (TYPE(v) != type) {
|
||||||
char *cname = rb_obj_classname(val);
|
const char *cname = rb_obj_classname(val);
|
||||||
rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
|
rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
|
||||||
cname, tname, cname, method, rb_obj_classname(v));
|
cname, tname, cname, method, rb_obj_classname(v));
|
||||||
}
|
}
|
||||||
@ -1933,7 +1932,7 @@ rb_check_convert_type(VALUE val, int type, const char *tname, const char *method
|
|||||||
v = convert_type(val, tname, method, Qfalse);
|
v = convert_type(val, tname, method, Qfalse);
|
||||||
if (NIL_P(v)) return Qnil;
|
if (NIL_P(v)) return Qnil;
|
||||||
if (TYPE(v) != type) {
|
if (TYPE(v) != type) {
|
||||||
char *cname = rb_obj_classname(val);
|
const char *cname = rb_obj_classname(val);
|
||||||
rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
|
rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
|
||||||
cname, tname, cname, method, rb_obj_classname(v));
|
cname, tname, cname, method, rb_obj_classname(v));
|
||||||
}
|
}
|
||||||
@ -1949,7 +1948,7 @@ rb_to_integer(VALUE val, const char *method)
|
|||||||
if (FIXNUM_P(val)) return val;
|
if (FIXNUM_P(val)) return val;
|
||||||
v = convert_type(val, "Integer", method, Qtrue);
|
v = convert_type(val, "Integer", method, Qtrue);
|
||||||
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
|
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
|
||||||
char *cname = rb_obj_classname(val);
|
const char *cname = rb_obj_classname(val);
|
||||||
rb_raise(rb_eTypeError, "can't convert %s to Integer (%s#%s gives %s)",
|
rb_raise(rb_eTypeError, "can't convert %s to Integer (%s#%s gives %s)",
|
||||||
cname, cname, method, rb_obj_classname(v));
|
cname, cname, method, rb_obj_classname(v));
|
||||||
}
|
}
|
||||||
|
4
pack.c
4
pack.c
@ -475,7 +475,7 @@ pack_pack(VALUE ary, VALUE fmt)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (*p == '_' || *p == '!') {
|
if (*p == '_' || *p == '!') {
|
||||||
const char *natstr = "sSiIlL";
|
static const char natstr[] = "sSiIlL";
|
||||||
|
|
||||||
if (strchr(natstr, type)) {
|
if (strchr(natstr, type)) {
|
||||||
#ifdef NATINT_PACK
|
#ifdef NATINT_PACK
|
||||||
@ -1335,7 +1335,7 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||||||
}
|
}
|
||||||
star = 0;
|
star = 0;
|
||||||
if (*p == '_' || *p == '!') {
|
if (*p == '_' || *p == '!') {
|
||||||
const char *natstr = "sSiIlL";
|
static const char natstr[] = "sSiIlL";
|
||||||
|
|
||||||
if (strchr(natstr, type)) {
|
if (strchr(natstr, type)) {
|
||||||
#ifdef NATINT_PACK
|
#ifdef NATINT_PACK
|
||||||
|
4
proc.c
4
proc.c
@ -661,7 +661,7 @@ proc_to_s(VALUE self)
|
|||||||
{
|
{
|
||||||
VALUE str = 0;
|
VALUE str = 0;
|
||||||
rb_proc_t *proc;
|
rb_proc_t *proc;
|
||||||
char *cname = rb_obj_classname(self);
|
const char *cname = rb_obj_classname(self);
|
||||||
rb_iseq_t *iseq;
|
rb_iseq_t *iseq;
|
||||||
const char *is_lambda;
|
const char *is_lambda;
|
||||||
|
|
||||||
@ -1417,7 +1417,7 @@ method_inspect(VALUE method)
|
|||||||
struct METHOD *data;
|
struct METHOD *data;
|
||||||
VALUE str;
|
VALUE str;
|
||||||
const char *s;
|
const char *s;
|
||||||
char *sharp = "#";
|
const char *sharp = "#";
|
||||||
|
|
||||||
Data_Get_Struct(method, struct METHOD, data);
|
Data_Get_Struct(method, struct METHOD, data);
|
||||||
str = rb_str_buf_new2("#<");
|
str = rb_str_buf_new2("#<");
|
||||||
|
2
re.c
2
re.c
@ -1753,7 +1753,7 @@ match_inspect_name_iter(const OnigUChar *name, const OnigUChar *name_end,
|
|||||||
static VALUE
|
static VALUE
|
||||||
match_inspect(VALUE match)
|
match_inspect(VALUE match)
|
||||||
{
|
{
|
||||||
char *cname = rb_obj_classname(match);
|
const char *cname = rb_obj_classname(match);
|
||||||
VALUE str;
|
VALUE str;
|
||||||
int i;
|
int i;
|
||||||
struct re_registers *regs = RMATCH_REGS(match);
|
struct re_registers *regs = RMATCH_REGS(match);
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
extern UChar*
|
extern UChar*
|
||||||
onig_error_code_to_format(int code)
|
onig_error_code_to_format(int code)
|
||||||
{
|
{
|
||||||
char *p;
|
const char *p;
|
||||||
|
|
||||||
if (code >= 0) return (UChar* )0;
|
if (code >= 0) return (UChar* )0;
|
||||||
|
|
||||||
|
2
ruby.c
2
ruby.c
@ -89,7 +89,7 @@ struct cmdline_options {
|
|||||||
int verbose;
|
int verbose;
|
||||||
int yydebug;
|
int yydebug;
|
||||||
unsigned int dump;
|
unsigned int dump;
|
||||||
char *script;
|
const char *script;
|
||||||
VALUE script_name;
|
VALUE script_name;
|
||||||
VALUE e_script;
|
VALUE e_script;
|
||||||
struct {
|
struct {
|
||||||
|
3
string.c
3
string.c
@ -5914,7 +5914,8 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
|
|||||||
VALUE w;
|
VALUE w;
|
||||||
long width, len, flen = 1, fclen = 1;
|
long width, len, flen = 1, fclen = 1;
|
||||||
VALUE res;
|
VALUE res;
|
||||||
char *p, *f = " ";
|
char *p;
|
||||||
|
const char *f = " ";
|
||||||
long n, llen, rlen;
|
long n, llen, rlen;
|
||||||
volatile VALUE pad;
|
volatile VALUE pad;
|
||||||
int singlebyte = 1;
|
int singlebyte = 1;
|
||||||
|
4
struct.c
4
struct.c
@ -223,7 +223,7 @@ rb_struct_alloc_noinit(VALUE klass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_struct_define_without_accessor(char *class_name, VALUE super, rb_alloc_func_t alloc, ...)
|
rb_struct_define_without_accessor(const char *class_name, VALUE super, rb_alloc_func_t alloc, ...)
|
||||||
{
|
{
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
va_list ar;
|
va_list ar;
|
||||||
@ -479,7 +479,7 @@ rb_struct_each_pair(VALUE s)
|
|||||||
static VALUE
|
static VALUE
|
||||||
inspect_struct(VALUE s, VALUE dummy, int recur)
|
inspect_struct(VALUE s, VALUE dummy, int recur)
|
||||||
{
|
{
|
||||||
char *cname = rb_class2name(rb_obj_class(s));
|
const char *cname = rb_class2name(rb_obj_class(s));
|
||||||
VALUE str, members;
|
VALUE str, members;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
|
6
thread.c
6
thread.c
@ -1471,7 +1471,7 @@ rb_thread_safe_level(VALUE thread)
|
|||||||
static VALUE
|
static VALUE
|
||||||
rb_thread_inspect(VALUE thread)
|
rb_thread_inspect(VALUE thread)
|
||||||
{
|
{
|
||||||
char *cname = rb_obj_classname(thread);
|
const char *cname = rb_obj_classname(thread);
|
||||||
rb_thread_t *th;
|
rb_thread_t *th;
|
||||||
const char *status;
|
const char *status;
|
||||||
VALUE str;
|
VALUE str;
|
||||||
@ -2491,7 +2491,7 @@ VALUE
|
|||||||
rb_mutex_unlock(VALUE self)
|
rb_mutex_unlock(VALUE self)
|
||||||
{
|
{
|
||||||
mutex_t *mutex;
|
mutex_t *mutex;
|
||||||
char *err = NULL;
|
const char *err = NULL;
|
||||||
GetMutexPtr(self, mutex);
|
GetMutexPtr(self, mutex);
|
||||||
|
|
||||||
native_mutex_lock(&mutex->lock);
|
native_mutex_lock(&mutex->lock);
|
||||||
@ -3039,7 +3039,7 @@ thread_set_trace_func_m(VALUE obj, VALUE trace)
|
|||||||
return trace;
|
return trace;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
get_event_name(rb_event_flag_t event)
|
get_event_name(rb_event_flag_t event)
|
||||||
{
|
{
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
2
time.c
2
time.c
@ -333,7 +333,7 @@ time_s_at(int argc, VALUE *argv, VALUE klass)
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *const months[] = {
|
static const char const months[][4] = {
|
||||||
"jan", "feb", "mar", "apr", "may", "jun",
|
"jan", "feb", "mar", "apr", "may", "jun",
|
||||||
"jul", "aug", "sep", "oct", "nov", "dec",
|
"jul", "aug", "sep", "oct", "nov", "dec",
|
||||||
};
|
};
|
||||||
|
2
util.c
2
util.c
@ -3202,7 +3202,7 @@ rv_alloc(int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
nrv_alloc(char *s, char **rve, int n)
|
nrv_alloc(const char *s, char **rve, int n)
|
||||||
{
|
{
|
||||||
char *rv, *t;
|
char *rv, *t;
|
||||||
|
|
||||||
|
@ -270,13 +270,13 @@ rb_class_name(VALUE klass)
|
|||||||
return rb_class_path(rb_class_real(klass));
|
return rb_class_path(rb_class_real(klass));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
rb_class2name(VALUE klass)
|
rb_class2name(VALUE klass)
|
||||||
{
|
{
|
||||||
return RSTRING_PTR(rb_class_name(klass));
|
return RSTRING_PTR(rb_class_name(klass));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
rb_obj_classname(VALUE obj)
|
rb_obj_classname(VALUE obj)
|
||||||
{
|
{
|
||||||
return rb_class2name(CLASS_OF(obj));
|
return rb_class2name(CLASS_OF(obj));
|
||||||
|
@ -576,7 +576,6 @@ VALUE rb_make_backtrace(void);
|
|||||||
void
|
void
|
||||||
rb_vm_bugreport(void)
|
rb_vm_bugreport(void)
|
||||||
{
|
{
|
||||||
rb_thread_t *th = GET_THREAD();
|
|
||||||
VALUE bt;
|
VALUE bt;
|
||||||
|
|
||||||
if (GET_THREAD()->vm) {
|
if (GET_THREAD()->vm) {
|
||||||
|
@ -293,7 +293,7 @@ rb_method_missing(int argc, const VALUE *argv, VALUE obj)
|
|||||||
{
|
{
|
||||||
ID id;
|
ID id;
|
||||||
VALUE exc = rb_eNoMethodError;
|
VALUE exc = rb_eNoMethodError;
|
||||||
char *format = 0;
|
const char *format = 0;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
int last_call_status = th->method_missing_reason;
|
int last_call_status = th->method_missing_reason;
|
||||||
if (argc == 0 || !SYMBOL_P(argv[0])) {
|
if (argc == 0 || !SYMBOL_P(argv[0])) {
|
||||||
@ -773,7 +773,7 @@ VALUE
|
|||||||
rb_f_eval(int argc, VALUE *argv, VALUE self)
|
rb_f_eval(int argc, VALUE *argv, VALUE self)
|
||||||
{
|
{
|
||||||
VALUE src, scope, vfile, vline;
|
VALUE src, scope, vfile, vline;
|
||||||
char *file = "(eval)";
|
const char *file = "(eval)";
|
||||||
int line = 1;
|
int line = 1;
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
|
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
|
||||||
@ -925,7 +925,7 @@ specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
|
|||||||
return yield_under(klass, self, Qundef);
|
return yield_under(klass, self, Qundef);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *file = "(eval)";
|
const char *file = "(eval)";
|
||||||
int line = 1;
|
int line = 1;
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
|
@ -484,7 +484,7 @@ rb_undef(VALUE klass, ID id)
|
|||||||
}
|
}
|
||||||
body = search_method(klass, id, &origin);
|
body = search_method(klass, id, &origin);
|
||||||
if (!body || !body->nd_body) {
|
if (!body || !body->nd_body) {
|
||||||
char *s0 = " class";
|
const char *s0 = " class";
|
||||||
VALUE c = klass;
|
VALUE c = klass;
|
||||||
|
|
||||||
if (FL_TEST(c, FL_SINGLETON)) {
|
if (FL_TEST(c, FL_SINGLETON)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user