Skip to content

Commit

Permalink
Fix type size truncation
Browse files Browse the repository at this point in the history
For old devices assuming that we have mem address space less than 4gb is ok. But some iPads have 6gb (and may be iPhone 11).

sizeof(int) == 4
sizeof(void *) == 8
sizeof(NSUInteger) == 8
  • Loading branch information
yury authored Sep 12, 2019
1 parent 221f978 commit 763e5d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios_system.m
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ int ios_killpid(pid_t pid, int sig) {

void ios_switchSession(const void* sessionId) {
NSFileManager *fileManager = [[NSFileManager alloc] init];
id sessionKey = [NSNumber numberWithInt:((int)sessionId)];
id sessionKey = @((NSUInteger)sessionId);
if (sessionList == nil) {
sessionList = [NSMutableDictionary new];
if (currentSession != NULL) [sessionList setObject: currentSession forKey: sessionKey];
Expand Down Expand Up @@ -841,7 +841,7 @@ void ios_setDirectoryURL(NSURL* workingDirectoryURL) {
void ios_closeSession(const void* sessionId) {
// delete information associated with current session:
if (sessionList == nil) return;
id sessionKey = [NSNumber numberWithInt:((int)sessionId)];
id sessionKey = @((NSUInteger)sessionId);
[sessionList removeObjectForKey: sessionKey];
currentSession = NULL;
}
Expand Down

0 comments on commit 763e5d5

Please sign in to comment.