From d2952b0aa15ff72387aad767fb6145f15841aae8 Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Mon, 28 Oct 2024 00:31:52 +0000 Subject: [PATCH] partially fix FreeBSD compatibility --- meson.build | 1 + src/cache.h | 6 +++--- src/log.h | 6 +++--- src/main.c | 4 ++-- src/memcache.c | 2 +- src/memcache.h | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 464486d..d655074 100644 --- a/meson.build +++ b/meson.build @@ -22,6 +22,7 @@ srcs = [ ] c_args = [ + '-Wstrict-prototypes', '-pthread', '-D_GNU_SOURCE', '-DVERSION="' + meson.project_version() + '"' diff --git a/src/cache.h b/src/cache.h index 979953d..5b49084 100644 --- a/src/cache.h +++ b/src/cache.h @@ -95,12 +95,12 @@ void CacheSystem_init(const char *path, int url_supplied); /** * \brief clear the content of the cache directory */ -void CacheSystem_clear(); +void CacheSystem_clear(void); /** * \brief Return the fullpath to the cache directory */ -char *CacheSystem_get_cache_dir(); +char *CacheSystem_get_cache_dir(void); /** * \brief Create directories under the cache directory structure, if they do @@ -153,4 +153,4 @@ void Cache_delete(const char *fn); */ long Cache_read(Cache *cf, char *const output_buf, const off_t len, const off_t offset_start); -#endif \ No newline at end of file +#endif diff --git a/src/log.h b/src/log.h index 687814b..6fa695e 100644 --- a/src/log.h +++ b/src/log.h @@ -25,7 +25,7 @@ typedef enum { /** * \brief Get the log level from the environment. */ -int log_level_init(); +int log_level_init(void); /** * \brief Log printf @@ -44,6 +44,6 @@ void log_printf(LogType type, const char *file, const char *func, int line, /** * \brief Print the version information for HTTPDirFS */ -void print_version(); +void print_version(void); -#endif \ No newline at end of file +#endif diff --git a/src/main.c b/src/main.c index e021563..4fe2c8e 100644 --- a/src/main.c +++ b/src/main.c @@ -9,7 +9,7 @@ void add_arg(char ***fuse_argv_ptr, int *fuse_argc, char *opt_string); static void print_help(char *program_name, int long_help); -static void print_long_help(); +static void print_long_help(void); static int parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc); void parse_config_file(char ***argv, int *argc); @@ -431,4 +431,4 @@ HTTPDirFS options:\n\ using the insecure username / hex encoded password\n\ scheme\n\ \n"); -} \ No newline at end of file +} diff --git a/src/memcache.c b/src/memcache.c index 386a2c4..b175aed 100644 --- a/src/memcache.c +++ b/src/memcache.c @@ -25,4 +25,4 @@ size_t write_memory_callback(void *recv_data, size_t size, size_t nmemb, ts->data[ts->curr_size] = '\0'; return recv_size; -} \ No newline at end of file +} diff --git a/src/memcache.h b/src/memcache.h index 77511fe..8fe437f 100644 --- a/src/memcache.h +++ b/src/memcache.h @@ -32,4 +32,4 @@ struct TransferStruct { size_t write_memory_callback(void *contents, size_t size, size_t nmemb, void *userp); -#endif \ No newline at end of file +#endif