diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-04 18:18:41 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-04 18:18:41 +0200 |
commit | 90e6023292e2bfe927bd633bac42fc355bb9f4d1 (patch) | |
tree | 14664b9e9d98f43c83b78547ea7c554fef8de9d1 /util.h | |
parent | 383e3e833a7fbb8b1560ba861b76e8be96542c6f (diff) |
Add support for fixnums.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |