/*
- * Copyright (c) 2003, 2004, 2006-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2003, 2004, 2006-2008, 2011 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
}
-static CFMutableArrayRef
+static CF_RETURNS_RETAINED CFMutableArrayRef
patternCopy(CFStringRef pattern)
{
CFArrayRef pInfo;
}
-static CFMutableArrayRef
+static CF_RETURNS_RETAINED CFMutableArrayRef
patternNew(CFStringRef pattern)
{
addContext context;
/* compile the regular expression from the pattern string. */
pRegex = CFDataCreateMutable(NULL, sizeof(regex_t));
CFDataSetLength(pRegex, sizeof(regex_t));
- if (!patternCompile(pattern, (regex_t *)CFDataGetBytePtr(pRegex), &err)) {
+ /* ALIGN: CF aligns to >8 byte boundries */
+ if (!patternCompile(pattern, (regex_t *)(void *)CFDataGetBytePtr(pRegex), &err)) {
CFRelease(err);
CFRelease(pRegex);
CFRelease(pInfo);
/* identify/add all existing keys that match the specified pattern */
context.pInfo = pInfo;
- context.preg = (regex_t *)CFDataGetBytePtr(pRegex);
+ /* ALIGN: CF aligns to >8 byte boundries */
+ context.preg = (regex_t *)(void *)CFDataGetBytePtr(pRegex);
my_CFDictionaryApplyFunction(storeData,
(CFDictionaryApplierFunction)identifyKeyForPattern,
&context);
CFDataRef pRegex;
pRegex = CFArrayGetValueAtIndex(pInfo, 0);
- regfree((regex_t *)CFDataGetBytePtr(pRegex));
+ /* ALIGN: CF aligns to >8 byte boundries */
+ regfree((regex_t *)(void *)CFDataGetBytePtr(pRegex));
}
CFArrayReplaceValues(pInfo, CFRangeMake(0, 2), NULL, 0);
/* if no other sessions are watching this pattern */
pRegex = CFArrayGetValueAtIndex(pInfo, 0);
- regfree((regex_t *)CFDataGetBytePtr(pRegex));
+ /* ALIGN: CF aligns to >8 byte boundries */
+ regfree((regex_t *)(void *)CFDataGetBytePtr(pRegex));
CFDictionaryRemoveValue(patternData, pattern);
}
}
/* compare new store key to regular expression pattern */
- preg = (regex_t *)CFDataGetBytePtr(CFArrayGetValueAtIndex(pInfo, 0));
+ /* ALIGN: CF aligns to >8 byte boundries */
+ preg = (regex_t *)(void *)CFDataGetBytePtr(CFArrayGetValueAtIndex(pInfo, 0));
reError = regexec(preg, str, 0, NULL, 0);
switch (reError) {
case 0 : {