From 90e6023292e2bfe927bd633bac42fc355bb9f4d1 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 4 Aug 2008 18:18:41 +0200 Subject: Add support for fixnums. --- util.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index fbde2b2..861a74d 100644 --- a/util.h +++ b/util.h @@ -45,7 +45,7 @@ #define LRELEASE(VALUE) \ ({ id __object = VALUE; \ - if (__object) RELEASE(__object); }) + if (MLKInstanceP (__object)) RELEASE(__object); }) #define LRETAIN(VALUE) \ ({ id __object = VALUE; \ @@ -58,7 +58,9 @@ static id stringify (id value) __attribute__ ((pure, unused)); static id nullify (id value) { - if (value) + if (MLKFixnumP (value)) + return [MLKInteger integerWithFixnum:value]; + else if (value) return value; else return [NSNull null]; @@ -68,6 +70,8 @@ static id denullify (id value) { if (value == [NSNull null]) return nil; + else if ([value isKindOfClass:[MLKInteger class]]) + return MLKCanoniseInteger (value); else return value; } -- cgit v1.2.3