1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[mujs] compilation fixes

This commit is contained in:
Witold Filipczyk 2023-11-21 16:37:37 +01:00
parent b2b7b123ec
commit c3c9041487
6 changed files with 11 additions and 16 deletions

View File

@ -31,9 +31,6 @@ mjs_attributes_set_items(js_State *J, void *node)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J);
assert(interpreter);
dom_exception err;
dom_namednodemap *attrs = (dom_namednodemap *)(node);
unsigned long idx;

View File

@ -23,10 +23,6 @@ mjs_console_log_common(js_State *J, const char *str, const char *log_filename)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J);
assert(interpreter);
if (log_filename && get_opt_bool("ecmascript.enable_console_log", NULL) && str)
{
FILE *f = fopen(log_filename, "a");

View File

@ -1901,6 +1901,7 @@ mjs_element_cloneNode(js_State *J)
mjs_push_element(J, clone);
}
#if 0
static bool
isAncestor(dom_node *el, dom_node *node)
{
@ -1924,6 +1925,7 @@ isAncestor(dom_node *el, dom_node *node)
return false;
}
#endif
static void
mjs_element_closest(js_State *J)

View File

@ -335,14 +335,14 @@ set_elstyle(const char *text)
return (void *)css;
}
const char *
char *
get_elstyle(void *m)
{
std::map<std::string, std::string> *css = static_cast<std::map<std::string, std::string> *>(m);
std::string delimiter("");
std::stringstream output("");
std::map<std::string, std::string>::iterator it;
const char *res = NULL;
char *res = NULL;
for (it = css->begin(); it != css->end(); it++) {
output << delimiter << it->first << ":" << it->second;
@ -355,7 +355,7 @@ get_elstyle(void *m)
return res;
}
const char *
char *
get_css_value(const char *text, const char *param)
{
void *m = set_elstyle(text);
@ -378,7 +378,7 @@ get_css_value(const char *text, const char *param)
return res;
}
const char *
char *
set_css_value(const char *text, const char *param, const char *value)
{
void *m = set_elstyle(text);

View File

@ -47,10 +47,10 @@ void set_xhr_header(char *normalized_value, const char *h_name, struct mjs_xhr *
char *get_output_headers(struct mjs_xhr *x);
char *get_output_header(const char *header_name, struct mjs_xhr *x);
const char *get_elstyle(void *m);
char *get_elstyle(void *m);
void *set_elstyle(const char *text);
const char *get_css_value(const char *text, const char *param);
const char *set_css_value(const char *text, const char *param, const char *value);
char *get_css_value(const char *text, const char *param);
char *set_css_value(const char *text, const char *param, const char *value);
#ifdef __cplusplus
}

View File

@ -28,7 +28,7 @@ mjs_style(js_State *J, const char *property)
dom_exception exc;
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
dom_string *style = NULL;
const char *res = NULL;
char *res = NULL;
if (!el) {
js_pushnull(J);
@ -72,7 +72,7 @@ mjs_set_style(js_State *J, const char *property)
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
dom_string *style = NULL;
dom_string *stylestr = NULL;
const char *res = NULL;
char *res = NULL;
const char *value;
if (!el) {