Skip to content

Commit

Permalink
Add void signature for C functions without parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
estraier committed Oct 22, 2024
1 parent a3f30c2 commit ba89aa1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions tkrzw_langc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void tkrzw_set_last_status(int32_t code, const char* message) {
}
}

TkrzwStatus tkrzw_get_last_status() {
TkrzwStatus tkrzw_get_last_status(void) {
TkrzwStatus status;
status.code = last_status.GetCode();
if (last_status.HasMessage()) {
Expand All @@ -141,11 +141,11 @@ TkrzwStatus tkrzw_get_last_status() {
return status;
}

int32_t tkrzw_get_last_status_code() {
int32_t tkrzw_get_last_status_code(void) {
return last_status.GetCode();
}

const char* tkrzw_get_last_status_message() {
const char* tkrzw_get_last_status_message(void) {
if (last_status.HasMessage()) {
last_message = last_status.GetMessage();
return last_message.c_str();
Expand All @@ -157,7 +157,7 @@ const char* tkrzw_status_code_name(int32_t code) {
return Status::CodeName(static_cast<Status::Code>(code));
}

double tkrzw_get_wall_time() {
double tkrzw_get_wall_time(void) {
try {
return GetWallTime();
} catch (const std::exception& e) {
Expand All @@ -166,7 +166,7 @@ double tkrzw_get_wall_time() {
}
}

int64_t tkrzw_get_memory_capacity() {
int64_t tkrzw_get_memory_capacity(void) {
try {
return GetMemoryCapacity();
} catch (const std::exception& e) {
Expand All @@ -175,7 +175,7 @@ int64_t tkrzw_get_memory_capacity() {
}
}

int64_t tkrzw_get_memory_usage() {
int64_t tkrzw_get_memory_usage(void) {
try {
return GetMemoryUsage();
} catch (const std::exception& e) {
Expand Down
12 changes: 6 additions & 6 deletions tkrzw_langc.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,21 @@ void tkrzw_set_last_status(int32_t code, const char* message);
* @details The region of the message string is available until the this function or
* tkrzw_get_last_status_message function is called next time.
*/
TkrzwStatus tkrzw_get_last_status();
TkrzwStatus tkrzw_get_last_status(void);

/**
* Gets the status code of the last system operation.
* @return The status code of the last system operation.
*/
int32_t tkrzw_get_last_status_code();
int32_t tkrzw_get_last_status_code(void);

/**
* Gets the status message of the last system operation.
* @return The status message of the last system operation.
* @details The region of the message string is available until the this function or
* tkrzw_get_last_status function is called next time.
*/
const char* tkrzw_get_last_status_message();
const char* tkrzw_get_last_status_message(void);

/**
* Gets the string name of a status code.
Expand All @@ -243,19 +243,19 @@ const char* tkrzw_status_code_name(int32_t code);
* Gets the number of seconds since the UNIX epoch.
* @return The number of seconds since the UNIX epoch with microsecond precision.
*/
double tkrzw_get_wall_time();
double tkrzw_get_wall_time(void);

/**
* Gets the memory capacity of the platform.
* @return The memory capacity of the platform in bytes, or -1 on failure.
*/
int64_t tkrzw_get_memory_capacity();
int64_t tkrzw_get_memory_capacity(void);

/**
* Gets the current memory usage of the process.
* @return The current memory usage of the process in bytes, or -1 on failure.
*/
int64_t tkrzw_get_memory_usage();
int64_t tkrzw_get_memory_usage(void);

/**
* Primary hash function for the hash database.
Expand Down
2 changes: 1 addition & 1 deletion tkrzw_langc_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "tkrzw_langc.h"

void print_usage() {
void print_usage(void) {
fprintf(stderr, "usage: tkrzw_lang_check [path [params [iters]]]\n");
}

Expand Down

0 comments on commit ba89aa1

Please sign in to comment.