Skip to content

Fix C function prototypes for functions that take no arguments. #1157

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

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions CoreFoundation/Base.subproj/CFInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CF_EXPORT void _CFMachPortInstallNotifyPort(CFRunLoopRef rl, CFStringRef mode);

CF_PRIVATE os_log_t _CFOSLog(void);

CF_PRIVATE CFIndex __CFActiveProcessorCount();
CF_PRIVATE CFIndex __CFActiveProcessorCount(void);

#ifndef CLANG_ANALYZER_NORETURN
#if __has_feature(attribute_analyzer_noreturn)
Expand Down Expand Up @@ -325,7 +325,7 @@ extern Boolean __CFStringScanHex(CFStringInlineBuffer *buf, SInt32 *indexPtr, un
extern const char *__CFgetenv(const char *n);
extern const char *__CFgetenvIfNotRestricted(const char *n); // Returns NULL in a restricted process

CF_PRIVATE Boolean __CFProcessIsRestricted();
CF_PRIVATE Boolean __CFProcessIsRestricted(void);

// This is really about the availability of C99. We don't have that on Windows, but we should everywhere else.
#if DEPLOYMENT_TARGET_WINDOWS
Expand Down Expand Up @@ -587,8 +587,8 @@ CF_PRIVATE SInt32 _CFGetFileProperties(CFAllocatorRef alloc, CFURLRef pathURL, B

/* ==================== Simple path manipulation ==================== */

CF_EXPORT UniChar _CFGetSlash();
CF_PRIVATE CFStringRef _CFGetSlashStr();
CF_EXPORT UniChar _CFGetSlash(void);
CF_PRIVATE CFStringRef _CFGetSlashStr(void);
CF_EXPORT Boolean _CFIsAbsolutePath(UniChar *unichars, CFIndex length);
CF_PRIVATE void _CFAppendTrailingPathSlash2(CFMutableStringRef path);
CF_PRIVATE void _CFAppendConditionalTrailingPathSlash2(CFMutableStringRef path);
Expand Down Expand Up @@ -733,7 +733,7 @@ extern void *__CFLookupCoreServicesInternalFunction(const char *name);
CF_PRIVATE CFComparisonResult _CFCompareStringsWithLocale(CFStringInlineBuffer *str1, CFRange str1Range, CFStringInlineBuffer *str2, CFRange str2Range, CFOptionFlags options, const void *compareLocale);


CF_PRIVATE CFArrayRef _CFBundleCopyUserLanguages();
CF_PRIVATE CFArrayRef _CFBundleCopyUserLanguages(void);


// This should only be used in CF types, not toll-free bridged objects!
Expand Down
16 changes: 8 additions & 8 deletions CoreFoundation/Base.subproj/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,11 +808,11 @@ CFAllocatorRef CFGetAllocator(CFTypeRef cf) {
}


extern CFTypeID CFBinaryHeapGetTypeID();
extern CFTypeID CFBitVectorGetTypeID();
extern CFTypeID CFTreeGetTypeID();
extern CFTypeID CFPlugInInstanceGetTypeID();
extern CFTypeID CFStringTokenizerGetTypeID();
extern CFTypeID CFBinaryHeapGetTypeID(void);
extern CFTypeID CFBitVectorGetTypeID(void);
extern CFTypeID CFTreeGetTypeID(void);
extern CFTypeID CFPlugInInstanceGetTypeID(void);
extern CFTypeID CFStringTokenizerGetTypeID(void);
extern CFTypeID CFStorageGetTypeID(void);
extern void __CFAllocatorInitialize(void);
extern void __CFStringInitialize(void);
Expand All @@ -821,7 +821,7 @@ extern void __CFCharacterSetInitialize(void);
extern void __CFPFactoryInitialize(void);
extern void __CFPlugInInitialize(void);
#if (DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_MACOSX) && DEPLOYMENT_RUNTIME_SWIFT
CF_PRIVATE void __CFTSDInitialize();
CF_PRIVATE void __CFTSDInitialize(void);
#endif
#if DEPLOYMENT_TARGET_WINDOWS
// From CFPlatform.c
Expand Down Expand Up @@ -1005,7 +1005,7 @@ void __CFInitialize(void) {
memset(__CFRuntimeObjCClassTable, 0, sizeof(__CFRuntimeObjCClassTable));

#if DEPLOYMENT_RUNTIME_SWIFT
extern uintptr_t __CFSwiftGetBaseClass();
extern uintptr_t __CFSwiftGetBaseClass(void);

uintptr_t NSCFType = __CFSwiftGetBaseClass();
for (CFIndex idx = 1; idx < __CFRuntimeClassTableSize; idx++) {
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void __CFInitialize(void) {
#endif

#if DEPLOYMENT_RUNTIME_SWIFT
extern void __CFInitializeSwift();
extern void __CFInitializeSwift(void);
__CFInitializeSwift();
__CFNumberInitialize(); /* needs to happen after Swift bridge is initialized */
#endif
Expand Down
10 changes: 5 additions & 5 deletions CoreFoundation/Base.subproj/ForFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,12 @@ CF_EXPORT _CFStringFileSystemRepresentationError _CFStringGetFileSystemRepresent



CF_EXPORT CFIndex __CFProcessorCount();
CF_EXPORT uint64_t __CFMemorySize();
CF_EXPORT CFIndex __CFProcessorCount(void);
CF_EXPORT uint64_t __CFMemorySize(void);
CF_EXPORT CFStringRef _CFProcessNameString(void);
CF_EXPORT CFIndex __CFActiveProcessorCount();
CF_EXPORT CFDictionaryRef __CFGetEnvironment();
CF_EXPORT int32_t __CFGetPid();
CF_EXPORT CFIndex __CFActiveProcessorCount(void);
CF_EXPORT CFDictionaryRef __CFGetEnvironment(void);
CF_EXPORT int32_t __CFGetPid(void);
CF_EXPORT CFTimeInterval CFGetSystemUptime(void);
CF_EXPORT CFStringRef CFCopySystemVersionString(void);
CF_EXPORT CFDictionaryRef _CFCopySystemVersionDictionary(void);
Expand Down
4 changes: 2 additions & 2 deletions CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct _NSMutableStringBridge {
};

struct _NSXMLParserBridge {
_CFXMLInterface _Nullable (*_Nonnull currentParser)();
_CFXMLInterface _Nullable (*_Nonnull currentParser)(void);
_CFXMLInterfaceParserInput _Nullable (*_Nonnull _xmlExternalEntityWithURL)(_CFXMLInterface interface, const char *url, const char * identifier, _CFXMLInterfaceParserContext context, _CFXMLInterfaceExternalEntityLoader originalLoaderFunction);

_CFXMLInterfaceParserContext _Nonnull (*_Nonnull getContext)(_CFXMLInterface ctx);
Expand Down Expand Up @@ -300,7 +300,7 @@ CF_EXPORT CFHashCode __CFHashDouble(double d);
typedef pthread_key_t _CFThreadSpecificKey;
CF_EXPORT CFTypeRef _Nullable _CFThreadSpecificGet(_CFThreadSpecificKey key);
CF_EXPORT void _CThreadSpecificSet(_CFThreadSpecificKey key, CFTypeRef _Nullable value);
CF_EXPORT _CFThreadSpecificKey _CFThreadSpecificKeyCreate();
CF_EXPORT _CFThreadSpecificKey _CFThreadSpecificKeyCreate(void);

typedef pthread_attr_t _CFThreadAttributes;
typedef pthread_t _CFThreadRef;
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Parsing.subproj/CFXMLInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ typedef void (*_CFXMLInterfaceStructuredErrorFunc)(_CFXMLInterface ctx, _CFXMLIn

void _CFSetupXMLInterface(void);
_CFXMLInterfaceParserInput _CFXMLInterfaceNoNetExternalEntityLoader(const char *URL, const char *ID, _CFXMLInterfaceParserContext ctxt);
_CFXMLInterfaceSAXHandler _CFXMLInterfaceCreateSAXHandler();
_CFXMLInterfaceSAXHandler _CFXMLInterfaceCreateSAXHandler(void);
void _CFXMLInterfaceDestroySAXHandler(_CFXMLInterfaceSAXHandler handler);
void _CFXMLInterfaceSetStructuredErrorFunc(_CFXMLInterface ctx, _CFXMLInterfaceStructuredErrorFunc _Nullable handler);
_CFXMLInterfaceParserContext _CFXMLInterfaceCreatePushParserCtxt(_CFXMLInterfaceSAXHandler _Nullable sax, _CFXMLInterface user_data, const char * chunk, int size, const char *_Nullable filename);
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/PlugIn.subproj/CFBundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ static const CFRuntimeClass __CFBundleClass = {
};

// From CFBundle_Resources.c
CF_PRIVATE void _CFBundleResourcesInitialize();
CF_PRIVATE void _CFBundleResourcesInitialize(void);

CFTypeID CFBundleGetTypeID(void) {
static dispatch_once_t initOnce;
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/PlugIn.subproj/CFBundle_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ CF_PRIVATE SInt32 _CFBundleCurrentArchitecture(void);
CF_PRIVATE Boolean _CFBundleGetObjCImageInfo(CFBundleRef bundle, uint32_t *objcVersion, uint32_t *objcFlags);

#if defined(BINARY_SUPPORT_DYLD)
CF_PRIVATE CFMutableDictionaryRef _CFBundleCreateInfoDictFromMainExecutable();
CF_PRIVATE CFMutableDictionaryRef _CFBundleCreateInfoDictFromMainExecutable(void);
CF_PRIVATE Boolean _CFBundleGrokObjCImageInfoFromMainExecutable(uint32_t *objcVersion, uint32_t *objcFlags);
#endif

Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/String.subproj/CFBurstTrie.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef CF_OPTIONS(CFOptionFlags, CFBurstTrieOpts) {
typedef void (*CFBurstTrieTraversalCallback)(void* context, const UInt8* key, uint32_t keyLength, uint32_t payload, Boolean *stop);

CF_EXPORT
CFBurstTrieRef CFBurstTrieCreate() CF_AVAILABLE(10_7, 4_2);
CFBurstTrieRef CFBurstTrieCreate(void) CF_AVAILABLE(10_7, 4_2);

CF_EXPORT
CFBurstTrieRef CFBurstTrieCreateWithOptions(CFDictionaryRef options) CF_AVAILABLE(10_8, 6_0);
Expand Down
12 changes: 6 additions & 6 deletions CoreFoundation/URL.subproj/CFURLComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ CF_EXPORT CFStringRef _CFStringCreateByAddingPercentEncodingWithAllowedCharacter
CF_EXPORT CFStringRef _Nullable _CFStringCreateByRemovingPercentEncoding(CFAllocatorRef alloc, CFStringRef string);

// These return singletons
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLUserAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPasswordAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLHostAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPathAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLQueryAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLFragmentAllowedCharacterSet();
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLUserAllowedCharacterSet(void);
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPasswordAllowedCharacterSet(void);
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLHostAllowedCharacterSet(void);
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPathAllowedCharacterSet(void);
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLQueryAllowedCharacterSet(void);
CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLFragmentAllowedCharacterSet(void);

CF_EXPORT _Nullable CFArrayRef _CFURLComponentsCopyQueryItems(CFURLComponentsRef components);
CF_EXPORT void _CFURLComponentsSetQueryItems(CFURLComponentsRef components, CFArrayRef names, CFArrayRef values);
Expand Down
4 changes: 2 additions & 2 deletions CoreFoundation/URL.subproj/CFURLSessionInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,11 @@ CF_EXPORT int const CFURLSessionSeekOk;
CF_EXPORT int const CFURLSessionSeekCantSeek;
CF_EXPORT int const CFURLSessionSeekFail;

CF_EXPORT CFURLSessionEasyHandle _Nonnull CFURLSessionEasyHandleInit();
CF_EXPORT CFURLSessionEasyHandle _Nonnull CFURLSessionEasyHandleInit(void);
CF_EXPORT void CFURLSessionEasyHandleDeinit(CFURLSessionEasyHandle _Nonnull handle);
CF_EXPORT CFURLSessionEasyCode CFURLSessionEasyHandleSetPauseState(CFURLSessionEasyHandle _Nonnull handle, int send, int receive);

CF_EXPORT CFURLSessionMultiHandle _Nonnull CFURLSessionMultiHandleInit();
CF_EXPORT CFURLSessionMultiHandle _Nonnull CFURLSessionMultiHandleInit(void);
CF_EXPORT CFURLSessionMultiCode CFURLSessionMultiHandleDeinit(CFURLSessionMultiHandle _Nonnull handle);
CF_EXPORT CFURLSessionMultiCode CFURLSessionMultiHandleAddHandle(CFURLSessionMultiHandle _Nonnull handle, CFURLSessionEasyHandle _Nonnull curl);
CF_EXPORT CFURLSessionMultiCode CFURLSessionMultiHandleRemoveHandle(CFURLSessionMultiHandle _Nonnull handle, CFURLSessionEasyHandle _Nonnull curl);
Expand Down