diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-09 10:22:19 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-09 10:22:19 +0200 |
commit | e2b78839c16f05cd3c0eb83063bcc449e93fe616 (patch) | |
tree | 08596832702f6203738f63997849c061ee0ccb0d /MLKArray.m | |
parent | 28f00343ce1fa21f4559bac70e58b723e2d59a6b (diff) | |
parent | f24fe15610e9d5bd3457bcb7567dc723672ffb04 (diff) |
Merge mulk_benkard@ssh.phx.nearlyfreespeech.net:/home/htdocs/code/mulklisp
Diffstat (limited to 'MLKArray.m')
-rw-r--r-- | MLKArray.m | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -26,6 +26,7 @@ #include <stdio.h> #include <search.h> +#include <string.h> @implementation MLKArray @@ -115,7 +116,8 @@ static int eq (const void *x, const void *y) -(NSUInteger) indexOfObjectIdenticalTo:(id)anObject inRange:(NSRange)range { // FIXME: How to treat [NSNull null]? - return ((id*)lfind (anObject, _buffer + range.location, &range.length, sizeof(id), eq) + size_t length = range.length; + return ((id*)lfind (anObject, _buffer + range.location, &length, sizeof(id), eq) - _buffer) / sizeof(id); } @@ -133,7 +135,8 @@ static int equalp (const void *x, const void *y) -(NSUInteger) indexOfObject:(id)anObject inRange:(NSRange)range { // FIXME: How to treat [NSNull null]? - return ((id*)lfind (anObject, _buffer + range.location, &range.length, sizeof(id), equalp) + size_t length = range.length; + return ((id*)lfind (anObject, _buffer + range.location, &length, sizeof(id), equalp) - _buffer) / sizeof(id); } |