Skip to content

Commit 2e9ed8e

Browse files
committed
cleanup compilation warnings
1 parent 9affa45 commit 2e9ed8e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/ruby_debug/ruby_debug.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ call_at_line_unprotected(VALUE args)
476476
{
477477
VALUE context;
478478
context = *RARRAY_PTR(args);
479-
return rb_funcall2(context, idAtLine, RARRAY_LEN(args) - 1, RARRAY_PTR(args) + 1);
479+
return rb_funcall2(context, idAtLine, (int)RARRAY_LEN(args) - 1, RARRAY_PTR(args) + 1);
480480
}
481481

482482
static VALUE
@@ -536,8 +536,8 @@ int
536536
filename_cmp(VALUE source, char *file)
537537
{
538538
char *source_ptr, *file_ptr;
539-
int s_len, f_len, min_len;
540-
int s,f;
539+
long s_len, f_len, min_len;
540+
long s,f;
541541
int dirsep_flag = 0;
542542

543543
s_len = RSTRING_LEN(source);
@@ -1740,7 +1740,7 @@ check_frame_number(debug_context_t *debug_context, VALUE frame)
17401740
return frame_n;
17411741
}
17421742

1743-
static int
1743+
static long
17441744
optional_frame_position(int argc, VALUE *argv) {
17451745
unsigned int i_scanned;
17461746
VALUE level;
@@ -2366,7 +2366,7 @@ FUNC_FASTCALL(do_jump)(rb_thread_t *th, rb_control_frame_t *cfp)
23662366
+1 for target frame
23672367
+1 for array terminator
23682368
*/
2369-
int frames = jump_cfp - cfp + 2;
2369+
long frames = jump_cfp - cfp + 2;
23702370
debug_context->old_iseq_catch = (iseq_catch_t*)malloc(frames * sizeof(iseq_catch_t));
23712371
MEMZERO(debug_context->old_iseq_catch, iseq_catch_t, frames);
23722372
frames = 0;
@@ -2410,7 +2410,7 @@ context_jump(VALUE self, VALUE line, VALUE file)
24102410
{
24112411
debug_context_t *debug_context;
24122412
debug_frame_t *debug_frame;
2413-
int i;
2413+
unsigned i;
24142414
rb_thread_t *th;
24152415
rb_control_frame_t *cfp;
24162416
rb_control_frame_t *cfp_end;
@@ -2434,7 +2434,7 @@ context_jump(VALUE self, VALUE line, VALUE file)
24342434
if (cfp->pc == debug_frame->info.runtime.last_pc)
24352435
{
24362436
cfp_start = cfp;
2437-
if ((cfp->pc - cfp->iseq->iseq_encoded) >= (cfp->iseq->iseq_size - 1))
2437+
if ((unsigned)(cfp->pc - cfp->iseq->iseq_encoded) >= (cfp->iseq->iseq_size - 1))
24382438
return(INT2FIX(1)); /* no space for opt_call_c_function hijack */
24392439
break;
24402440
}

0 commit comments

Comments
 (0)