1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[spidermonkey] console - get rid of warnings

This commit is contained in:
Witold Filipczyk 2022-02-23 18:36:01 +01:00
parent e25654404c
commit 08b7d32cd4
3 changed files with 4 additions and 25 deletions

View File

@ -33,8 +33,6 @@
#define DEBUG 0
static bool console_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp);
JSClassOps console_ops = {
nullptr, // addProperty
nullptr, // deleteProperty
@ -56,23 +54,6 @@ const JSClass console_class = {
&console_ops
};
/* @console_class.getProperty */
static bool
console_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp)
{
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
JSObject *parent_win; /* instance of @window_class */
struct view_state *vs;
struct document_view *doc_view;
struct document *document;
struct session *ses;
return true;
}
static bool console_error(JSContext *ctx, unsigned int argc, JS::Value *vp);
static bool console_log(JSContext *ctx, unsigned int argc, JS::Value *vp);
@ -85,7 +66,6 @@ const spidermonkeyFunctionSpec console_funcs[] = {
static bool
console_log_common(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *log_filename)
{
struct ecmascript_interpreter *interpreter = JS_GetContextPrivate(ctx);
JS::CallArgs args = CallArgsFromVp(argc, vp);
if (argc != 1 || !log_filename)
@ -96,7 +76,7 @@ console_log_common(JSContext *ctx, unsigned int argc, JS::Value *vp, const char
if (get_opt_bool("ecmascript.enable_console_log", NULL))
{
unsigned char *key = jsval_to_string(ctx, args[0]);
char *key = jsval_to_string(ctx, args[0]);
FILE *f = fopen(log_filename, "a");

View File

@ -42,7 +42,7 @@ heartbeat_callback(JSContext *ctx)
return true;
}
struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp);
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS::GetRealmPrivate(comp);
if (!interpreter || !interpreter->heartbeat || interpreter->heartbeat->ttl > 0) {
return true;
@ -74,7 +74,7 @@ check_heartbeats(void *data)
ecmascript_timeout_dialog(term, max_exec_time);
}
JS_RequestInterruptCallback(hb->interpreter->backend_data);
JS_RequestInterruptCallback((JSContext *)hb->interpreter->backend_data);
}
}
install_signal_handler(SIGVTALRM, check_heartbeats, NULL, 1);

View File

@ -8,7 +8,6 @@ static void string_to_jsval(JSContext *ctx, JS::Value *vp, char *string);
static void astring_to_jsval(JSContext *ctx, JS::Value *vp, char *string);
static int jsval_to_boolean(JSContext *ctx, JS::Value *vp);
static void jshandle_value_to_char_string(struct string *string, JSContext *ctx, JS::HandleValue obj);
/** Inline functions */
@ -40,7 +39,7 @@ jsval_to_boolean(JSContext *ctx, JS::Value *vp)
/* Since SpiderMonkey 52 the Mutable Handle Object
* is different for String and Number and must be
* handled accordingly */
void
static inline void
jshandle_value_to_char_string(struct string *string, JSContext *ctx, JS::HandleValue obj)
{
if (!init_string(string)) {