Permalink
Browse files

Fixed static analyzer warnings.

  • Loading branch information...
1 parent 142adda commit 24325dfd2b22a80877ea898ea581f3ce94218ae6 @shazron shazron committed Mar 14, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 Classes/Commands/Sound.m
View
@@ -32,13 +32,18 @@ + (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
static SEL * acceptableList = NULL;
SEL currentSelector;
+ // initialize once
if (acceptableList == NULL && (acceptableList = calloc(256, sizeof(SEL)))) // up to 256 selectors
{
+ // pragma below is to ignore the static analyze "dead-store" warning
+ #pragma unused(i)
+ // list all acceptable selectors here, one at a time
acceptableList[i++] = @selector(play:);
+ //... acceptableList[i++] = @selector(whatever:);
}
i = 0;
- while (result == YES && (currentSelector = acceptableList[i++]))
+ while (acceptableList != NULL && result == YES && (currentSelector = acceptableList[i++]))
{
//checking for exclusions
result = !(selector == currentSelector);

0 comments on commit 24325df

Please sign in to comment.