Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2 warnings: "Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()". #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JSONKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ + (id)allocWithZone:(NSZone *)zone
NSCParameterAssert((objects != NULL) && (_JKArrayClass != NULL) && (_JKArrayInstanceSize > 0UL));
JKArray *array = NULL;
if(JK_EXPECT_T((array = (JKArray *)calloc(1UL, _JKArrayInstanceSize)) != NULL)) { // Directly allocate the JKArray instance via calloc.
array->isa = _JKArrayClass;
object_setClass(array, _JKArrayClass);
if((array = [array init]) == NULL) { return(NULL); }
array->capacity = count;
array->count = count;
Expand Down Expand Up @@ -928,7 +928,7 @@ static void _JKDictionaryResizeIfNeccessary(JKDictionary *dictionary) {
NSCParameterAssert((keys != NULL) && (keyHashes != NULL) && (objects != NULL) && (_JKDictionaryClass != NULL) && (_JKDictionaryInstanceSize > 0UL));
JKDictionary *dictionary = NULL;
if(JK_EXPECT_T((dictionary = (JKDictionary *)calloc(1UL, _JKDictionaryInstanceSize)) != NULL)) { // Directly allocate the JKDictionary instance via calloc.
dictionary->isa = _JKDictionaryClass;
object_setClass(dictionary, _JKDictionaryClass);
if((dictionary = [dictionary init]) == NULL) { return(NULL); }
dictionary->capacity = _JKDictionaryCapacityForCount(count);
dictionary->count = 0UL;
Expand Down