diff options
| author | Eli Zaretskii | 2019-04-28 17:14:39 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-04-28 17:14:39 +0300 |
| commit | 6b6a6f06b4df9d76ad50294d0b6e88978ffb27d0 (patch) | |
| tree | eb6d3c33d20a57caa9cb2430029249b88b1752fa /src/json.c | |
| parent | 75ee20364c5ed4c175b13debaa53a2ba14168999 (diff) | |
| download | emacs-6b6a6f06b4df9d76ad50294d0b6e88978ffb27d0.tar.gz emacs-6b6a6f06b4df9d76ad50294d0b6e88978ffb27d0.zip | |
Fix names of functions in last commit
* src/coding.h (build_string_from_utf8): Rename from
build_utf8_string. All callers changed.
* src/coding.c (make_string_from_utf8): Rename from
make_utf8_string. All callers changed.
Diffstat (limited to 'src/json.c')
| -rw-r--r-- | src/json.c | 21 |
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) | |||
| 215 | 215 | ||
| 216 | #endif | 216 | #endif |
| 217 | 217 | ||
| 218 | /* Note that all callers of make_utf8_string and build_utf8_string | 218 | /* Note that all callers of make_string_from_utf8 and build_string_from_utf8 |
| 219 | below either pass only value UTF-8 strings or use the functionf for | 219 | below either pass only value UTF-8 strings or use the functionf for |
| 220 | formatting error messages; in the latter case correctness isn't | 220 | formatting error messages; in the latter case correctness isn't |
| 221 | critical. */ | 221 | critical. */ |
| @@ -267,9 +267,11 @@ json_parse_error (const json_error_t *error) | |||
| 267 | symbol = Qjson_parse_error; | 267 | symbol = Qjson_parse_error; |
| 268 | #endif | 268 | #endif |
| 269 | xsignal (symbol, | 269 | xsignal (symbol, |
| 270 | list5 (build_utf8_string (error->text), | 270 | list5 (build_string_from_utf8 (error->text), |
| 271 | build_utf8_string (error->source), INT_TO_INTEGER (error->line), | 271 | build_string_from_utf8 (error->source), |
| 272 | INT_TO_INTEGER (error->column), INT_TO_INTEGER (error->position))); | 272 | INT_TO_INTEGER (error->line), |
| 273 | INT_TO_INTEGER (error->column), | ||
| 274 | INT_TO_INTEGER (error->position))); | ||
| 273 | } | 275 | } |
| 274 | 276 | ||
| 275 | static void | 277 | static void |
| @@ -612,7 +614,7 @@ usage: (json-serialize OBJECT &rest ARGS) */) | |||
| 612 | json_out_of_memory (); | 614 | json_out_of_memory (); |
| 613 | record_unwind_protect_ptr (json_free, string); | 615 | record_unwind_protect_ptr (json_free, string); |
| 614 | 616 | ||
| 615 | return unbind_to (count, build_utf8_string (string)); | 617 | return unbind_to (count, build_string_from_utf8 (string)); |
| 616 | } | 618 | } |
| 617 | 619 | ||
| 618 | struct json_buffer_and_size | 620 | struct json_buffer_and_size |
| @@ -819,8 +821,8 @@ json_to_lisp (json_t *json, struct json_configuration *conf) | |||
| 819 | case JSON_REAL: | 821 | case JSON_REAL: |
| 820 | return make_float (json_real_value (json)); | 822 | return make_float (json_real_value (json)); |
| 821 | case JSON_STRING: | 823 | case JSON_STRING: |
| 822 | return make_utf8_string (json_string_value (json), | 824 | return make_string_from_utf8 (json_string_value (json), |
| 823 | json_string_length (json)); | 825 | json_string_length (json)); |
| 824 | case JSON_ARRAY: | 826 | case JSON_ARRAY: |
| 825 | { | 827 | { |
| 826 | if (++lisp_eval_depth > max_lisp_eval_depth) | 828 | if (++lisp_eval_depth > max_lisp_eval_depth) |
| @@ -879,7 +881,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf) | |||
| 879 | json_t *value; | 881 | json_t *value; |
| 880 | json_object_foreach (json, key_str, value) | 882 | json_object_foreach (json, key_str, value) |
| 881 | { | 883 | { |
| 882 | Lisp_Object key = build_utf8_string (key_str); | 884 | Lisp_Object key = build_string_from_utf8 (key_str); |
| 883 | EMACS_UINT hash; | 885 | EMACS_UINT hash; |
| 884 | ptrdiff_t i = hash_lookup (h, key, &hash); | 886 | ptrdiff_t i = hash_lookup (h, key, &hash); |
| 885 | /* Keys in JSON objects are unique, so the key can't | 887 | /* 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) | |||
| 896 | json_t *value; | 898 | json_t *value; |
| 897 | json_object_foreach (json, key_str, value) | 899 | json_object_foreach (json, key_str, value) |
| 898 | { | 900 | { |
| 899 | Lisp_Object key = Fintern (build_utf8_string (key_str), Qnil); | 901 | Lisp_Object key |
| 902 | = Fintern (build_string_from_utf8 (key_str), Qnil); | ||
| 900 | result | 903 | result |
| 901 | = Fcons (Fcons (key, json_to_lisp (value, conf)), | 904 | = Fcons (Fcons (key, json_to_lisp (value, conf)), |
| 902 | result); | 905 | result); |