Skip to content

Commit cb95d20

Browse files
authored
Fix various typos (#5290)
1 parent 325de71 commit cb95d20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+194
-195
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ include(CheckSymbolExists)
115115
check_linker_flag(C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID)
116116

117117
# Detect if the system libc defines symbols for these functions.
118-
# If it is not availble, swift-corelibs-foundation has its own implementations
118+
# If it is not available, swift-corelibs-foundation has its own implementations
119119
# that will be used. If it is available, it should not redefine them.
120120
# Note: SwiftPM does not have the ability to introspect the contents of the SDK
121121
# and therefore will always include these functions in the build and will

Sources/CoreFoundation/BlockRuntime/runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static void *_Block_copy_internal(const void *arg, const bool wantsOne) {
374374
return aBlock;
375375
}
376376

377-
// Its a stack block. Make a copy.
377+
// It's a stack block. Make a copy.
378378
if (!isGC) {
379379
struct Block_layout *result = malloc(aBlock->descriptor->size);
380380
if (!result) return NULL;
@@ -433,7 +433,7 @@ static void _Block_byref_assign_copy(void *dest, const void *arg, const int flag
433433
else if ((src->forwarding->flags & BLOCK_REFCOUNT_MASK) == 0) {
434434
// src points to stack
435435
bool isWeak = ((flags & (BLOCK_FIELD_IS_BYREF|BLOCK_FIELD_IS_WEAK)) == (BLOCK_FIELD_IS_BYREF|BLOCK_FIELD_IS_WEAK));
436-
// if its weak ask for an object (only matters under GC)
436+
// if it's weak ask for an object (only matters under GC)
437437
struct Block_byref *copy = (struct Block_byref *)_Block_allocator(src->size, false, isWeak);
438438
copy->flags = src->flags | _Byref_flag_initial_value; // non-GC one for caller, one for stack
439439
copy->forwarding = copy; // patch heap copy to point to itself (skip write-barrier)

Sources/CoreFoundation/CFBase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ CFAllocatorRef CFAllocatorGetDefault(void) {
470470

471471
void CFAllocatorSetDefault(CFAllocatorRef allocator) {
472472
#ifndef __clang_analyzer__
473-
// clang doesn't like complexity of staticly laid out instances like the black magic we do here and __CFGetDefaultAllocator
473+
// clang doesn't like complexity of statically laid out instances like the black magic we do here and __CFGetDefaultAllocator
474474
CFAllocatorRef current = __CFGetDefaultAllocator();
475475
#if defined(DEBUG)
476476
if (NULL != allocator) {

Sources/CoreFoundation/CFBundle_Binary.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static char *_cleanedPathForPath(const char *curName) {
123123
}
124124

125125
CF_PRIVATE CFArrayRef _CFBundleDYLDCopyLoadedImagePathsIfChanged(void) {
126-
// This returns an array of the paths of all the dyld images in the process. These paths may not be absolute, they may point at things that are not bundles, they may be staticly linked bundles or dynamically loaded bundles, they may be NULL.
126+
// This returns an array of the paths of all the dyld images in the process. These paths may not be absolute, they may point at things that are not bundles, they may be statically linked bundles or dynamically loaded bundles, they may be NULL.
127127
uint32_t i, numImages = _dyld_image_count();
128128
CFMutableArrayRef result = NULL;
129129
static uint32_t _cachedDYLDImageCount = -1;
@@ -442,7 +442,7 @@ static void *_CFBundleDYLDGetSymbolByNameWithSearch(CFBundleRef bundle, CFString
442442
if (!CFStringGetCString(executableName, hintBuff, 1024, kCFStringEncodingUTF8)) hintBuff[0] = '\0';
443443
CFRelease(executableName);
444444
}
445-
// Nowdays, NSIsSymbolNameDefinedWithHint() and NSLookupAndBindSymbolWithHint()
445+
// Nowadays, NSIsSymbolNameDefinedWithHint() and NSLookupAndBindSymbolWithHint()
446446
// are identical, except the first just returns a bool, so checking with the
447447
// Is function first just causes a redundant lookup.
448448
// This returns NULL on failure.

Sources/CoreFoundation/CFCalendar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void __CFCalendarSetToFirstInstant(CFCalendarRef calendar, CFCalendarUnit
156156
__cficu_ucal_set(calendar->_cal, UCAL_YEAR, __cficu_ucal_getLimit(calendar->_cal, UCAL_YEAR, UCAL_ACTUAL_MINIMUM, &status));
157157
case kCFCalendarUnitYear:
158158
__cficu_ucal_set(calendar->_cal, UCAL_MONTH, __cficu_ucal_getLimit(calendar->_cal, UCAL_MONTH, UCAL_ACTUAL_MINIMUM, &status));
159-
// #warning if there is a lunar leap month of the same number *preceeding* month N,
159+
// #warning if there is a lunar leap month of the same number *preceding* month N,
160160
// then we should set the calendar to the leap month, not the regular month.
161161
__cficu_ucal_set(calendar->_cal, UCAL_IS_LEAP_MONTH, 0);
162162
case kCFCalendarUnitMonth:

Sources/CoreFoundation/CFCharacterSet.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,13 +1360,13 @@ const CFRuntimeClass __CFCharacterSetClass = {
13601360
__CFCharacterSetCopyDescription
13611361
};
13621362

1363-
static bool __CFCheckForExapendedSet = false;
1363+
static bool __CFDebugExpandedSet = false;
13641364

13651365
CF_PRIVATE void __CFCharacterSetInitialize(void) {
13661366
static dispatch_once_t initOnce;
13671367
dispatch_once(&initOnce, ^{
13681368
const char *checkForExpandedSet = getenv("__CF_DEBUG_EXPANDED_SET");
1369-
if (checkForExpandedSet && (*checkForExpandedSet == 'Y')) __CFCheckForExapendedSet = true;
1369+
if (checkForExpandedSet && (*checkForExpandedSet == 'Y')) __CFDebugExpandedSet = true;
13701370
});
13711371
}
13721372

@@ -1378,7 +1378,7 @@ CFTypeID CFCharacterSetGetTypeID(void) {
13781378
}
13791379

13801380
/*** CharacterSet creation ***/
1381-
/* Functions to create basic immutable characterset.
1381+
/* Functions to create basic immutable character set.
13821382
*/
13831383
CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier) {
13841384
CFCharacterSetRef cset;
@@ -2362,7 +2362,7 @@ void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange
23622362
}
23632363
__CFCSetPutHasHashValue(theSet, false);
23642364

2365-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2365+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
23662366
}
23672367

23682368
void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange) {
@@ -2436,7 +2436,7 @@ void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRa
24362436
}
24372437

24382438
__CFCSetPutHasHashValue(theSet, false);
2439-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2439+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
24402440
}
24412441

24422442
void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString) {
@@ -2527,7 +2527,7 @@ void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStr
25272527

25282528
__CFCSetPutHasHashValue(theSet, false);
25292529

2530-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2530+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
25312531

25322532
if (hasSurrogate) __CFApplySurrogatesInString(theSet, theString, &CFCharacterSetAddCharactersInRange);
25332533
}
@@ -2614,7 +2614,7 @@ void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFS
26142614
}
26152615

26162616
__CFCSetPutHasHashValue(theSet, false);
2617-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2617+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
26182618

26192619
if (hasSurrogate) __CFApplySurrogatesInString(theSet, theString, &CFCharacterSetRemoveCharactersInRange);
26202620
}
@@ -2740,7 +2740,7 @@ void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theO
27402740
}
27412741
}
27422742
}
2743-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2743+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
27442744
} else { // It's NSCharacterSet
27452745
CFDataRef bitmapRep = CFCharacterSetCreateBitmapRepresentation(kCFAllocatorSystemDefault, theOtherSet);
27462746
const UInt32 *bitmap2 = (bitmapRep && CFDataGetLength(bitmapRep) ? (const UInt32 *)CFDataGetBytePtr(bitmapRep) : NULL);
@@ -2984,7 +2984,7 @@ void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef
29842984
__CFCSetDeallocateAnnexPlane(theSet);
29852985
}
29862986
}
2987-
if (__CFCheckForExapendedSet) __CFCheckForExpandedSet(theSet);
2987+
if (__CFDebugExpandedSet) __CFCheckForExpandedSet(theSet);
29882988
} else { // It's NSCharacterSet
29892989
CFDataRef bitmapRep = CFCharacterSetCreateBitmapRepresentation(kCFAllocatorSystemDefault, theOtherSet);
29902990
const UInt32 *bitmap2 = (bitmapRep && CFDataGetLength(bitmapRep) ? (const UInt32 *)CFDataGetBytePtr(bitmapRep) : NULL);

Sources/CoreFoundation/CFDateFormatter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ static CFMutableStringRef __createISO8601FormatString(CFISO8601DateFormatOptions
955955
} else {
956956
CFStringAppendCString(resultStr, "HH:mm:ss", kCFStringEncodingUTF8);
957957
}
958-
// Add support for fracional seconds
958+
// Add support for fractional seconds
959959
if (includeFractionalSecs) {
960960
CFStringAppendCString(resultStr, ".SSS", kCFStringEncodingUTF8);
961961
}

Sources/CoreFoundation/CFICUConverters.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ CF_PRIVATE CFIndex __CFStringEncodingICUToBytes(const char *icuName, uint32_t fl
263263
ucnv_fromUnicode(converter, &destination, destinationLimit, (const UChar **)&source, (const UChar *)sourceLimit, NULL, flush, &errorCode);
264264

265265
#if HAS_ICU_BUG_6024743
266-
/* Another critical ICU design issue. Similar to conversion error, source pointer returned from U_BUFFER_OVERFLOW_ERROR is already beyond the last valid character position. It renders the returned value from source entirely unusable. We have to manually back up until succeeding <rdar://problem/7183045> Interestingly, this issue doesn't apply to ucnv_toUnicode. The asynmmetric nature makes this more dangerous */
266+
/* Another critical ICU design issue. Similar to conversion error, source pointer returned from U_BUFFER_OVERFLOW_ERROR is already beyond the last valid character position. It renders the returned value from source entirely unusable. We have to manually back up until succeeding <rdar://problem/7183045> Interestingly, this issue doesn't apply to ucnv_toUnicode. The asymmetric nature makes this more dangerous */
267267
if (U_BUFFER_OVERFLOW_ERROR == errorCode) {
268268
const uint8_t *bitmap = CFUniCharGetBitmapPtrForPlane(kCFUniCharNonBaseCharacterSet, 0);
269269
const uint8_t *nonBase;

Sources/CoreFoundation/CFLocaleIdentifier.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,9 +2195,9 @@ CFStringRef CFLocaleCreateLocaleIdentifierFromComponents(CFAllocatorRef allocato
21952195
CFCalendarRef cal = (CFCalendarRef)values[idx];
21962196
CFStringRef ident = CFCalendarGetIdentifier(cal);
21972197
value = __CStringFromString(ident);
2198-
char *oldkey = key;
2198+
char *oldKey = key;
21992199
key = strdup("calendar");
2200-
free(oldkey);
2200+
free(oldKey);
22012201
} else {
22022202
value = __CStringFromString(values[idx]);
22032203
}

Sources/CoreFoundation/CFOldStylePList.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static Boolean advanceToNonSpace(_CFStringsFileParseInfo *pInfo) {
8686
if (ch2 == ' ' || ch2 == 0x2028 || ch2 == 0x2029) continue; // space and Unicode line sep, para sep
8787
if (ch2 == '/') {
8888
if (pInfo->curr >= pInfo->end) {
89-
// TODO: this could possibly be made more robust (imagine if pInfo->curr is stomped; pInfo->end - 1 might be safer. Unless its smashed too :-/
89+
// TODO: this could possibly be made more robust (imagine if pInfo->curr is stomped; pInfo->end - 1 might be safer. Unless it's smashed too :-/
9090
// whoops; back up and return
9191
pInfo->curr --;
9292
return true;

0 commit comments

Comments
 (0)