Skip to content

int i should match count, which is a CFIndex #5147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/CoreFoundation/CFBigNumber.c
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions Sources/CoreFoundation/CFBundle_Resources.c
Original file line number Diff line number Diff line change
@@ -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)) {
2 changes: 1 addition & 1 deletion Sources/CoreFoundation/CFFileUtilities.c
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions Sources/CoreFoundation/CFListFormatter.c
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion Sources/_CFXMLInterface/CFXMLInterface.c
Original file line number Diff line number Diff line change
@@ -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;