From b15cf901ad3a779cc7069b81c069b73c26ef9e16 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 17 Dec 2021 23:58:59 +0000 Subject: [PATCH] Fix some things that GCC 10 doesn't like on raspi. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3690 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/database.js.c | 6 ++++-- src/ssb.js.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/database.js.c b/src/database.js.c index 5bb3d85e..c20cf80c 100644 --- a/src/database.js.c +++ b/src/database.js.c @@ -52,8 +52,10 @@ static JSValue _database_create(JSContext* context, JSValueConst this_val, int a { ++_database_count; JSValue object = JS_NewObjectClass(context, _database_class_id); - sqlite3* db = NULL; - JS_ToInt64(context, (int64_t*)&db, data[0]); + + int64_t value = 0; + JS_ToInt64(context, &value, data[0]); + sqlite3* db = (sqlite3*)(intptr_t)value; database_t* database = malloc(sizeof(database_t)); *database = (database_t) diff --git a/src/ssb.js.c b/src/ssb.js.c index 97bdd54c..f5a057fc 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -531,7 +531,8 @@ static void _tf_ssb_on_broadcasts_changed_callback(tf_ssb_t* ssb, void* user_dat { JSContext* context = tf_ssb_get_context(ssb); JSValue callback = JS_MKPTR(JS_TAG_OBJECT, user_data); - JSValue response = JS_Call(context, callback, JS_UNDEFINED, 1, &JS_UNDEFINED); + JSValue argv = JS_UNDEFINED; + JSValue response = JS_Call(context, callback, JS_UNDEFINED, 1, &argv); tf_util_report_error(context, response); JS_FreeValue(context, response); }