From eae56d01881ceb08237567f20ad6648929e0ba3b Mon Sep 17 00:00:00 2001 From: Seppi Date: Tue, 24 Oct 2017 01:00:05 -0500 Subject: [PATCH 1/2] adding the return status to fsOpenSystemPath so that gcc doesn't throw warnings --- src/fs.c | 4 ++-- src/fs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fs.c b/src/fs.c index 601ac2a..3f10815 100644 --- a/src/fs.c +++ b/src/fs.c @@ -674,7 +674,7 @@ void fsMakeDir(FileSystem* fs, const char* name) #if defined(__WINDOWS__) || defined(__LINUX__) || defined(__MACOSX__) -void fsOpenSystemPath(FileSystem* fs, const char* path) +int fsOpenSystemPath(FileSystem* fs, const char* path) { char command[FILENAME_MAX]; @@ -692,7 +692,7 @@ void fsOpenSystemPath(FileSystem* fs, const char* path) #endif - tic_system(UTF8ToString(command)); + return tic_system(UTF8ToString(command)); } #else diff --git a/src/fs.h b/src/fs.h index 84c908f..ba19168 100644 --- a/src/fs.h +++ b/src/fs.h @@ -67,7 +67,7 @@ bool fsCopyFile(const char* src, const char* dst); void fsGetFileData(GetCallback callback, const char* name, void* buffer, size_t size, u32 mode, void* data); void fsOpenFileData(OpenCallback callback, void* data); void fsOpenWorkingFolder(FileSystem* fs); -void fsOpenSystemPath(FileSystem* fs, const char* path); +int fsOpenSystemPath(FileSystem* fs, const char* path); bool fsIsDir(FileSystem* fs, const char* dir); bool fsIsInPublicDir(FileSystem* fs); bool fsChangeDir(FileSystem* fs, const char* dir); From d7dbadff25fa5cac67cab1976b784b1c83142a44 Mon Sep 17 00:00:00 2001 From: Seppi Date: Tue, 24 Oct 2017 01:00:34 -0500 Subject: [PATCH 2/2] Removing last param from duktape to remove gcc warnings --- src/ext/duktape/duktape.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ext/duktape/duktape.h b/src/ext/duktape/duktape.h index 614954e..b86ba43 100644 --- a/src/ext/duktape/duktape.h +++ b/src/ext/duktape/duktape.h @@ -456,21 +456,21 @@ DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_raw(duk_context *ctx, duk_errc #if defined(DUK_API_VARIADIC_MACROS) #define duk_error(ctx,err_code,...) \ - (duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_generic_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_eval_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_EVAL_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_EVAL_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_range_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_RANGE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_RANGE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_reference_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_REFERENCE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_REFERENCE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_syntax_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_SYNTAX_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_SYNTAX_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_type_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_TYPE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_TYPE_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #define duk_uri_error(ctx,...) \ - (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_URI_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0) + (duk_error_raw((ctx), (duk_errcode_t) DUK_ERR_URI_ERROR, (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__)) #else /* DUK_API_VARIADIC_MACROS */ /* For legacy compilers without variadic macros a macro hack is used to allow * variable arguments. While the macro allows "return duk_error(...)", it