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

[spidermonkey] clang compilation fixes

This commit is contained in:
Witold Filipczyk 2023-09-28 13:27:31 +02:00
parent 6487a287cf
commit 42abf0b058
3 changed files with 15 additions and 16 deletions

View File

@ -1303,7 +1303,7 @@ document_createComment(JSContext *ctx, unsigned int argc, JS::Value *vp)
}
dom_string *data = NULL;
dom_exception exc;
const char *str;
char *str;
size_t len;
str = jsval_to_string(ctx, args[0]);
@ -1393,7 +1393,7 @@ document_createElement(JSContext *ctx, unsigned int argc, JS::Value *vp)
dom_document *doc = (dom_document *)document->dom;
dom_string *tag_name = NULL;
dom_exception exc;
const char *str;
char *str;
size_t len;
str = jsval_to_string(ctx, args[0]);
@ -1443,7 +1443,7 @@ document_createTextNode(JSContext *ctx, unsigned int argc, JS::Value *vp)
dom_document *doc = (dom_document *)document->dom;
dom_string *data = NULL;
dom_exception exc;
const char *str;
char *str;
size_t len;
str = jsval_to_string(ctx, args[0]);
@ -1499,7 +1499,7 @@ document_getElementById(JSContext *ctx, unsigned int argc, JS::Value *vp)
dom_document *doc = (dom_document *)document->dom;
dom_string *id = NULL;
dom_exception exc;
const char *str;
char *str;
size_t len;
str = jsval_to_string(ctx, args[0]);
@ -1612,7 +1612,7 @@ document_getElementsByTagName(JSContext *ctx, unsigned int argc, JS::Value *vp)
dom_document *doc = (dom_document *)document->dom;
dom_string *tagname = NULL;
dom_exception exc;
const char *str;
char *str;
size_t len;
str = jsval_to_string(ctx, args[0]);

View File

@ -3621,7 +3621,7 @@ element_getAttributeNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
return true;
}
size_t len;
const char *str = jsval_to_string(ctx, args[0]);
char *str = jsval_to_string(ctx, args[0]);
if (!str) {
args.rval().setNull();
@ -4352,8 +4352,8 @@ element_setAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval)
if (!el) {
return true;
}
const char *attr;
const char *value;
char *attr;
char *value;
size_t attr_len, value_len;
attr = jsval_to_string(ctx, args[0]);

View File

@ -378,7 +378,7 @@ 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);
@ -390,14 +390,14 @@ get_elstyle(void *m)
output << delimiter << it->first << ":" << it->second;
delimiter = ";";
}
const char *res = stracpy(output.str().c_str());
char *res = stracpy(output.str().c_str());
css->clear();
delete css;
return res;
}
const char *
char *
get_css_value(const char *text, const char *param)
{
void *m = set_elstyle(text);
@ -420,7 +420,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);
@ -446,7 +446,6 @@ set_css_value(const char *text, const char *param, const char *value)
return stracpy("");
}
static bool
style_style(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *property)
{
@ -476,7 +475,7 @@ style_style(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *proper
dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(hobj, 0);
dom_exception exc;
dom_string *style = NULL;
const char *res = NULL;
char *res = NULL;
if (!el) {
args.rval().setNull();
@ -542,8 +541,8 @@ style_set_style(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *pr
dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(hobj, 0);
dom_string *style = NULL;
dom_string *stylestr = NULL;
const char *res = NULL;
const char *value;
char *res = NULL;
char *value;
if (!el) {
args.rval().setNull();