diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-14 09:51:50 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-14 09:51:50 +0000 |
commit | 260a7d2c83aacfc734d39896ed67b0ef591cce65 (patch) | |
tree | 18e0cbb91c6739ce586c91a17a6c350ab2b82330 /method.h | |
parent | f224fecc0fec5e73570137ab258af679fd9d3cfd (diff) |
method.h: cast checks to int for >= 0 checks
Setting VM_CHECK_MODE to 1 in vm_core.h makes noisy warnings
otherwise. AFAIK, the signedness of enums is
implementation-dependent, and GCC considers them unsigned and
warns.
Tested on gcc 4.7.2 (Debian 4.7.2-5)
* method.h (METHOD_ENTRY_VISI_SET): cast visi to int
(METHOD_ENTRY_FLAGS_SET): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'method.h')
-rw-r--r-- | method.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -68,7 +68,7 @@ typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_e static inline void METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi) { - VM_ASSERT(visi >= 0 && visi <= 3); + VM_ASSERT((int)visi >= 0 && visi <= 3); me->flags = (me->flags & ~(IMEMO_FL_USER0 | IMEMO_FL_USER1)) | (visi << IMEMO_FL_USHIFT+0); } static inline void @@ -86,7 +86,7 @@ METHOD_ENTRY_SAFE_SET(rb_method_entry_t *me, unsigned int safe) static inline void METHOD_ENTRY_FLAGS_SET(rb_method_entry_t *me, rb_method_visibility_t visi, unsigned int basic, unsigned int safe) { - VM_ASSERT(visi >= 0 && visi <= 3); + VM_ASSERT((int)visi >= 0 && visi <= 3); VM_ASSERT(basic <= 1); VM_ASSERT(safe <= 1); me->flags = |