diff --git a/include/cli/directives/lookup.h b/include/cli/directives/lookup.h index b6fb39b..eccf097 100644 --- a/include/cli/directives/lookup.h +++ b/include/cli/directives/lookup.h @@ -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); diff --git a/include/cli/output.h b/include/cli/output.h index 41b1d0d..7c7e554 100644 --- a/include/cli/output.h +++ b/include/cli/output.h @@ -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, ...); diff --git a/include/os/console.h b/include/os/console.h index c40eb37..09b7d72 100644 --- a/include/os/console.h +++ b/include/os/console.h @@ -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); diff --git a/include/os/fs.h b/include/os/fs.h index 481d415..9d74eb6 100644 --- a/include/os/fs.h +++ b/include/os/fs.h @@ -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); diff --git a/include/os/no-optional/console.h b/include/os/no-optional/console.h index c02e6ae..83ce325 100644 --- a/include/os/no-optional/console.h +++ b/include/os/no-optional/console.h @@ -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); diff --git a/include/os/posix/console.h b/include/os/posix/console.h index 50ab137..559f130 100644 --- a/include/os/posix/console.h +++ b/include/os/posix/console.h @@ -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); diff --git a/include/os/posix/fs.h b/include/os/posix/fs.h index f98d4b7..cf95ebd 100644 --- a/include/os/posix/fs.h +++ b/include/os/posix/fs.h @@ -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); diff --git a/include/tm-mem.h b/include/tm-mem.h index c6953c4..6750888 100644 --- a/include/tm-mem.h +++ b/include/tm-mem.h @@ -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); diff --git a/src/common/cli/directives/commands/help.c b/src/common/cli/directives/commands/help.c index 71b9d16..d3744f2 100644 --- a/src/common/cli/directives/commands/help.c +++ b/src/common/cli/directives/commands/help.c @@ -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); } diff --git a/src/common/cli/directives/commands/list.c b/src/common/cli/directives/commands/list.c index 3180aa4..50e9749 100644 --- a/src/common/cli/directives/commands/list.c +++ b/src/common/cli/directives/commands/list.c @@ -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); diff --git a/src/common/cli/directives/commands/test.c b/src/common/cli/directives/commands/test.c index e9d98a2..b51c446 100644 --- a/src/common/cli/directives/commands/test.c +++ b/src/common/cli/directives/commands/test.c @@ -41,12 +41,12 @@ 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); @@ -54,7 +54,7 @@ static bool test_dypath() { 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; @@ -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(); } diff --git a/src/common/cli/directives/lookup.c b/src/common/cli/directives/lookup.c index 611a2cd..ecfc774 100644 --- a/src/common/cli/directives/lookup.c +++ b/src/common/cli/directives/lookup.c @@ -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)}; } diff --git a/src/common/cli/input.c b/src/common/cli/input.c index 292f29a..b81ec34 100644 --- a/src/common/cli/input.c +++ b/src/common/cli/input.c @@ -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)) ; diff --git a/src/common/cli/output.c b/src/common/cli/output.c index 4262120..2e295a6 100644 --- a/src/common/cli/output.c +++ b/src/common/cli/output.c @@ -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; } diff --git a/src/common/tm-mem.c b/src/common/tm-mem.c index 5fc9e31..e12142b 100644 --- a/src/common/tm-mem.c +++ b/src/common/tm-mem.c @@ -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); diff --git a/src/os-common/no-optional/console.c b/src/os-common/no-optional/console.c index c71426e..7989e8e 100644 --- a/src/os-common/no-optional/console.c +++ b/src/os-common/no-optional/console.c @@ -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}; } diff --git a/src/os-common/posix/console.c b/src/os-common/posix/console.c index f8b21b5..2e4d1b5 100644 --- a/src/os-common/posix/console.c +++ b/src/os-common/posix/console.c @@ -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}; diff --git a/src/os-common/posix/fs.c b/src/os-common/posix/fs.c index 9186609..ec13cad 100644 --- a/src/os-common/posix/fs.c +++ b/src/os-common/posix/fs.c @@ -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; } @@ -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; @@ -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; @@ -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"); diff --git a/src/os-specific/darwin/console.c b/src/os-specific/darwin/console.c index 41ee949..d56bdb5 100644 --- a/src/os-specific/darwin/console.c +++ b/src/os-specific/darwin/console.c @@ -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(); } diff --git a/src/os-specific/darwin/fs.c b/src/os-specific/darwin/fs.c index cc631a2..074dc5a 100644 --- a/src/os-specific/darwin/fs.c +++ b/src/os-specific/darwin/fs.c @@ -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(); } diff --git a/src/os-specific/linux/console.c b/src/os-specific/linux/console.c index 41ee949..d56bdb5 100644 --- a/src/os-specific/linux/console.c +++ b/src/os-specific/linux/console.c @@ -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(); } diff --git a/src/os-specific/linux/env.c b/src/os-specific/linux/env.c index 240e294..c8626a0 100644 --- a/src/os-specific/linux/env.c +++ b/src/os-specific/linux/env.c @@ -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; } diff --git a/src/os-specific/linux/fs.c b/src/os-specific/linux/fs.c index e159554..8168060 100644 --- a/src/os-specific/linux/fs.c +++ b/src/os-specific/linux/fs.c @@ -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(); }