summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:18:41 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:18:41 +0200
commit90e6023292e2bfe927bd633bac42fc355bb9f4d1 (patch)
tree14664b9e9d98f43c83b78547ea7c554fef8de9d1 /util.h
parent383e3e833a7fbb8b1560ba861b76e8be96542c6f (diff)
Add support for fixnums.
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 6 insertions, 2 deletions
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;
}