Skip to content

Commit

Permalink
fix: Functions without prototype error (#2852)
Browse files Browse the repository at this point in the history
Functions without prototype error
  • Loading branch information
brustolin authored Apr 3, 2023
1 parent 98a8c16 commit 1a08f49
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Samples/iOS-Swift/PerformanceBenchmarks/SentryProcessInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import <unistd.h>

BOOL
isDebugging()
isDebugging(void)
{
struct kinfo_proc info;

Expand All @@ -29,7 +29,7 @@
}

BOOL
isSimulator()
isSimulator(void)
{
NSOperatingSystemVersion ios9 = { 9, 0, 0 };
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/Tools/SentryBenchmarking.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace {
/// @note: Implementation ported from @c SentryThreadHandle.hpp .
NSDictionary<NSString *, NSArray<NSNumber *> *> *
cpuInfoByThread()
cpuInfoByThread(void)
{
const auto dict = [NSMutableDictionary<NSString *, NSArray<NSNumber *> *> dictionary];
mach_msg_type_number_t count;
Expand Down
4 changes: 2 additions & 2 deletions Samples/macOS-Swift/macOS-Swift/CppSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include <stdexcept>

void
internalFunction()
internalFunction(void)
{
throw std::invalid_argument("Invalid Argument.");
}

void
Sentry::CppSample::throwCPPException()
Sentry::CppSample::throwCPPException(void)
{
internalFunction();
}
2 changes: 1 addition & 1 deletion Sources/Sentry/SentrySwizzle.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ @implementation SentrySwizzle
}

static NSMutableDictionary<NSValue *, NSMutableSet<Class> *> *
swizzledClassesDictionary()
swizzledClassesDictionary(void)
{
static NSMutableDictionary *swizzledClasses;
static dispatch_once_t onceToken;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentrySysctl.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* crashes when enabling the address sanitizer.
*/
__used __attribute__((constructor(60000))) static void
sentryModuleInitializationHook()
sentryModuleInitializationHook(void)
{
moduleInitializationTimestamp = [NSDate date];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ sentrycrashcm_setActiveMonitors(SentryCrashMonitorType monitorTypes)
}

SentryCrashMonitorType
sentrycrashcm_getActiveMonitors()
sentrycrashcm_getActiveMonitors(void)
{
return g_activeMonitors;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ addJSONData(const char *const data, const int length, void *const userData)
// ============================================================================

static double
getCurentTime()
getCurentTime(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
Expand Down Expand Up @@ -353,7 +353,7 @@ sentrycrashstate_initialize(const char *const stateFilePath)
}

bool
sentrycrashstate_reset()
sentrycrashstate_reset(void)
{
if (g_isEnabled) {
g_state.sessionsSinceLaunch = 1;
Expand Down Expand Up @@ -467,7 +467,7 @@ setEnabled(bool isEnabled)
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}
Expand All @@ -494,7 +494,7 @@ addContextualInfoToEvent(SentryCrash_MonitorContext *eventContext)
}

SentryCrashMonitorAPI *
sentrycrashcm_appstate_getAPI()
sentrycrashcm_appstate_getAPI(void)
{
static SentryCrashMonitorAPI api = { .setEnabled = setEnabled,
.isEnabled = isEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ CPPExceptionTerminate(void)
// ============================================================================

static void
initialize()
initialize(void)
{
static bool isInitialized = false;
if (!isInitialized) {
Expand Down Expand Up @@ -214,13 +214,13 @@ setEnabled(bool isEnabled)
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}

extern "C" SentryCrashMonitorAPI *
sentrycrashcm_cppexception_getAPI()
sentrycrashcm_cppexception_getAPI(void)
{
static SentryCrashMonitorAPI api = { .setEnabled = setEnabled, .isEnabled = isEnabled };
return &api;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ handleExceptions(void *const userData)
// ============================================================================

static void
uninstallExceptionHandler()
uninstallExceptionHandler(void)
{
SentryCrashLOG_DEBUG("Uninstalling mach exception handler.");

Expand Down Expand Up @@ -446,7 +446,7 @@ uninstallExceptionHandler()
}

static bool
installExceptionHandler()
installExceptionHandler(void)
{
SentryCrashLOG_DEBUG("Installing mach exception handler.");

Expand Down Expand Up @@ -545,7 +545,7 @@ setEnabled(bool isEnabled)
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}
Expand All @@ -563,7 +563,7 @@ addContextualInfoToEvent(struct SentryCrash_MonitorContext *eventContext)
#endif

SentryCrashMonitorAPI *
sentrycrashcm_machexception_getAPI()
sentrycrashcm_machexception_getAPI(void)
{
static SentryCrashMonitorAPI api = {
#if SentryCrashCRASH_HAS_MACH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}

SentryCrashMonitorAPI *
sentrycrashcm_nsexception_getAPI()
sentrycrashcm_nsexception_getAPI(void)
{
static SentryCrashMonitorAPI api = { .setEnabled = setEnabled, .isEnabled = isEnabled };
return &api;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ handleSignal(int sigNum, siginfo_t *signalInfo, void *userContext)
// ============================================================================

static bool
installSignalHandler()
installSignalHandler(void)
{
SentryCrashLOG_DEBUG("Installing signal handler.");

Expand Down Expand Up @@ -230,7 +230,7 @@ setEnabled(bool isEnabled)
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}
Expand All @@ -247,7 +247,7 @@ addContextualInfoToEvent(struct SentryCrash_MonitorContext *eventContext)
#endif

SentryCrashMonitorAPI *
sentrycrashcm_signal_getAPI()
sentrycrashcm_signal_getAPI(void)
{
static SentryCrashMonitorAPI api = {
#if SentryCrashCRASH_HAS_SIGNAL
Expand Down
34 changes: 17 additions & 17 deletions Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
* @return Executable path.
*/
static NSString *
getExecutablePath()
getExecutablePath(void)
{
NSBundle *mainBundle = [NSBundle mainBundle];
NSDictionary *infoDict = [mainBundle infoDictionary];
Expand All @@ -255,7 +255,7 @@
* @return The UUID.
*/
static const char *
getAppUUID()
getAppUUID(void)
{
const char *result = nil;

Expand Down Expand Up @@ -313,7 +313,7 @@
}

static const char *
getCurrentCPUArch()
getCurrentCPUArch(void)
{
const char *result = getCPUArchForCPUType(sentrycrashsysctl_int32ForName("hw.cputype"),
sentrycrashsysctl_int32ForName("hw.cpusubtype"));
Expand All @@ -329,7 +329,7 @@
* @return YES if the device is jailbroken.
*/
static bool
isJailbroken()
isJailbroken(void)
{
return sentrycrashdl_imageNamed("MobileSubstrate", false) != UINT32_MAX;
}
Expand All @@ -339,7 +339,7 @@
* @return YES if the app was built in debug mode.
*/
static bool
isDebugBuild()
isDebugBuild(void)
{
#ifdef DEBUG
return YES;
Expand All @@ -353,7 +353,7 @@
* @return YES if this is a simulator build.
*/
static bool
isSimulatorBuild()
isSimulatorBuild(void)
{
#if TARGET_OS_SIMULATOR
return YES;
Expand All @@ -373,7 +373,7 @@
* @return App Store receipt for iOS, nil otherwise.
*/
static NSString *
getReceiptUrlPath()
getReceiptUrlPath(void)
{
#if SentryCrashCRASH_HOST_IOS
return [NSBundle mainBundle].appStoreReceiptURL.path;
Expand All @@ -388,7 +388,7 @@
* @return The stringified hex representation of the hash for this device + app.
*/
static const char *
getDeviceAndAppHash()
getDeviceAndAppHash(void)
{
NSMutableData *data = nil;

Expand Down Expand Up @@ -436,7 +436,7 @@
* @return YES if this is a testing build.
*/
static bool
isTestBuild()
isTestBuild(void)
{
return [getReceiptUrlPath().lastPathComponent isEqualToString:@"sandboxReceipt"];
}
Expand All @@ -447,7 +447,7 @@
* @return YES if there is an app store receipt.
*/
static bool
hasAppStoreReceipt()
hasAppStoreReceipt(void)
{
NSString *receiptPath = getReceiptUrlPath();
if (receiptPath == nil) {
Expand All @@ -463,13 +463,13 @@
* Check if the app has an embdded.mobileprovision file in the bundle.
*/
static bool
hasEmbeddedMobileProvision()
hasEmbeddedMobileProvision(void)
{
return [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"] != nil;
}

static const char *
getBuildType()
getBuildType(void)
{
if (isSimulatorBuild()) {
return "simulator";
Expand All @@ -490,7 +490,7 @@
}

static bytes
getTotalStorageSize()
getTotalStorageSize(void)
{
NSNumber *storageSize = [[[NSFileManager defaultManager]
attributesOfFileSystemForPath:NSHomeDirectory()
Expand All @@ -499,7 +499,7 @@
}

static bytes
getFreeStorageSize()
getFreeStorageSize(void)
{
NSNumber *storageSize = [[[NSFileManager defaultManager]
attributesOfFileSystemForPath:NSHomeDirectory()
Expand All @@ -518,7 +518,7 @@
// ============================================================================

static void
initialize()
initialize(void)
{
static bool isInitialized = false;
if (!isInitialized) {
Expand Down Expand Up @@ -607,7 +607,7 @@
}

static bool
isEnabled()
isEnabled(void)
{
return g_isEnabled;
}
Expand Down Expand Up @@ -652,7 +652,7 @@
}

SentryCrashMonitorAPI *
sentrycrashcm_system_getAPI()
sentrycrashcm_system_getAPI(void)
{
static SentryCrashMonitorAPI api = { .setEnabled = setEnabled,
.isEnabled = isEnabled,
Expand Down
4 changes: 2 additions & 2 deletions Sources/SentryCrash/Recording/SentryCrash.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
@end

static NSString *
getBundleName()
getBundleName(void)
{
NSString *bundleName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
if (bundleName == nil) {
Expand All @@ -74,7 +74,7 @@
}

static NSString *
getBasePath()
getBasePath(void)
{
NSArray *directories
= NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
Expand Down
Loading

0 comments on commit 1a08f49

Please sign in to comment.