diff --git a/Sources/CoreFoundation/CFBigNumber.c b/Sources/CoreFoundation/CFBigNumber.c index c3a045a92e..60aa2af7cf 100644 --- a/Sources/CoreFoundation/CFBigNumber.c +++ b/Sources/CoreFoundation/CFBigNumber.c @@ -464,7 +464,7 @@ uint8_t _CFBigNumAdd(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b) { bigNum = a; smallNum = b; } - for (int i = 0; i < sizeof(a->digits) / sizeof(a->digits[0]); i++) { + for (size_t i = 0; i < sizeof(a->digits) / sizeof(a->digits[0]); i++) { int64_t result = (int64_t)bigNum->digits[i] - (int64_t)smallNum->digits[i] - carry; if (result < 0) { carry = 1; diff --git a/Sources/CoreFoundation/CFBundle_Resources.c b/Sources/CoreFoundation/CFBundle_Resources.c index f32ce6df65..4008de6016 100644 --- a/Sources/CoreFoundation/CFBundle_Resources.c +++ b/Sources/CoreFoundation/CFBundle_Resources.c @@ -1122,11 +1122,11 @@ CF_EXPORT CFTypeRef _Nullable _CFBundleCopyFindResources(CFBundleRef _Nullable b if ( subPath) { - int depthLevel = 0; + CFIndex depthLevel = 0; CFArrayRef subPathComponents = CFStringCreateArrayBySeparatingStrings(kCFAllocatorSystemDefault, subPath, CFSTR("/")); CFIndex subPathComponentsCount = CFArrayGetCount(subPathComponents); - for (int i = 0; i < subPathComponentsCount; i++) { + for (CFIndex i = 0; i < subPathComponentsCount; i++) { CFStringRef comp = CFArrayGetValueAtIndex(subPathComponents, i); if (i == 0 && (CFStringCompare(comp, CFSTR(""), 0) == kCFCompareEqualTo)) { diff --git a/Sources/CoreFoundation/CFFileUtilities.c b/Sources/CoreFoundation/CFFileUtilities.c index c2ab0b9f1d..0607013be7 100644 --- a/Sources/CoreFoundation/CFFileUtilities.c +++ b/Sources/CoreFoundation/CFFileUtilities.c @@ -1414,7 +1414,7 @@ CF_PRIVATE CFArrayRef _CFCreateCFArrayByTokenizingString(const char *values, cha } free(copyDirPath); CFArrayRef pathArray = CFArrayCreate(kCFAllocatorSystemDefault, (const void **)pathList , validPathCount, &kCFTypeArrayCallBacks); - for(int i = 0; i < validPathCount; i ++) { + for(size_t i = 0; i < validPathCount; i ++) { CFRelease(pathList[i]); } return pathArray; diff --git a/Sources/CoreFoundation/CFListFormatter.c b/Sources/CoreFoundation/CFListFormatter.c index 83366dda96..e555bb4941 100644 --- a/Sources/CoreFoundation/CFListFormatter.c +++ b/Sources/CoreFoundation/CFListFormatter.c @@ -87,7 +87,7 @@ CFStringRef _CFListFormatterCreateStringByJoiningStrings(CFAllocatorRef allocato bool *needsFree = calloc(count, sizeof(bool)); CFStringRef string; - for (int i = 0; i < count; ++i) { + for (CFIndex i = 0; i < count; ++i) { string = CFArrayGetValueAtIndex(strings, i); CFIndex const len = CFStringGetLength(string); UChar const *ucharString = CFStringGetCharactersPtr(string); @@ -115,7 +115,7 @@ CFStringRef _CFListFormatterCreateStringByJoiningStrings(CFAllocatorRef allocato if (fmt) { __cficu_ulistfmt_close(fmt); } - for (int i = 0; i < count; ++i) { + for (CFIndex i = 0; i < count; ++i) { UChar *ucharString = ucharStrings[i]; if (ucharString && needsFree[i]) { free(ucharString); diff --git a/Sources/_CFXMLInterface/CFXMLInterface.c b/Sources/_CFXMLInterface/CFXMLInterface.c index 1c54de3ec9..30a627f8a5 100644 --- a/Sources/_CFXMLInterface/CFXMLInterface.c +++ b/Sources/_CFXMLInterface/CFXMLInterface.c @@ -1392,7 +1392,7 @@ _CFXMLNodePtr _Nonnull * _Nullable _CFXMLNamespaces(_CFXMLNodePtr node, CFIndex* _CFXMLNodePtr* result = calloc(*count, sizeof(_CFXMLNodePtr)); ns = ((xmlNode*)node)->nsDef; - for (int i = 0; i < *count; i++) { + for (CFIndex i = 0; i < *count; i++) { xmlNode* temp = xmlNewNode(ns, (unsigned char *)""); temp->type = _kCFXMLTypeNamespace;