From 80cce5a21d5dde55b9596e245303c7f87bc028ce Mon Sep 17 00:00:00 2001 From: abscondment Date: Tue, 26 Jan 2010 16:14:22 -0800 Subject: [PATCH] Fewer compilation warnings for 1.9 --- ext/rb_cComputation.c | 2 +- ext/rb_cPriorityQueue.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/rb_cComputation.c b/ext/rb_cComputation.c index f6a0043..7946edd 100644 --- a/ext/rb_cComputation.c +++ b/ext/rb_cComputation.c @@ -175,7 +175,7 @@ RubyVor_nn_graph(VALUE self) if (RARRAY_LEN(graphPtr[i]) < 1) { /* Evaluate noNeighborResponse and respond accordingly */ if (noNeighborResponse == 1) { - rb_raise(rb_eIndexError, "index of 0 (no neighbors) at %i", i); + rb_raise(rb_eIndexError, "index of 0 (no neighbors) at %li", i); } else if (noNeighborResponse == 2) { /* No valid triangles touched this node -- include *all* possible neighbors * diff --git a/ext/rb_cPriorityQueue.c b/ext/rb_cPriorityQueue.c index 4a8e0a7..d5ec7bd 100644 --- a/ext/rb_cPriorityQueue.c +++ b/ext/rb_cPriorityQueue.c @@ -17,13 +17,12 @@ compare(VALUE a, VALUE b) if (CLASS_OF(a) == rb_path2class("RubyVor::PriorityQueue::QueueItem")) aD = NUM2DBL(rb_funcall(a, rb_intern("priority"), 0)); else - rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", rb_obj_classname(a), rb_path2class("RubyVor::PriorityQueue::QueueItem")); + rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", rb_obj_classname(a), rb_obj_classname(rb_path2class("RubyVor::PriorityQueue::QueueItem"))); if (CLASS_OF(a) == rb_path2class("RubyVor::PriorityQueue::QueueItem")) - bD = NUM2DBL(rb_funcall(b, rb_intern("priority"), 0)); else - rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", rb_obj_classname(a), rb_path2class("RubyVor::PriorityQueue::QueueItem")); + rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", rb_obj_classname(a), rb_obj_classname(rb_path2class("RubyVor::PriorityQueue::QueueItem"))); return RTEST(aD < bD); } @@ -43,7 +42,7 @@ RubyVor_percolate_up(VALUE self, VALUE index) i = FIX2INT(index) + 1; if (i < 1 || i > size) - rb_raise(rb_eIndexError, "index %i out of range", i-1); + rb_raise(rb_eIndexError, "index %li out of range", i-1); j = i / 2; @@ -79,7 +78,7 @@ RubyVor_percolate_down(VALUE self, VALUE index) i = FIX2INT(index) + 1; if (i < 1 || i > size) - rb_raise(rb_eIndexError, "index %i out of range", i-1); + rb_raise(rb_eIndexError, "index %li out of range", i-1); j = size / 2;