Browse Source

duk_ret and duk_idx rename fixes

pull/1/head
Sami Vaarala 11 years ago
parent
commit
b2b03c0743
  1. 12
      src/duk_bi_duk.c
  2. 304
      src/duk_bi_protos.h
  3. 44
      src/duk_bi_string.c

12
src/duk_bi_duk.c

@ -17,7 +17,7 @@
* 'data' buffer might be an issue). Currently only counts and sizes and
* such are given so there should not be a security impact.
*/
duk_ret duk_bi_duk_object_info(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_info(duk_context *ctx) {
duk_tval *tv;
duk_heaphdr *h;
duk_int_t i, n;
@ -112,7 +112,7 @@ duk_ret duk_bi_duk_object_info(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_duk_object_gc(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_gc(duk_context *ctx) {
#ifdef DUK_USE_MARK_AND_SWEEP
duk_hthread *thr = (duk_hthread *) ctx;
int flags;
@ -127,7 +127,7 @@ duk_ret duk_bi_duk_object_gc(duk_context *ctx) {
#endif
}
duk_ret duk_bi_duk_object_fin(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_fin(duk_context *ctx) {
(void) duk_require_hobject(ctx, 0);
if (duk_get_top(ctx) >= 2) {
/* Set: currently a finalizer is disabled by setting it to
@ -147,7 +147,7 @@ duk_ret duk_bi_duk_object_fin(duk_context *ctx) {
}
}
duk_ret duk_bi_duk_object_enc(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_enc(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hstring *h_str;
@ -192,7 +192,7 @@ duk_ret duk_bi_duk_object_enc(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_duk_object_dec(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_dec(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hstring *h_str;
@ -237,7 +237,7 @@ duk_ret duk_bi_duk_object_dec(duk_context *ctx) {
*/
#if 0
duk_ret duk_bi_duk_object_write_log(duk_context *ctx) {
duk_ret_t duk_bi_duk_object_write_log(duk_context *ctx) {
duk_double_t now;
duk_int_t nargs;
duk_int_t logger_level;

304
src/duk_bi_protos.h

@ -5,171 +5,171 @@
#ifndef DUK_BUILTIN_PROTOS_H_INCLUDED
#define DUK_BUILTIN_PROTOS_H_INCLUDED
duk_ret duk_bi_array_constructor(duk_context *ctx);
duk_ret duk_bi_array_constructor_is_array(duk_context *ctx);
duk_ret duk_bi_array_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_array_prototype_concat(duk_context *ctx);
duk_ret duk_bi_array_prototype_join_shared(duk_context *ctx);
duk_ret duk_bi_array_prototype_pop(duk_context *ctx);
duk_ret duk_bi_array_prototype_push(duk_context *ctx);
duk_ret duk_bi_array_prototype_reverse(duk_context *ctx);
duk_ret duk_bi_array_prototype_shift(duk_context *ctx);
duk_ret duk_bi_array_prototype_slice(duk_context *ctx);
duk_ret duk_bi_array_prototype_sort(duk_context *ctx);
duk_ret duk_bi_array_prototype_splice(duk_context *ctx);
duk_ret duk_bi_array_prototype_unshift(duk_context *ctx);
duk_ret duk_bi_array_prototype_indexof_shared(duk_context *ctx);
duk_ret duk_bi_array_prototype_iter_shared(duk_context *ctx);
duk_ret duk_bi_array_prototype_reduce_shared(duk_context *ctx);
duk_ret duk_bi_boolean_constructor(duk_context *ctx);
duk_ret duk_bi_boolean_prototype_tostring_shared(duk_context *ctx);
duk_ret duk_bi_buffer_constructor(duk_context *ctx);
duk_ret duk_bi_buffer_prototype_tostring_shared(duk_context *ctx);
duk_ret duk_bi_date_constructor(duk_context *ctx);
duk_ret duk_bi_date_constructor_parse(duk_context *ctx);
duk_ret duk_bi_date_constructor_utc(duk_context *ctx);
duk_ret duk_bi_date_constructor_now(duk_context *ctx);
duk_ret duk_bi_date_prototype_tostring_shared(duk_context *ctx);
duk_ret duk_bi_date_prototype_value_of(duk_context *ctx);
duk_ret duk_bi_date_prototype_to_json(duk_context *ctx);
duk_ret duk_bi_date_prototype_get_shared(duk_context *ctx);
duk_ret duk_bi_date_prototype_get_time(duk_context *ctx);
duk_ret duk_bi_date_prototype_get_timezone_offset(duk_context *ctx);
duk_ret duk_bi_date_prototype_set_shared(duk_context *ctx);
duk_ret duk_bi_date_prototype_set_time(duk_context *ctx);
duk_ret_t duk_bi_array_constructor(duk_context *ctx);
duk_ret_t duk_bi_array_constructor_is_array(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_concat(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_join_shared(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_pop(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_push(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_reverse(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_shift(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_slice(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_sort(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_splice(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_unshift(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_indexof_shared(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_iter_shared(duk_context *ctx);
duk_ret_t duk_bi_array_prototype_reduce_shared(duk_context *ctx);
duk_ret_t duk_bi_boolean_constructor(duk_context *ctx);
duk_ret_t duk_bi_boolean_prototype_tostring_shared(duk_context *ctx);
duk_ret_t duk_bi_buffer_constructor(duk_context *ctx);
duk_ret_t duk_bi_buffer_prototype_tostring_shared(duk_context *ctx);
duk_ret_t duk_bi_date_constructor(duk_context *ctx);
duk_ret_t duk_bi_date_constructor_parse(duk_context *ctx);
duk_ret_t duk_bi_date_constructor_utc(duk_context *ctx);
duk_ret_t duk_bi_date_constructor_now(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_tostring_shared(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_value_of(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_to_json(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_get_shared(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_get_time(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_get_timezone_offset(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_set_shared(duk_context *ctx);
duk_ret_t duk_bi_date_prototype_set_time(duk_context *ctx);
/* Helper exposed for internal use */
duk_double_t duk_bi_date_get_now(duk_context *ctx);
duk_ret duk_bi_duk_object_info(duk_context *ctx);
duk_ret duk_bi_duk_object_gc(duk_context *ctx);
duk_ret duk_bi_duk_object_fin(duk_context *ctx);
duk_ret duk_bi_duk_object_enc(duk_context *ctx);
duk_ret duk_bi_duk_object_dec(duk_context *ctx);
duk_ret duk_bi_duk_object_jx_dec(duk_context *ctx);
duk_ret duk_bi_duk_object_jx_enc(duk_context *ctx);
duk_ret duk_bi_duk_object_jc_dec(duk_context *ctx);
duk_ret duk_bi_duk_object_jc_enc(duk_context *ctx);
duk_ret duk_bi_error_constructor_shared(duk_context *ctx);
duk_ret duk_bi_error_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_error_prototype_stack_getter(duk_context *ctx);
duk_ret duk_bi_error_prototype_filename_getter(duk_context *ctx);
duk_ret duk_bi_error_prototype_linenumber_getter(duk_context *ctx);
duk_ret duk_bi_error_prototype_stack_getter(duk_context *ctx);
duk_ret duk_bi_error_prototype_nop_setter(duk_context *ctx);
duk_ret duk_bi_function_constructor(duk_context *ctx);
duk_ret duk_bi_function_prototype(duk_context *ctx);
duk_ret duk_bi_function_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_function_prototype_apply(duk_context *ctx);
duk_ret duk_bi_function_prototype_call(duk_context *ctx);
duk_ret duk_bi_function_prototype_bind(duk_context *ctx);
duk_ret duk_bi_global_object_eval(duk_context *ctx);
duk_ret duk_bi_global_object_parse_int(duk_context *ctx);
duk_ret duk_bi_global_object_parse_float(duk_context *ctx);
duk_ret duk_bi_global_object_is_nan(duk_context *ctx);
duk_ret duk_bi_global_object_is_finite(duk_context *ctx);
duk_ret duk_bi_global_object_decode_uri(duk_context *ctx);
duk_ret duk_bi_global_object_decode_uri_component(duk_context *ctx);
duk_ret duk_bi_global_object_encode_uri(duk_context *ctx);
duk_ret duk_bi_global_object_encode_uri_component(duk_context *ctx);
duk_ret_t duk_bi_duk_object_info(duk_context *ctx);
duk_ret_t duk_bi_duk_object_gc(duk_context *ctx);
duk_ret_t duk_bi_duk_object_fin(duk_context *ctx);
duk_ret_t duk_bi_duk_object_enc(duk_context *ctx);
duk_ret_t duk_bi_duk_object_dec(duk_context *ctx);
duk_ret_t duk_bi_duk_object_jx_dec(duk_context *ctx);
duk_ret_t duk_bi_duk_object_jx_enc(duk_context *ctx);
duk_ret_t duk_bi_duk_object_jc_dec(duk_context *ctx);
duk_ret_t duk_bi_duk_object_jc_enc(duk_context *ctx);
duk_ret_t duk_bi_error_constructor_shared(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_stack_getter(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_filename_getter(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_linenumber_getter(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_stack_getter(duk_context *ctx);
duk_ret_t duk_bi_error_prototype_nop_setter(duk_context *ctx);
duk_ret_t duk_bi_function_constructor(duk_context *ctx);
duk_ret_t duk_bi_function_prototype(duk_context *ctx);
duk_ret_t duk_bi_function_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_function_prototype_apply(duk_context *ctx);
duk_ret_t duk_bi_function_prototype_call(duk_context *ctx);
duk_ret_t duk_bi_function_prototype_bind(duk_context *ctx);
duk_ret_t duk_bi_global_object_eval(duk_context *ctx);
duk_ret_t duk_bi_global_object_parse_int(duk_context *ctx);
duk_ret_t duk_bi_global_object_parse_float(duk_context *ctx);
duk_ret_t duk_bi_global_object_is_nan(duk_context *ctx);
duk_ret_t duk_bi_global_object_is_finite(duk_context *ctx);
duk_ret_t duk_bi_global_object_decode_uri(duk_context *ctx);
duk_ret_t duk_bi_global_object_decode_uri_component(duk_context *ctx);
duk_ret_t duk_bi_global_object_encode_uri(duk_context *ctx);
duk_ret_t duk_bi_global_object_encode_uri_component(duk_context *ctx);
#ifdef DUK_USE_SECTION_B
duk_ret duk_bi_global_object_escape(duk_context *ctx);
duk_ret duk_bi_global_object_unescape(duk_context *ctx);
duk_ret_t duk_bi_global_object_escape(duk_context *ctx);
duk_ret_t duk_bi_global_object_unescape(duk_context *ctx);
#endif
#ifdef DUK_USE_BROWSER_LIKE
duk_ret duk_bi_global_object_print(duk_context *ctx);
duk_ret duk_bi_global_object_alert(duk_context *ctx);
duk_ret_t duk_bi_global_object_print(duk_context *ctx);
duk_ret_t duk_bi_global_object_alert(duk_context *ctx);
#endif
/* FIXME: typing */
void duk_bi_json_parse_helper(duk_context *ctx,
int idx_value,
int idx_reviver,
int flags);
int idx_value,
int idx_reviver,
int flags);
void duk_bi_json_stringify_helper(duk_context *ctx,
int idx_value,
int idx_replacer,
int idx_space,
int flags);
duk_ret duk_bi_json_object_parse(duk_context *ctx);
duk_ret duk_bi_json_object_stringify(duk_context *ctx);
duk_ret duk_bi_math_object_onearg_shared(duk_context *ctx);
duk_ret duk_bi_math_object_twoarg_shared(duk_context *ctx);
duk_ret duk_bi_math_object_max(duk_context *ctx);
duk_ret duk_bi_math_object_min(duk_context *ctx);
duk_ret duk_bi_math_object_random(duk_context *ctx);
duk_ret duk_bi_number_constructor(duk_context *ctx);
duk_ret duk_bi_number_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_number_prototype_to_locale_string(duk_context *ctx);
duk_ret duk_bi_number_prototype_value_of(duk_context *ctx);
duk_ret duk_bi_number_prototype_to_fixed(duk_context *ctx);
duk_ret duk_bi_number_prototype_to_exponential(duk_context *ctx);
duk_ret duk_bi_number_prototype_to_precision(duk_context *ctx);
duk_ret duk_bi_object_constructor(duk_context *ctx);
duk_ret duk_bi_object_constructor_get_prototype_of(duk_context *ctx);
duk_ret duk_bi_object_constructor_get_own_property_descriptor(duk_context *ctx);
duk_ret duk_bi_object_constructor_get_own_property_names(duk_context *ctx);
duk_ret duk_bi_object_constructor_create(duk_context *ctx);
duk_ret duk_bi_object_constructor_define_property(duk_context *ctx);
duk_ret duk_bi_object_constructor_define_properties(duk_context *ctx);
duk_ret duk_bi_object_constructor_seal(duk_context *ctx);
duk_ret duk_bi_object_constructor_freeze(duk_context *ctx);
duk_ret duk_bi_object_constructor_prevent_extensions(duk_context *ctx);
duk_ret duk_bi_object_constructor_is_sealed(duk_context *ctx);
duk_ret duk_bi_object_constructor_is_frozen(duk_context *ctx);
duk_ret duk_bi_object_constructor_is_extensible(duk_context *ctx);
duk_ret duk_bi_object_constructor_keys(duk_context *ctx);
duk_ret duk_bi_object_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_object_prototype_to_locale_string(duk_context *ctx);
duk_ret duk_bi_object_prototype_value_of(duk_context *ctx);
duk_ret duk_bi_object_prototype_has_own_property(duk_context *ctx);
duk_ret duk_bi_object_prototype_is_prototype_of(duk_context *ctx);
duk_ret duk_bi_object_prototype_property_is_enumerable(duk_context *ctx);
duk_ret duk_bi_pointer_constructor(duk_context *ctx);
duk_ret duk_bi_pointer_prototype_tostring_shared(duk_context *ctx);
duk_ret duk_bi_regexp_constructor(duk_context *ctx);
duk_ret duk_bi_regexp_prototype_exec(duk_context *ctx);
duk_ret duk_bi_regexp_prototype_test(duk_context *ctx);
duk_ret duk_bi_regexp_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_string_constructor(duk_context *ctx);
duk_ret duk_bi_string_constructor_from_char_code(duk_context *ctx);
duk_ret duk_bi_string_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_string_prototype_value_of(duk_context *ctx);
duk_ret duk_bi_string_prototype_char_at(duk_context *ctx);
duk_ret duk_bi_string_prototype_char_code_at(duk_context *ctx);
duk_ret duk_bi_string_prototype_concat(duk_context *ctx);
duk_ret duk_bi_string_prototype_indexof_shared(duk_context *ctx);
duk_ret duk_bi_string_prototype_locale_compare(duk_context *ctx);
duk_ret duk_bi_string_prototype_match(duk_context *ctx);
duk_ret duk_bi_string_prototype_replace(duk_context *ctx);
duk_ret duk_bi_string_prototype_search(duk_context *ctx);
duk_ret duk_bi_string_prototype_slice(duk_context *ctx);
duk_ret duk_bi_string_prototype_split(duk_context *ctx);
duk_ret duk_bi_string_prototype_substring(duk_context *ctx);
duk_ret duk_bi_string_prototype_caseconv_shared(duk_context *ctx);
duk_ret duk_bi_string_prototype_trim(duk_context *ctx);
int idx_value,
int idx_replacer,
int idx_space,
int flags);
duk_ret_t duk_bi_json_object_parse(duk_context *ctx);
duk_ret_t duk_bi_json_object_stringify(duk_context *ctx);
duk_ret_t duk_bi_math_object_onearg_shared(duk_context *ctx);
duk_ret_t duk_bi_math_object_twoarg_shared(duk_context *ctx);
duk_ret_t duk_bi_math_object_max(duk_context *ctx);
duk_ret_t duk_bi_math_object_min(duk_context *ctx);
duk_ret_t duk_bi_math_object_random(duk_context *ctx);
duk_ret_t duk_bi_number_constructor(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_to_locale_string(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_value_of(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_to_fixed(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_to_exponential(duk_context *ctx);
duk_ret_t duk_bi_number_prototype_to_precision(duk_context *ctx);
duk_ret_t duk_bi_object_constructor(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_get_prototype_of(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_get_own_property_descriptor(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_get_own_property_names(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_create(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_define_property(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_define_properties(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_seal(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_freeze(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_prevent_extensions(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_is_sealed(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_is_frozen(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_is_extensible(duk_context *ctx);
duk_ret_t duk_bi_object_constructor_keys(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_to_locale_string(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_value_of(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_has_own_property(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_is_prototype_of(duk_context *ctx);
duk_ret_t duk_bi_object_prototype_property_is_enumerable(duk_context *ctx);
duk_ret_t duk_bi_pointer_constructor(duk_context *ctx);
duk_ret_t duk_bi_pointer_prototype_tostring_shared(duk_context *ctx);
duk_ret_t duk_bi_regexp_constructor(duk_context *ctx);
duk_ret_t duk_bi_regexp_prototype_exec(duk_context *ctx);
duk_ret_t duk_bi_regexp_prototype_test(duk_context *ctx);
duk_ret_t duk_bi_regexp_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_string_constructor(duk_context *ctx);
duk_ret_t duk_bi_string_constructor_from_char_code(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_value_of(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_char_at(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_char_code_at(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_concat(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_indexof_shared(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_locale_compare(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_match(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_replace(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_search(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_slice(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_split(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_substring(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_caseconv_shared(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_trim(duk_context *ctx);
#ifdef DUK_USE_SECTION_B
duk_ret duk_bi_string_prototype_substr(duk_context *ctx);
duk_ret_t duk_bi_string_prototype_substr(duk_context *ctx);
#endif
duk_ret duk_bi_thread_constructor(duk_context *ctx);
duk_ret duk_bi_thread_resume(duk_context *ctx);
duk_ret duk_bi_thread_yield(duk_context *ctx);
duk_ret duk_bi_thread_current(duk_context *ctx);
duk_ret duk_bi_thread_prototype_to_string(duk_context *ctx);
duk_ret duk_bi_thread_prototype_value_of(duk_context *ctx);
duk_ret duk_bi_type_error_thrower(duk_context *ctx);
duk_ret_t duk_bi_thread_constructor(duk_context *ctx);
duk_ret_t duk_bi_thread_resume(duk_context *ctx);
duk_ret_t duk_bi_thread_yield(duk_context *ctx);
duk_ret_t duk_bi_thread_current(duk_context *ctx);
duk_ret_t duk_bi_thread_prototype_to_string(duk_context *ctx);
duk_ret_t duk_bi_thread_prototype_value_of(duk_context *ctx);
duk_ret_t duk_bi_type_error_thrower(duk_context *ctx);
#endif /* DUK_BUILTIN_PROTOS_H_INCLUDED */

44
src/duk_bi_string.c

@ -12,7 +12,7 @@
* Constructor
*/
duk_ret duk_bi_string_constructor(duk_context *ctx) {
duk_ret_t duk_bi_string_constructor(duk_context *ctx) {
/* String constructor needs to distinguish between an argument not given at all
* vs. given as 'undefined'. We're a vararg function to handle this properly.
*/
@ -41,10 +41,10 @@ duk_ret duk_bi_string_constructor(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_string_constructor_from_char_code(duk_context *ctx) {
duk_ret_t duk_bi_string_constructor_from_char_code(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hbuffer_dynamic *h;
duk_idx i, n;
duk_idx_t i, n;
duk_ucodepoint_t cp;
/* XXX: It would be nice to build the string directly but ToUint16()
@ -70,7 +70,7 @@ duk_ret duk_bi_string_constructor_from_char_code(duk_context *ctx) {
* toString(), valueOf()
*/
duk_ret duk_bi_string_prototype_to_string(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_to_string(duk_context *ctx) {
duk_tval *tv;
duk_push_this(ctx);
@ -109,7 +109,7 @@ duk_ret duk_bi_string_prototype_to_string(duk_context *ctx) {
/* FIXME: charAt() and charCodeAt() could probably use a shared helper. */
duk_ret duk_bi_string_prototype_char_at(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_char_at(duk_context *ctx) {
duk_int_t pos; /* FIXME: type, duk_to_int() needs to be fixed */
/* FIXME: faster implementation */
@ -123,7 +123,7 @@ duk_ret duk_bi_string_prototype_char_at(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_string_prototype_char_code_at(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_char_code_at(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_int_t pos; /* FIXME: type, duk_to_int() needs to be fixed */
duk_uint32_t boff;
@ -170,7 +170,7 @@ duk_ret duk_bi_string_prototype_char_code_at(duk_context *ctx) {
/* FIXME: any chance of merging these three similar algorithms? */
duk_ret duk_bi_string_prototype_substring(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_substring(duk_context *ctx) {
duk_hstring *h;
duk_int_t start_pos, end_pos;
duk_int_t len;
@ -203,7 +203,7 @@ duk_ret duk_bi_string_prototype_substring(duk_context *ctx) {
}
#ifdef DUK_USE_SECTION_B
duk_ret duk_bi_string_prototype_substr(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_substr(duk_context *ctx) {
duk_hstring *h;
duk_int_t start_pos, end_pos;
duk_int_t len;
@ -246,13 +246,13 @@ duk_ret duk_bi_string_prototype_substr(duk_context *ctx) {
return 1;
}
#else /* DUK_USE_SECTION_B */
duk_ret duk_bi_string_prototype_substr(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_substr(duk_context *ctx) {
DUK_UNREF(ctx);
return DUK_RET_UNSUPPORTED_ERROR;
}
#endif /* DUK_USE_SECTION_B */
duk_ret duk_bi_string_prototype_slice(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_slice(duk_context *ctx) {
duk_hstring *h;
duk_int_t start_pos, end_pos;
duk_int_t len;
@ -292,7 +292,7 @@ duk_ret duk_bi_string_prototype_slice(duk_context *ctx) {
* Case conversion
*/
duk_ret duk_bi_string_prototype_caseconv_shared(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_caseconv_shared(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_small_int_t uppercase = duk_get_magic(ctx);
@ -305,7 +305,7 @@ duk_ret duk_bi_string_prototype_caseconv_shared(duk_context *ctx) {
* indexOf() and lastIndexOf()
*/
duk_ret duk_bi_string_prototype_indexof_shared(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_indexof_shared(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hstring *h_this;
duk_hstring *h_search;
@ -416,7 +416,7 @@ duk_ret duk_bi_string_prototype_indexof_shared(duk_context *ctx) {
* - API call to get_prop and to_boolean
*/
duk_ret duk_bi_string_prototype_replace(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_replace(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hstring *h_input;
duk_hstring *h_repl;
@ -618,7 +618,7 @@ duk_ret duk_bi_string_prototype_replace(duk_context *ctx) {
prev_match_end_boff = match_start_boff + DUK_HSTRING_GET_BYTELEN(h_match);
if (is_repl_func) {
duk_idx idx_args;
duk_idx_t idx_args;
duk_hstring *h_repl;
/* regexp res_obj is at index 4 */
@ -1078,7 +1078,7 @@ int duk_bi_string_prototype_split(duk_context *ctx) {
*/
#ifdef DUK_USE_REGEXP_SUPPORT
static void to_regexp_helper(duk_context *ctx, duk_idx index, int force_new) {
static void to_regexp_helper(duk_context *ctx, duk_idx_t index, int force_new) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hobject *h;
@ -1105,7 +1105,7 @@ static void to_regexp_helper(duk_context *ctx, duk_idx index, int force_new) {
#endif /* DUK_USE_REGEXP_SUPPORT */
#ifdef DUK_USE_REGEXP_SUPPORT
duk_ret duk_bi_string_prototype_search(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_search(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
/* Easiest way to implement the search required by the specification
@ -1144,14 +1144,14 @@ duk_ret duk_bi_string_prototype_search(duk_context *ctx) {
return 1;
}
#else /* DUK_USE_REGEXP_SUPPORT */
duk_ret duk_bi_string_prototype_search(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_search(duk_context *ctx) {
DUK_UNREF(ctx);
return DUK_RET_UNSUPPORTED_ERROR;
}
#endif /* DUK_USE_REGEXP_SUPPORT */
#ifdef DUK_USE_REGEXP_SUPPORT
duk_ret duk_bi_string_prototype_match(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_match(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_small_int_t global;
duk_int_t prev_last_index;
@ -1226,13 +1226,13 @@ duk_ret duk_bi_string_prototype_match(duk_context *ctx) {
return 1; /* return 'res_arr' or 'null' */
}
#else /* DUK_USE_REGEXP_SUPPORT */
duk_ret duk_bi_string_prototype_match(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_match(duk_context *ctx) {
DUK_UNREF(ctx);
return DUK_RET_UNSUPPORTED_ERROR;
}
#endif /* DUK_USE_REGEXP_SUPPORT */
duk_ret duk_bi_string_prototype_concat(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_concat(duk_context *ctx) {
/* duk_concat() coerces arguments with ToString() in correct order */
(void) duk_push_this_coercible_to_string(ctx);
duk_insert(ctx, 0); /* this is relatively expensive */
@ -1240,7 +1240,7 @@ duk_ret duk_bi_string_prototype_concat(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_string_prototype_trim(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_trim(duk_context *ctx) {
DUK_ASSERT_TOP(ctx, 0);
(void) duk_push_this_coercible_to_string(ctx);
duk_trim(ctx, 0);
@ -1248,7 +1248,7 @@ duk_ret duk_bi_string_prototype_trim(duk_context *ctx) {
return 1;
}
duk_ret duk_bi_string_prototype_locale_compare(duk_context *ctx) {
duk_ret_t duk_bi_string_prototype_locale_compare(duk_context *ctx) {
duk_hstring *h1;
duk_hstring *h2;
duk_size_t h1_len, h2_len, prefix_len;

Loading…
Cancel
Save