Convert calls to Obj_To_[FI]64
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/be77123b Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/be77123b Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/be77123b Branch: refs/heads/master Commit: be77123b21ee3b9987274e822cb611bf82107a3a Parents: 2000cf9 Author: Nick Wellnhofer <[email protected]> Authored: Fri May 22 17:17:39 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Wed May 27 16:01:11 2015 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/Num.c | 2 +- runtime/perl/xs/XSBind.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/be77123b/runtime/core/Clownfish/Num.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Num.c b/runtime/core/Clownfish/Num.c index 862156c..1016aa3 100644 --- a/runtime/core/Clownfish/Num.c +++ b/runtime/core/Clownfish/Num.c @@ -83,7 +83,7 @@ IntNum_Compare_To_IMP(IntNum *self, Obj *other) { return -Obj_Compare_To(other, (Obj*)self); } int64_t self_value = IntNum_To_I64(self); - int64_t other_value = Obj_To_I64(other); + int64_t other_value = IntNum_To_I64((IntNum*)other); if (self_value < other_value) { return -1; } else if (self_value > other_value) { return 1; } return 0; http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/be77123b/runtime/perl/xs/XSBind.c ---------------------------------------------------------------------- diff --git a/runtime/perl/xs/XSBind.c b/runtime/perl/xs/XSBind.c index 7640e5c..eca8145 100644 --- a/runtime/perl/xs/XSBind.c +++ b/runtime/perl/xs/XSBind.c @@ -25,6 +25,7 @@ #include "Clownfish/CharBuf.h" #include "Clownfish/HashIterator.h" #include "Clownfish/Method.h" +#include "Clownfish/Num.h" #include "Clownfish/TestHarness/TestUtils.h" #include "Clownfish/Util/Atomic.h" #include "Clownfish/Util/StringHelper.h" @@ -160,7 +161,7 @@ XSBind_cfish_to_perl(pTHX_ cfish_Obj *obj) { return S_cfish_hash_to_perl_hash(aTHX_ (cfish_Hash*)obj); } else if (CFISH_Obj_Is_A(obj, CFISH_FLOATNUM)) { - return newSVnv(CFISH_Obj_To_F64(obj)); + return newSVnv(CFISH_FloatNum_To_F64((cfish_FloatNum*)obj)); } else if (obj == (cfish_Obj*)CFISH_TRUE) { return newSViv(1); @@ -169,15 +170,15 @@ XSBind_cfish_to_perl(pTHX_ cfish_Obj *obj) { return newSViv(0); } else if (sizeof(IV) == 8 && CFISH_Obj_Is_A(obj, CFISH_INTNUM)) { - int64_t num = CFISH_Obj_To_I64(obj); + int64_t num = CFISH_IntNum_To_I64((cfish_IntNum*)obj); return newSViv((IV)num); } else if (sizeof(IV) == 4 && CFISH_Obj_Is_A(obj, CFISH_INTEGER32)) { - int32_t num = (int32_t)CFISH_Obj_To_I64(obj); + int32_t num = (int32_t)CFISH_Int32_To_I64((cfish_Integer32*)obj); return newSViv((IV)num); } else if (sizeof(IV) == 4 && CFISH_Obj_Is_A(obj, CFISH_INTEGER64)) { - int64_t num = CFISH_Obj_To_I64(obj); + int64_t num = CFISH_Int64_To_I64((cfish_Integer64*)obj); return newSVnv((double)num); // lossy } else {
