commit 7322a28ec06abbc510097b8f08e065128ada9924
parent 95ae82c4c155bfbbfe45b765edd672452e1ffaab
Author: Florian Dold <florian@dold.me>
Date: Tue, 22 Aug 2023 13:47:20 +0200
increase warning_level, address warnings, ifdef fallback for older sqlite3 header
Diffstat:
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/quickjs/quickjs-libc.c b/quickjs/quickjs-libc.c
@@ -2322,7 +2322,6 @@ static JSValue js_os_fetchHttp(JSContext *ctx, JSValueConst this_val,
JSValue options = JS_UNINITIALIZED;
JSValue method = JS_UNINITIALIZED;
const char *method_str = NULL;
- CURLcode res;
CURLMcode mres;
CurlRequestContext *req_context = {0};
BOOL debug = FALSE;
@@ -2720,7 +2719,6 @@ static int handle_host_message(JSRuntime *rt, JSContext *ctx)
JS_FreeValue(ctx, obj);
JS_FreeValue(ctx, func);
if (JS_IsException(retval)) {
- fail:
js_std_dump_error(ctx);
} else {
JS_FreeValue(ctx, retval);
@@ -4240,7 +4238,6 @@ js_os_post_message_from_host(JSContext *ctx, const char *msg_str)
static JSValue js_os_simulateHostMessage(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
- JSThreadState *ts = JS_GetRuntimeOpaque(JS_GetRuntime(ctx));
const char *s;
s = JS_ToCString(ctx, argv[0]);
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
@@ -177,8 +177,6 @@ int
TALER_WALLET_run (struct TALER_WALLET_Instance *wh)
{
pthread_t wallet_thread;
- char *line;
- size_t line_sz;
pthread_attr_t tattr;
pthread_mutex_lock(&wh->handle_mutex);
diff --git a/tart_module.c b/tart_module.c
@@ -1252,15 +1252,12 @@ cleanup:
}
-// (ArrayBuffer, offset, len) => string
-// FIXME: Eventually, this should handle typed arrays properly as input as well.
+// (ArrayBuffer | TypedArray) => string
static JSValue js_decode_utf8(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
size_t psize;
uint8_t *utf8_buf;
- uint32_t offset;
- uint32_t len;
JSValue ret_val;
utf8_buf = JS_GetArrayBuffer(ctx, &psize, argv[0]);
@@ -1529,7 +1526,9 @@ const char *translate_sqlite3_err_to_string(int errcode)
ERRCASE(SQLITE_CONSTRAINT_DATATYPE);
ERRCASE(SQLITE_NOTICE_RECOVER_WAL);
ERRCASE(SQLITE_NOTICE_RECOVER_ROLLBACK);
+#ifdef SQLITE_NOTICE_RBU
ERRCASE(SQLITE_NOTICE_RBU);
+#endif
ERRCASE(SQLITE_WARNING_AUTOINDEX);
ERRCASE(SQLITE_AUTH_USER);
ERRCASE(SQLITE_OK_LOAD_PERMANENTLY);
@@ -1543,7 +1542,6 @@ const char *translate_sqlite3_err_to_string(int errcode)
static JSValue throw_sqlite3_error(JSContext *ctx, sqlite3 *db)
{
JSValue obj;
- char *errmsg;
obj = JS_NewError(ctx);
if (JS_IsException(obj)) {
@@ -1754,7 +1752,7 @@ static int bind_from_object(JSContext *ctx, sqlite3_stmt *stmt, JSValueConst obj
{
JSValue val;
int i;
- int len = 0; /* len of property table */
+ uint32_t len = 0; /* len of property table */
JSPropertyEnum *tab;
const char *key = NULL;
int retval = 0;
@@ -1769,7 +1767,7 @@ static int bind_from_object(JSContext *ctx, sqlite3_stmt *stmt, JSValueConst obj
return -1;
}
- for(i = 0; i < len; i++) {
+ for (i = 0; i < len; i++) {
int param_index;
val = JS_GetProperty(ctx, obj, tab[i].atom);
if (JS_IsException(val))
@@ -1924,10 +1922,11 @@ static int extract_result_row(JSContext *ctx, sqlite3_stmt *stmt, JSValueConst t
case SQLITE_NULL:
JS_SetPropertyStr(ctx, target, colname, JS_NULL);
break;
- case SQLITE_TEXT:
- const char *text = sqlite3_column_text(stmt, i);
+ case SQLITE_TEXT: {
+ const char *text = (const char *) sqlite3_column_text(stmt, i);
JS_SetPropertyStr(ctx, target, colname, JS_NewString(ctx, text));
break;
+ }
default:
JS_ThrowInternalError(ctx, "unexpected type from DB");
return -1;