Skip to content
Merged
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
20 changes: 10 additions & 10 deletions src/URL/CFURLCache.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ CFURLCacheRef CFURLCacheCreate(CFAllocatorRef allocator, size_t memoryCapacity,
size_t CFURLCacheMemoryCapacity(CFURLCacheRef cache) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
size_t result = (size_t)objc_msgSend(nsCache, sel_registerName("_cf_memoryCapacity"));
size_t result = ((size_t (*)(id, SEL))objc_msgSend)(nsCache, sel_registerName("_cf_memoryCapacity"));
CFRelease(nsCache);
return result;
} else {
Expand All @@ -229,7 +229,7 @@ size_t _CFURLCacheMemoryCapacity(CFURLCacheRef cache) {
void CFURLCacheSetMemoryCapacity(CFURLCacheRef cache, size_t capacity) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
objc_msgSend(nsCache, sel_registerName("_cf_setMemoryCapacity:"), capacity);
((void (*)(id, SEL, size_t))objc_msgSend)(nsCache, sel_registerName("_cf_setMemoryCapacity:"), capacity);
CFRelease(nsCache);
} else {
_CFURLCacheSetMemoryCapacity(cache, capacity);
Expand All @@ -248,7 +248,7 @@ void _CFURLCacheSetMemoryCapacity(CFURLCacheRef cache, size_t capacity) {
size_t CFURLCacheCurrentMemoryUsage(CFURLCacheRef cache) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
size_t result = (size_t)objc_msgSend(nsCache, sel_registerName("_cf_currentMemoryUsage"));
size_t result = ((size_t (*)(id, SEL))objc_msgSend)(nsCache, sel_registerName("_cf_currentMemoryUsage"));
CFRelease(nsCache);
return result;
} else {
Expand All @@ -269,7 +269,7 @@ size_t _CFURLCacheCurrentMemoryUsage(CFURLCacheRef cache) {
size_t CFURLCacheDiskCapacity(CFURLCacheRef cache) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
size_t result = (size_t)objc_msgSend(nsCache, sel_registerName("_cf_diskCapacity"));
size_t result = ((size_t (*)(id, SEL))objc_msgSend)(nsCache, sel_registerName("_cf_diskCapacity"));
CFRelease(nsCache);
return result;
} else {
Expand All @@ -290,7 +290,7 @@ size_t _CFURLCacheDiskCapacity(CFURLCacheRef cache) {
void CFURLCacheSetDiskCapacity(CFURLCacheRef cache, size_t capacity) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
objc_msgSend(nsCache, sel_registerName("_cf_setDiskCapacity:"), capacity);
((void (*)(id, SEL, size_t))objc_msgSend)(nsCache, sel_registerName("_cf_setDiskCapacity:"), capacity);
CFRelease(nsCache);
} else {
_CFURLCacheSetDiskCapacity(cache, capacity);
Expand All @@ -309,7 +309,7 @@ void _CFURLCacheSetDiskCapacity(CFURLCacheRef cache, size_t capacity) {
size_t CFURLCacheCurrentDiskUsage(CFURLCacheRef cache) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
size_t result = (size_t)objc_msgSend(nsCache, sel_registerName("_cf_currentDiskUsage"));
size_t result = ((size_t (*)(id, SEL))objc_msgSend)(nsCache, sel_registerName("_cf_currentDiskUsage"));
CFRelease(nsCache);
return result;
} else {
Expand All @@ -332,7 +332,7 @@ CFCachedURLResponseRef CFURLCacheCopyResponseForRequest(CFURLCacheRef cache,
{
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
CFCachedURLResponseRef result = (CFCachedURLResponseRef)objc_msgSend(nsCache,
CFCachedURLResponseRef result = ((CFCachedURLResponseRef (*)(id, SEL, CFURLRequestRef))objc_msgSend)(nsCache,
sel_registerName("_cf_cachedResponseForRequest:"),
request);
if (result) {
Expand Down Expand Up @@ -373,7 +373,7 @@ Boolean CFURLCacheAddCachedResponseForRequest(CFURLCacheRef cache,
{
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
Boolean result = (Boolean)objc_msgSend(nsCache,
Boolean result = ((Boolean (*)(id, SEL, CFCachedURLResponseRef, CFURLRequestRef))objc_msgSend)(nsCache,
sel_registerName("_cf_storeCachedResponse:forCFRequest:"),
cachedResponse,
request);
Expand Down Expand Up @@ -459,7 +459,7 @@ void CFURLCacheRemoveCachedResponseForRequest(CFURLCacheRef cache,
{
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
objc_msgSend(nsCache, sel_registerName("_cf_removeCachedResponseForRequest:"), request);
((void (*)(id, SEL, CFURLRequestRef))objc_msgSend)(nsCache, sel_registerName("_cf_removeCachedResponseForRequest:"), request);
CFRelease(nsCache);
} else {
_CFURLCacheRemoveCachedResponseForRequest(cache, request);
Expand All @@ -482,7 +482,7 @@ void _CFURLCacheRemoveCachedResponseForRequest(CFURLCacheRef cache,
void CFURLCacheRemoveAllCachedResponses(CFURLCacheRef cache) {
id nsCache = getRetainedNSCache(cache);
if (nsCache) {
objc_msgSend(nsCache, sel_registerName("_cf_removeAllCachedResponses"));
((void (*)(id, SEL))objc_msgSend)(nsCache, sel_registerName("_cf_removeAllCachedResponses"));
CFRelease(nsCache);
} else {
_CFURLCacheRemoveAllCachedResponses(cache);
Expand Down