Skip to content

Commit 82b286a

Browse files
authored
Merge pull request #1159 from spevans/pr_prototype_fixes2
2 parents d0b0f3c + 40cf997 commit 82b286a

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

CoreFoundation/Base.subproj/CFUtilities.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ CFDictionaryRef __CFGetEnvironment() {
15191519
static CFMutableDictionaryRef envDict = NULL;
15201520
dispatch_once(&once, ^{
15211521
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
1522-
extern char ***_NSGetEnviron();
1522+
extern char ***_NSGetEnviron(void);
15231523
char **envp = *_NSGetEnviron();
15241524
#elif DEPLOYMENT_TARGET_FREEBSD || TARGET_OS_CYGWIN
15251525
extern char **environ;

CoreFoundation/Locale.subproj/CFDateFormatter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static Boolean useTemplatePatternGenerator(CFLocaleRef locale, void(^work)(UDate
6666
if (CFStringGetCString(ln, buffer, BUFFER_SIZE, kCFStringEncodingASCII)) localeName = buffer;
6767
}
6868

69-
static void (^flushCache)() = ^{
69+
static void (^flushCache)(void) = ^{
7070
__cficu_udatpg_close(ptg);
7171
ptg = NULL;
7272
free((void *)ptgLocaleName);
@@ -1506,7 +1506,7 @@ static UDate __CFDateFormatterCorrectTimeToARangeAroundCurrentDate(UCalendar *ca
15061506
}
15071507
} else {
15081508
if (period < INT_MAX && futureMax > period) {
1509-
futureRange.location = 1,
1509+
futureRange.location = 1;
15101510
futureRange.length = futureMax - period;
15111511
}
15121512
if (pastMin <= 0) {

CoreFoundation/RunLoop.subproj/CFRunLoop.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ CF_PRIVATE void __CFRestartAllThreads(CFArrayRef threads) {
250250

251251
static uint32_t __CF_last_warned_port_count = 0;
252252

253-
static void foo() __attribute__((unused));
254-
static void foo() {
253+
static void __attribute__((unused)) foo() {
255254
uint32_t pcnt = __CFGetProcessPortCount();
256255
if (__CF_last_warned_port_count + 1000 < pcnt) {
257256
CFArrayRef threads = __CFStopAllThreads();
@@ -1755,32 +1754,28 @@ void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFStringRef modeName) {
17551754

17561755
#if __HAS_DISPATCH__
17571756

1758-
static void __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__() __attribute__((noinline));
1759-
static void __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__(void *msg) {
1757+
static void __attribute__((noinline)) __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__(void *msg) {
17601758
_dispatch_main_queue_callback_4CF(msg);
17611759
asm __volatile__(""); // thwart tail-call optimization
17621760
}
17631761

17641762
#endif
17651763

1766-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__() __attribute__((noinline));
1767-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__(CFRunLoopObserverCallBack func, CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) {
1764+
static void __attribute__((noinline)) __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__(CFRunLoopObserverCallBack func, CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) {
17681765
if (func) {
17691766
func(observer, activity, info);
17701767
}
17711768
asm __volatile__(""); // thwart tail-call optimization
17721769
}
17731770

1774-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__() __attribute__((noinline));
1775-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__(CFRunLoopTimerCallBack func, CFRunLoopTimerRef timer, void *info) {
1771+
static void __attribute__((noinline)) __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__(CFRunLoopTimerCallBack func, CFRunLoopTimerRef timer, void *info) {
17761772
if (func) {
17771773
func(timer, info);
17781774
}
17791775
asm __volatile__(""); // thwart tail-call optimization
17801776
}
17811777

1782-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__() __attribute__((noinline));
1783-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__(void (^block)(void)) {
1778+
static void __attribute__((noinline)) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__(void (^block)(void)) {
17841779
if (block) {
17851780
block();
17861781
}
@@ -1836,8 +1831,7 @@ static Boolean __CFRunLoopDoBlocks(CFRunLoopRef rl, CFRunLoopModeRef rlm) { // C
18361831
}
18371832

18381833
/* rl is locked, rlm is locked on entrance and exit */
1839-
static void __CFRunLoopDoObservers() __attribute__((noinline));
1840-
static void __CFRunLoopDoObservers(CFRunLoopRef rl, CFRunLoopModeRef rlm, CFRunLoopActivity activity) { /* DOES CALLOUT */
1834+
static void __attribute__((noinline)) __CFRunLoopDoObservers(CFRunLoopRef rl, CFRunLoopModeRef rlm, CFRunLoopActivity activity) { /* DOES CALLOUT */
18411835
CHECK_FOR_FORK();
18421836

18431837
CFIndex cnt = rlm->_observers ? CFArrayGetCount(rlm->_observers) : 0;
@@ -1904,16 +1898,14 @@ static void __CFRunLoopCollectSources0(const void *value, void *context) {
19041898
}
19051899
}
19061900

1907-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__() __attribute__((noinline));
1908-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__(void (*perform)(void *), void *info) {
1901+
static void __attribute__((noinline)) __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__(void (*perform)(void *), void *info) {
19091902
if (perform) {
19101903
perform(info);
19111904
}
19121905
asm __volatile__(""); // thwart tail-call optimization
19131906
}
19141907

1915-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__() __attribute__((noinline));
1916-
static void __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__(
1908+
static void __attribute__((noinline)) __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__(
19171909
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
19181910
void *(*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info),
19191911
mach_msg_header_t *msg, CFIndex size, mach_msg_header_t **reply,
@@ -1997,8 +1989,7 @@ CF_INLINE void __CFRunLoopDebugInfoForRunLoopSource(CFRunLoopSourceRef rls) {
19971989
}
19981990

19991991
// msg, size and reply are unused on Windows
2000-
static Boolean __CFRunLoopDoSource1() __attribute__((noinline));
2001-
static Boolean __CFRunLoopDoSource1(CFRunLoopRef rl, CFRunLoopModeRef rlm, CFRunLoopSourceRef rls
1992+
static Boolean __attribute__((noinline)) __CFRunLoopDoSource1(CFRunLoopRef rl, CFRunLoopModeRef rlm, CFRunLoopSourceRef rls
20021993
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
20031994
, mach_msg_header_t *msg, CFIndex size, mach_msg_header_t **reply
20041995
#endif

CoreFoundation/String.subproj/CFString.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3233,7 +3233,7 @@ Boolean CFStringFindWithOptionsAndLocale(CFStringRef string, CFStringRef stringT
32333233

32343234
do {
32353235
str1Char = CFStringGetCharacterFromInlineBuffer(&inlineBuf1, --index);
3236-
} while (CFUniCharIsMemberOfBitmap(str1Char, graphemeBMP), (rangeToSearch.location < index));
3236+
} while (CFUniCharIsMemberOfBitmap(str1Char, graphemeBMP) && (rangeToSearch.location < index));
32373237

32383238
if (str1Char < 0x0510) {
32393239
while (++str1Index < maxStr1Index) if (!CFUniCharIsMemberOfBitmap(CFStringGetCharacterFromInlineBuffer(&inlineBuf1, str1Index), graphemeBMP)) break;

0 commit comments

Comments
 (0)