Skip to content

Commit

Permalink
Address spec lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai-Holler committed Nov 2, 2018
1 parent c99da74 commit 31c1a07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/Base/ASAssert.mm
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ static pthread_key_t ASMainThreadAssertionsDisabledKey() {
}

BOOL ASMainThreadAssertionsAreDisabled() {
return (pthread_getspecific(ASMainThreadAssertionsDisabledKey()) > 0);
return (nullptr != pthread_getspecific(ASMainThreadAssertionsDisabledKey()));
}

void ASPushMainThreadAssertionsDisabled() {
let key = ASMainThreadAssertionsDisabledKey();
let oldVal = pthread_getspecific(key);
pthread_setspecific(key, oldVal + 1);
let oldVal = (intptr_t)pthread_getspecific(key);
pthread_setspecific(key, (void *)(oldVal + 1));
}

void ASPopMainThreadAssertionsDisabled() {
let key = ASMainThreadAssertionsDisabledKey();
let oldVal = pthread_getspecific(key);
pthread_setspecific(key, oldVal - 1);
let oldVal = (intptr_t)pthread_getspecific(key);
pthread_setspecific(key, (void *)(oldVal - 1));
ASDisplayNodeCAssert(oldVal > 0, @"Attempt to pop thread assertion-disabling without corresponding push.");
}

Expand Down

0 comments on commit 31c1a07

Please sign in to comment.