summaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/json.c b/src/json.c
index cc98914423b..e2a4424463b 100644
--- a/src/json.c
+++ b/src/json.c
@@ -215,7 +215,7 @@ json_has_suffix (const char *string, const char *suffix)
#endif
-/* Note that all callers of make_utf8_string and build_utf8_string
+/* Note that all callers of make_string_from_utf8 and build_string_from_utf8
below either pass only value UTF-8 strings or use the functionf for
formatting error messages; in the latter case correctness isn't
critical. */
@@ -267,9 +267,11 @@ json_parse_error (const json_error_t *error)
symbol = Qjson_parse_error;
#endif
xsignal (symbol,
- list5 (build_utf8_string (error->text),
- build_utf8_string (error->source), INT_TO_INTEGER (error->line),
- INT_TO_INTEGER (error->column), INT_TO_INTEGER (error->position)));
+ list5 (build_string_from_utf8 (error->text),
+ build_string_from_utf8 (error->source),
+ INT_TO_INTEGER (error->line),
+ INT_TO_INTEGER (error->column),
+ INT_TO_INTEGER (error->position)));
}
static void
@@ -612,7 +614,7 @@ usage: (json-serialize OBJECT &rest ARGS) */)
json_out_of_memory ();
record_unwind_protect_ptr (json_free, string);
- return unbind_to (count, build_utf8_string (string));
+ return unbind_to (count, build_string_from_utf8 (string));
}
struct json_buffer_and_size
@@ -819,8 +821,8 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
case JSON_REAL:
return make_float (json_real_value (json));
case JSON_STRING:
- return make_utf8_string (json_string_value (json),
- json_string_length (json));
+ return make_string_from_utf8 (json_string_value (json),
+ json_string_length (json));
case JSON_ARRAY:
{
if (++lisp_eval_depth > max_lisp_eval_depth)
@@ -879,7 +881,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
json_t *value;
json_object_foreach (json, key_str, value)
{
- Lisp_Object key = build_utf8_string (key_str);
+ Lisp_Object key = build_string_from_utf8 (key_str);
EMACS_UINT hash;
ptrdiff_t i = hash_lookup (h, key, &hash);
/* Keys in JSON objects are unique, so the key can't
@@ -896,7 +898,8 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
json_t *value;
json_object_foreach (json, key_str, value)
{
- Lisp_Object key = Fintern (build_utf8_string (key_str), Qnil);
+ Lisp_Object key
+ = Fintern (build_string_from_utf8 (key_str), Qnil);
result
= Fcons (Fcons (key, json_to_lisp (value, conf)),
result);