mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9cce6d1071
commit
7175a9073e
11 changed files with 22 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Jul 27 16:09:12 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
|
||||
clean unused-value warnings.
|
||||
|
||||
* cont.c, process.c, vm_exec.h: clean cast warnings.
|
||||
|
||||
Mon Jul 26 22:34:37 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_taint): Pathname#taint translated from
|
||||
|
|
2
class.c
2
class.c
|
@ -1274,7 +1274,7 @@ rb_singleton_class(VALUE obj)
|
|||
VALUE klass = singleton_class_of(obj);
|
||||
|
||||
/* ensures an exposed class belongs to its own eigenclass */
|
||||
if (TYPE(obj) == T_CLASS) ENSURE_EIGENCLASS(klass);
|
||||
if (TYPE(obj) == T_CLASS) (void)ENSURE_EIGENCLASS(klass);
|
||||
|
||||
return klass;
|
||||
}
|
||||
|
|
|
@ -5337,7 +5337,7 @@ iseq_build_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
|
|||
#define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary")
|
||||
#define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str")
|
||||
#define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym")
|
||||
static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
|
||||
static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
|
||||
|
||||
VALUE
|
||||
rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
|
||||
|
|
2
cont.c
2
cont.c
|
@ -564,7 +564,7 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
|
|||
getcontext(context);
|
||||
ptr = fiber_machine_stack_alloc(size);
|
||||
context->uc_link = NULL;
|
||||
context->uc_stack.ss_sp = ptr;
|
||||
context->uc_stack.ss_sp = (char *)ptr;
|
||||
context->uc_stack.ss_size = size;
|
||||
makecontext(context, rb_fiber_start, 0);
|
||||
sth->machine_stack_start = ptr + STACK_DIR_UPPER(0, size / sizeof(VALUE));
|
||||
|
|
4
dir.c
4
dir.c
|
@ -352,8 +352,8 @@ static VALUE dir_close(VALUE);
|
|||
#define GlobPathValue(str, safe) \
|
||||
/* can contain null bytes as separators */ \
|
||||
(!RB_TYPE_P(str, T_STRING) ? \
|
||||
FilePathValue(str) : \
|
||||
(check_safe_glob(str, safe), \
|
||||
(void)FilePathValue(str) : \
|
||||
(void)(check_safe_glob(str, safe), \
|
||||
check_glob_encoding(str), (str)))
|
||||
#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0)
|
||||
#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding()))
|
||||
|
|
2
file.c
2
file.c
|
@ -3119,7 +3119,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||
|
||||
#define check_expand_path_args(fname, dname) \
|
||||
((fname = rb_get_path(fname)), \
|
||||
(NIL_P(dname) ? dname : (dname = rb_get_path(dname))))
|
||||
(void)(NIL_P(dname) ? dname : (dname = rb_get_path(dname))))
|
||||
|
||||
static VALUE
|
||||
file_expand_path_1(VALUE fname)
|
||||
|
|
2
iseq.c
2
iseq.c
|
@ -436,7 +436,7 @@ rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VA
|
|||
#define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary")
|
||||
#define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str")
|
||||
#define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym")
|
||||
static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
|
||||
static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
|
||||
static VALUE
|
||||
iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
|
||||
{
|
||||
|
|
10
parse.y
10
parse.y
|
@ -6307,9 +6307,9 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
|
|||
VALUE name = 0, val = 0;
|
||||
const char *beg, *end, *vbeg, *vend;
|
||||
#define str_copy(_s, _p, _n) ((_s) \
|
||||
? (rb_str_resize((_s), (_n)), \
|
||||
? (void)(rb_str_resize((_s), (_n)), \
|
||||
MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
|
||||
: ((_s) = STR_NEW((_p), (_n))))
|
||||
: (void)((_s) = STR_NEW((_p), (_n))))
|
||||
|
||||
if (len <= 7) return FALSE;
|
||||
if (!(beg = magic_comment_marker(str, len))) return FALSE;
|
||||
|
@ -6474,12 +6474,12 @@ parser_prepare(struct parser_params *parser)
|
|||
#else
|
||||
#define ambiguous_operator(op, syn) dispatch2(operator_ambiguous, ripper_intern(op), rb_str_new_cstr(syn))
|
||||
#endif
|
||||
#define warn_balanced(op, syn) \
|
||||
#define warn_balanced(op, syn) ((void) \
|
||||
(last_state != EXPR_CLASS && last_state != EXPR_DOT && \
|
||||
last_state != EXPR_FNAME && last_state != EXPR_ENDFN && \
|
||||
last_state != EXPR_ENDARG && \
|
||||
space_seen && !ISSPACE(c) && \
|
||||
(ambiguous_operator(op, syn), 0))
|
||||
(ambiguous_operator(op, syn), 0)))
|
||||
|
||||
static int
|
||||
parser_yylex(struct parser_params *parser)
|
||||
|
@ -7291,7 +7291,7 @@ parser_yylex(struct parser_params *parser)
|
|||
}
|
||||
pushback(c);
|
||||
if (IS_SPCARG(c)) {
|
||||
arg_ambiguous();
|
||||
(void)arg_ambiguous();
|
||||
lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
|
||||
return tREGEXP_BEG;
|
||||
}
|
||||
|
|
|
@ -985,7 +985,7 @@ void rb_thread_reset_timer_thread(void);
|
|||
static int forked_child = 0;
|
||||
|
||||
#define before_exec() \
|
||||
(rb_enable_interrupt(), (forked_child ? 0 : (rb_thread_stop_timer_thread(), 1)))
|
||||
(rb_enable_interrupt(), (void)(forked_child ? 0 : (rb_thread_stop_timer_thread(), 1)))
|
||||
#define after_exec() \
|
||||
(rb_thread_reset_timer_thread(), rb_thread_start_timer_thread(), forked_child = 0, rb_disable_interrupt())
|
||||
#define before_fork() before_exec()
|
||||
|
|
2
random.c
2
random.c
|
@ -1066,7 +1066,7 @@ random_rand(int argc, VALUE *argv, VALUE obj)
|
|||
}
|
||||
else {
|
||||
v = Qnil;
|
||||
NUM2LONG(vmax);
|
||||
(void)NUM2LONG(vmax);
|
||||
}
|
||||
if (NIL_P(v)) {
|
||||
VALUE mesg = rb_str_new_cstr("invalid argument - ");
|
||||
|
|
|
@ -112,7 +112,7 @@ error !
|
|||
/* for GCC 3.4.x */
|
||||
#define TC_DISPATCH(insn) \
|
||||
INSN_DISPATCH_SIG(insn); \
|
||||
goto *GET_CURRENT_INSN(); \
|
||||
goto *(void const *)GET_CURRENT_INSN(); \
|
||||
;
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue