Skip to content

Commit

Permalink
changed () -> (void) in declarations and defs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro-Salerno committed Nov 10, 2024
1 parent cbcb96a commit c2dfefa
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions include/cli/directives/lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ typedef struct {

bool cli_lkup_command(const char *command, cli_drt_desc_t *dst);
bool cli_lkup_option(const char *command, cli_drt_desc_t *dst);
cli_lkup_table_t cli_lkup_cmdtable();
cli_lkup_table_t cli_lkup_opttable();
cli_lkup_table_t cli_lkup_cmdtable(void);
cli_lkup_table_t cli_lkup_opttable(void);
4 changes: 2 additions & 2 deletions include/cli/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include "os/console.h"

void cli_out_newline();
void cli_out_reset();
void cli_out_newline(void);
void cli_out_reset(void);
void cli_out_progress(const char *fmt, ...);
void cli_out_success(const char *fmt, ...);
void cli_out_error(const char *fmt, ...);
Expand Down
2 changes: 1 addition & 1 deletion include/os/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ typedef enum {
TM_COLOR_RESET
} color_t;

csz_t os_console_get_sz();
csz_t os_console_get_sz(void);
void os_console_set_color(color_t color, bool bold);
2 changes: 1 addition & 1 deletion include/os/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ os_fs_tm_dyrecipe(char **dst, const char *repo_name, const char *pkg_name);
size_t os_fs_tm_dyplugins(const char **dst);
size_t os_fs_tm_dyplugin(const char **dst, const char *plugin);
size_t os_fs_tm_dyplugconf(const char **dst, const char *plugin);
bool os_fs_tm_init();
bool os_fs_tm_init(void);
2 changes: 1 addition & 1 deletion include/os/no-optional/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

#include "os/console.h"

csz_t noopt_console_get_sz();
csz_t noopt_console_get_sz(void);
void noopt_console_set_color(color_t color, bool bold);
2 changes: 1 addition & 1 deletion include/os/posix/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@

#include "os/console.h"

csz_t posix_console_get_sz();
csz_t posix_console_get_sz(void);
void posix_console_set_color(color_t color, bool bold);
2 changes: 1 addition & 1 deletion include/os/posix/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ size_t posix_fs_tm_dyplugins(const char **dst);
size_t posix_fs_tm_dyplugin(const char **dst, const char *plugin);
size_t posix_fs_tm_dyplugconf(const char **dst, const char *plugin);
size_t posix_fs_tm_dyexecpath(const char **dst, const char *exec);
bool posix_fs_tm_init();
bool posix_fs_tm_init(void);
2 changes: 1 addition & 1 deletion include/tm-mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
#pragma once

void mem_safe_free(const void *ptr);
void mem_oom();
void mem_oom(void);
void mem_chkoom(void *ptr);
2 changes: 1 addition & 1 deletion src/common/cli/directives/commands/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define OPT_SEPARATOR_LEN 2
#define COLUMN_SEPARATOR_LEN 4

static void print_indent() {
static void print_indent(void) {
cli_out_space(BASE_LINE_LEN);
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/cli/directives/commands/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static bool find_max_pkg_name_len(size_t *len) {
return ret;
}

static void simple_print() {
static void simple_print(void) {
char *pkg_dir = NULL;
os_fs_tm_dypkgs(&pkg_dir);

Expand Down
8 changes: 4 additions & 4 deletions src/common/cli/directives/commands/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
cli_out_success("All tests passed"); \
return EXIT_SUCCESS;

// static bool test_tar() {
// static bool test_tar(void) {
// cli_out_progress("Testing tar extraction...");
// return archive_tar_extract("extract", "archive.tar");
// }

static bool test_dypath() {
static bool test_dypath(void) {
cli_out_progress("Testing dypath...");
char *path;
os_fs_tm_dyhome(&path);
printf("%s\n", path);
return true;
}

static bool test_dirs() {
static bool test_dirs(void) {
cli_out_progress("Testing dir creation...");
if (TM_FS_DIROP_STATUS_OK != os_fs_mkdir("test")) {
return false;
Expand All @@ -78,7 +78,7 @@ static bool test_dirs() {
return true;
}

static bool test_init() {
static bool test_init(void) {
cli_out_progress("Testing fs init...");
return os_fs_tm_init();
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/cli/directives/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ bool cli_lkup_option(const char *option, cli_drt_desc_t *dst) {
options, sizeof options / sizeof(cli_drt_desc_t), option, dst);
}

cli_lkup_table_t cli_lkup_cmdtable() {
cli_lkup_table_t cli_lkup_cmdtable(void) {
return (cli_lkup_table_t){.table = commands,
.num_entries =
sizeof commands / sizeof(cli_drt_desc_t)};
}

cli_lkup_table_t cli_lkup_opttable() {
cli_lkup_table_t cli_lkup_opttable(void) {
return (cli_lkup_table_t){
.table = options, .num_entries = sizeof options / sizeof(cli_drt_desc_t)};
}
2 changes: 1 addition & 1 deletion src/common/cli/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "cli/output.h"
#include "stream.h"

static void clear_input_stream() {
static void clear_input_stream(void) {
char ch = 0;
while (32 < (ch = getchar()) && !feof(stdin))
;
Expand Down
4 changes: 2 additions & 2 deletions src/common/cli/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ static void aligned_vprintf(const char *fmt, va_list args, size_t pad) {
}
}

void cli_out_newline() {
void cli_out_newline(void) {
if (!last_is_newline) {
puts("");
last_is_newline = true;
}
}

void cli_out_reset() {
void cli_out_reset(void) {
last_is_newline = false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/tm-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void mem_safe_free(void *ptr) {
}
}

void mem_oom() {
void mem_oom(void) {
cli_out_error("Unable to allocate memory, probably ran out of memory. "
"Exiting now");
exit(EXIT_FAILURE);
Expand Down
2 changes: 1 addition & 1 deletion src/os-common/no-optional/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "os/no-optional/console.h"

csz_t noopt_console_get_sz() {
csz_t noopt_console_get_sz(void) {
return (csz_t){.rows = 40, .columns = 80};
}

Expand Down
2 changes: 1 addition & 1 deletion src/os-common/posix/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "os/console.h"

csz_t posix_console_get_sz() {
csz_t posix_console_get_sz(void) {
struct winsize size;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &size);
return (csz_t){.rows = size.ws_row, .columns = size.ws_col};
Expand Down
8 changes: 4 additions & 4 deletions src/os-common/posix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static tmstr_t Plugins = {0};
static tmstr_t PluginConf = {0};
static tmstr_t Path = {0};

static const char *get_home_directory() {
static const char *get_home_directory(void) {
struct passwd *pw = getpwuid(getuid());
return pw->pw_dir;
}
Expand All @@ -61,7 +61,7 @@ static fs_dirop_status_t simplify(fs_dirop_status_t s) {
return s;
}

static fs_dirop_status_t translate_direrr() {
static fs_dirop_status_t translate_direrr(void) {
switch (errno) {
case EACCES:
return TM_FS_DIROP_STATUS_PERM;
Expand All @@ -78,7 +78,7 @@ static fs_dirop_status_t translate_direrr() {
}
}

static fs_fileop_status_t translate_fileerr() {
static fs_fileop_status_t translate_fileerr(void) {
switch (errno) {
case EACCES:
return TM_FS_FILEOP_STATUS_PERM;
Expand Down Expand Up @@ -503,7 +503,7 @@ size_t posix_fs_tm_dyexecpath(const char **dst, const char *exec) {
return ret;
}

bool posix_fs_tm_init() {
bool posix_fs_tm_init(void) {
const char *usr_home = get_home_directory();

Home.len = os_fs_path_dyconcat(&Home.buf, 2, usr_home, ".tarman");
Expand Down
2 changes: 1 addition & 1 deletion src/os-specific/darwin/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "os/console.h"

csz_t os_console_get_sz() {
csz_t os_console_get_sz(void) {
return posix_console_get_sz();
}

Expand Down
2 changes: 1 addition & 1 deletion src/os-specific/darwin/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ size_t os_fs_tm_dyplugconf(const char **dst, const char *plugin) {
return posix_fs_tm_dyplugconf(dst, plugin);
}

bool os_fs_tm_init() {
bool os_fs_tm_init(void) {
return posix_fs_tm_init();
}
2 changes: 1 addition & 1 deletion src/os-specific/linux/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "os/console.h"

csz_t os_console_get_sz() {
csz_t os_console_get_sz(void) {
return posix_console_get_sz();
}

Expand Down
2 changes: 1 addition & 1 deletion src/os-specific/linux/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "os/posix/env.h"
#include "tm-mem.h"

static const char *get_home_directory() {
static const char *get_home_directory(void) {
struct passwd *pw = getpwuid(getuid());
return pw->pw_dir;
}
Expand Down
2 changes: 1 addition & 1 deletion src/os-specific/linux/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ size_t os_fs_tm_dyplugconf(const char **dst, const char *plugin) {
return posix_fs_tm_dyplugconf(dst, plugin);
}

bool os_fs_tm_init() {
bool os_fs_tm_init(void) {
return posix_fs_tm_init();
}

0 comments on commit c2dfefa

Please sign in to comment.