diff options
author | RSDuck <RSDuck@users.noreply.github.com> | 2020-05-12 16:07:28 +0200 |
---|---|---|
committer | RSDuck <rsduck@users.noreply.github.com> | 2020-06-16 12:06:42 +0200 |
commit | e7d076403df7afd6dc8304196211b49e3ed7f464 (patch) | |
tree | 1d5ff1e743839f271de77f8bd312c985033c6a89 /src/libui_sdl/libui/darwin/map.m | |
parent | 4cff4b52286a7d1a7e40817d52a5d271a937ddc2 (diff) | |
parent | c17f7b100e36edb1c728dbf21c77f9484d1820c6 (diff) |
Merge branch 'generic_jit' of https://github.com/Arisotura/melonDS into generic_jit
Diffstat (limited to 'src/libui_sdl/libui/darwin/map.m')
-rw-r--r-- | src/libui_sdl/libui/darwin/map.m | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/libui_sdl/libui/darwin/map.m b/src/libui_sdl/libui/darwin/map.m deleted file mode 100644 index 46a7b8d..0000000 --- a/src/libui_sdl/libui/darwin/map.m +++ /dev/null @@ -1,59 +0,0 @@ -// 17 august 2015 -#import "uipriv_darwin.h" - -// unfortunately NSMutableDictionary copies its keys, meaning we can't use it for pointers -// hence, this file -// we could expose a NSMapTable directly, but let's treat all pointers as opaque and hide the implementation, just to be safe and prevent even more rewrites later -struct mapTable { - NSMapTable *m; -}; - -struct mapTable *newMap(void) -{ - struct mapTable *m; - - m = uiNew(struct mapTable); - m->m = [[NSMapTable alloc] initWithKeyOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality) - valueOptions:(NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality) - capacity:0]; - return m; -} - -void mapDestroy(struct mapTable *m) -{ - if ([m->m count] != 0) - implbug("attempt to destroy map with items inside"); - [m->m release]; - uiFree(m); -} - -void *mapGet(struct mapTable *m, void *key) -{ - return NSMapGet(m->m, key); -} - -void mapSet(struct mapTable *m, void *key, void *value) -{ - NSMapInsert(m->m, key, value); -} - -void mapDelete(struct mapTable *m, void *key) -{ - NSMapRemove(m->m, key); -} - -void mapWalk(struct mapTable *m, void (*f)(void *key, void *value)) -{ - NSMapEnumerator e = NSEnumerateMapTable(m->m); - void *k = NULL; - void *v = NULL; - while (NSNextMapEnumeratorPair(&e, &k, &v)) { - f(k, v); - } - NSEndMapTableEnumeration(&e); -} - -void mapReset(struct mapTable *m) -{ - NSResetMapTable(m->m); -} |