Skip to content
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

fix: use void for all empty parameter-lists in C functions #804

Merged
merged 2 commits into from
Feb 8, 2023
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 include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers(
* 0 = no crash recognized
* -1 = sentry_init() hasn't been called yet
*/
SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run();
SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(void);

/**
* Clear the status of the "crashed-last-run". You should explicitly call
Expand All @@ -1875,22 +1875,22 @@ SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run();
*
* Returns 0 on success, 1 on error.
*/
SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run();
SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(void);

/**
* Sentry SDK version.
*/
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version();
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(void);

/**
* Sentry SDK name.
*/
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name();
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(void);

/**
* Sentry SDK User-Agent.
*/
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent();
SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(void);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions src/sentry_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,13 +1014,13 @@ sentry_span_finish(sentry_span_t *opaque_span)
}

int
sentry_get_crashed_last_run()
sentry_get_crashed_last_run(void)
{
return g_last_crash;
}

int
sentry_clear_crashed_last_run()
sentry_clear_crashed_last_run(void)
{
bool success = false;
sentry_options_t *options = sentry__options_lock();
Expand Down
6 changes: 3 additions & 3 deletions src/sentry_info.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#include "sentry_boot.h"

const char *
sentry_sdk_version()
sentry_sdk_version(void)
{
return SENTRY_SDK_VERSION;
}

const char *
sentry_sdk_name()
sentry_sdk_name(void)
{
return SENTRY_SDK_NAME;
}

const char *
sentry_sdk_user_agent()
sentry_sdk_user_agent(void)
{
return SENTRY_SDK_USER_AGENT;
}
4 changes: 2 additions & 2 deletions src/sentry_scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sentry__scope_unlock(void)
}

void
sentry__scope_flush_unlock()
sentry__scope_flush_unlock(void)
{
sentry__scope_unlock();
SENTRY_WITH_OPTIONS (options) {
Expand Down Expand Up @@ -245,7 +245,7 @@ sentry__get_span_or_transaction(const sentry_scope_t *scope)

#ifdef SENTRY_UNITTEST
sentry_value_t
sentry__scope_get_span_or_transaction()
sentry__scope_get_span_or_transaction(void)
{
SENTRY_WITH_SCOPE (scope) {
return sentry__get_span_or_transaction(scope);
Expand Down
4 changes: 2 additions & 2 deletions src/sentry_scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void sentry__scope_cleanup(void);
* This function must be called while holding the scope lock, and it will be
* unlocked internally.
*/
void sentry__scope_flush_unlock();
void sentry__scope_flush_unlock(void);

/**
* This will merge the requested data which is in the given `scope` to the given
Expand Down Expand Up @@ -98,5 +98,5 @@ void sentry__scope_apply_to_event(const sentry_scope_t *scope,

// this is only used in unit tests
#ifdef SENTRY_UNITTEST
sentry_value_t sentry__scope_get_span_or_transaction();
sentry_value_t sentry__scope_get_span_or_transaction(void);
#endif
2 changes: 1 addition & 1 deletion src/sentry_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sentry__thread_setname(sentry_threadid_t thread_id, const char *thread_name)
}
#else
sentry_threadid_t
sentry__thread_get_current_threadid()
sentry__thread_get_current_threadid(void)
{
return pthread_self();
}
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ sentry__iso8601_to_msec(const char *iso)
// to ensure the C locale is also used there.
#if !defined(SENTRY_PLATFORM_ANDROID) && !defined(SENTRY_PLATFORM_IOS)
static sentry__locale_t
c_locale()
c_locale(void)
{
static long c_locale_initialized = 0;
static sentry__locale_t c_locale;
Expand Down