Modernize: get rid of c-style void function args

This commit is contained in:
Will Toohey
2026-06-27 16:57:40 +10:00
parent 91a3bd23f6
commit 984a090b84
12 changed files with 18 additions and 18 deletions

View File

@@ -209,7 +209,7 @@ FOREACH_AVS_FUNC_OPTIONAL(AVS_FUNC_PTR)
#define AVS_FUNC_LOAD(ret_type, name, ...) LOAD_FUNC(name);
#define AVS_FUNC_LOAD_OPTIONAL(ret_type, name, ...) name = (decltype(name))GetProcAddress(mod_handle, exports.name);
bool init_avs(void) {
bool init_avs() {
bool success = false;
#ifdef _DEBUG

View File

@@ -226,7 +226,7 @@ bool rapidxml_from_avs_file(
);
char* avs_file_to_string(AVS_FILE f, rapidxml::xml_document<>& allocator);
std::vector<uint8_t> avs_file_to_vec(AVS_FILE f);
bool init_avs(void);
bool init_avs();
unsigned char* lz_compress(unsigned char* input, size_t length, size_t *compressed_length);
unsigned char* lz_decompress(unsigned char* input, size_t length, size_t *decompressed_length);

View File

@@ -75,7 +75,7 @@ bool boot(bool _print_logs) {
return true;
}
void shutdown(void) {
void shutdown() {
avs_shutdown();
}
@@ -86,7 +86,7 @@ void shutdown(void) {
return false; \
}
bool load_dll(void)
bool load_dll()
{
auto avs = LoadLibraryA("avs2-core.dll");
if (!avs)

View File

@@ -2,6 +2,6 @@ namespace avs_standalone
{
bool boot(bool print_logs);
void shutdown(void);
bool load_dll(void);
void shutdown();
bool load_dll();
}

View File

@@ -24,7 +24,7 @@ static void parse_list(std::string_view arg, std::set<std::string, CaseInsensiti
dest.emplace(std::string_view(el));
}
void load_config(void) {
void load_config() {
config.disable = false;
config.allowlist.clear();
config.blocklist.clear();
@@ -96,7 +96,7 @@ void load_config(void) {
}
}
void print_config(void) {
void print_config() {
log_info("Options: {}={} {}={} {}={} {}{} {}{} {}{} {}{}",
VERBOSE_FLAG, config.verbose_logs,
DEVMODE_FLAG, config.developer_mode,

View File

@@ -47,5 +47,5 @@ struct config_t {
extern config_t config;
void load_config(void);
void print_config(void);
void load_config();
void print_config();

View File

@@ -636,7 +636,7 @@ static void dump_loaded_dll_info() {
}
extern "C" {
__declspec(dllexport) int init(void) {
__declspec(dllexport) int init() {
// all logs up until init_avs succeeds will go to a file for debugging purposes
// find out where we're logging to

View File

@@ -18,7 +18,7 @@ size_t hook_avs_fs_read(AVS_FILE context, void* bytes, size_t nbytes);
string_set list_pngs(std::string const&folder);
extern "C" {
__declspec(dllexport) int init(void);
__declspec(dllexport) int init();
}
// Used to simplify file opens - pkfs/avs_fs have different signatures, but

View File

@@ -99,7 +99,7 @@ void stdout_log_body_misc(const char *module, const char *fmt, ...) {
va_end(args);
}
void log_to_stdout(void) {
void log_to_stdout() {
imp_log_body_fatal = stdout_log_body_fatal;
imp_log_body_warning = stdout_log_body_warning;
imp_log_body_info = stdout_log_body_info;

View File

@@ -34,4 +34,4 @@ extern log_formatter_t imp_log_body_misc;
#define log_verbose(...) if(config.verbose_logs) {log_misc(__VA_ARGS__);}
// for the playpen
void log_to_stdout(void);
void log_to_stdout();

View File

@@ -54,7 +54,7 @@ std::set<std::string, CaseInsensitiveCompare> walk_dir(const std::string &path,
return result;
}
void cache_mods(void) {
void cache_mods() {
// this is a bit hacky
bool devmode = config.developer_mode;
config.developer_mode = true;
@@ -77,7 +77,7 @@ void cache_mods(void) {
// data is "flat", all others must have their own special subfolders
static std::vector<std::string> game_folders;
void init_modpath_handler(void) {
void init_modpath_handler() {
log_verbose("Top level folders:");
for (auto folder : folders_in_folder(".")) {
log_verbose(" {}", folder);

View File

@@ -4,9 +4,9 @@
#include <vector>
#include <optional>
void init_modpath_handler(void);
void init_modpath_handler();
void modpath_debug_add_folder(const std::string &folder);
void cache_mods(void);
void cache_mods();
std::vector<std::string> available_mods();
// mutates source std::string to be all lowercase
std::optional<std::string> normalise_path(const std::string &path, bool demangle = true);