summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
AgeCommit message (Collapse)Author
2019-03-26Fix missing `MRB_API` prefix for functions below; clse #4267Yukihiro "Matz" Matsumoto
Functions to add prototypes to headers: * mrb_ary_splice() * mrb_notimplement() * mrb_vformat() * mrb_cstr_to_dbl() * mrb_cstr_to_inum() Functions to be made `static` (`MRB_API` was not needed): * mrb_mod_module_function() * mrb_obj_hash() * mrb_str_len_to_inum() Functions to remove `MRB_API` from definitions (referenced from within `libmruby`): * mrb_mod_cv_defined() * mrb_mod_cv_get() * mrb_f_send()
2019-03-25Use uppercase version of `ctype` macros e.g. `ISSPACE`; fix #4338Yukihiro "Matz" Matsumoto
2019-02-06Reduce invocation of `mrb_convert_type()` from `mrb_str_to_str()`.Yukihiro "Matz" Matsumoto
2019-02-05Fix markup and remove unneeded comment for doc in `src/string.c` [ci skip]KOBAYASHI Shuji
2019-02-04Fix `Symbol#size` for multi-byte characters with `MRB_UTF8_STRING`KOBAYASHI Shuji
Before: p :あ.size #=> 3 After: p :あ.size #=> 1
2019-01-29Remove unused macro in `src/string.c`KOBAYASHI Shuji
2018-12-17Recover `String#to_str`; ref #4177Yukihiro "Matz" Matsumoto
We have removed implicit conversion to strings using `to_str`. But some people still using `to_str` as a typical string method, i.e. they do string check by code like: `obj.respond_to?(:to_str)`. So we have recovered the method.
2018-11-19Call `mrb_str_to_str` from `mrb_string_value_ptr` for compatibility.Yukihiro "Matz" Matsumoto
2018-11-19Use type checking `mrb_to_str` instead of converting `mrb_str_to_str`.Yukihiro "Matz" Matsumoto
2018-11-19Remove implicit conversion using `to_str` method; fix #3854Yukihiro "Matz" Matsumoto
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
2018-06-28Use `mrb_raise()` instead of `mrb_raisef()`; ref #4062Yukihiro "Matz" Matsumoto
2018-06-27Add negative check in `mrb_str_resize`; fix #4062Yukihiro "Matz" Matsumoto
2018-05-02Need to call `mrb_str_modify()` in `mrb_str_cat_str()`; fix #4018Yukihiro "Matz" Matsumoto
If `str` and `str2` are the same string object `str->ptr` may be rewritten by `mrb_str_modify()`.
2018-04-28Fix broken support of `MRB_WITHOUT_FLOAT`; fix #4015Yukihiro "Matz" Matsumoto
2018-04-17Fallback to float when caompiled binary with 64bit compiler.Takeshi Watanabe
closes #3997.
2018-03-24Return nil if type differ in `String#<=>`.Takeshi Watanabe
2018-02-12`String#inspect` to use hexadecimal, not octal to print unprintable.Yukihiro "Matz" Matsumoto
2017-12-23Make source compilable with C++17Lothar Scholz
Changes applied: - Removing "register" keyword - Fixing const pointer to pointer assignments - Adding type casts to rb_malloc calls
2017-12-12Modifying frozen objects will raise `FrozenError`.Yukihiro "Matz" Matsumoto
`FrozenError` is a subclass of `RuntimeError` which used to be raised. [Ruby2.5]
2017-11-08Should allocate memory region before updating `len`; fix #3842Yukihiro "Matz" Matsumoto
Otherwise half-baked string object will be allocated.
2017-11-04Merge branch 'master' of github.com:mruby/mrubyYAMAMOTO Masaya
2017-11-03Should not use `FSHARED` state for string from `irep` pools; fix #3829Yukihiro "Matz" Matsumoto
This strings in `irep` pools may be freed forcefully in `mrb_irep_free`. This commit probably fixes #3817 as well.
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-10-01Add new type of shared string: `RSTR_FSHARED`.Yukihiro "Matz" Matsumoto
`RSTR_FSHARED` use frozen strings as shared body instead of `struct mrb_shared_string`. This reduces allocation from literal strings.
2017-09-27fix: src\string.c(2219): warning C4244: 'function': conversion from ↵Tomasz Dąbrowski
'mrb_int' to 'int', possible loss of data
2017-09-27fix: src\string.c(1924): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\string.c(1130): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\string.c(497): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'long', possible loss of data
2017-09-27fix: src\hash.c(27): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'khint_t', possible loss of data
2017-08-22`strlen` returns `size_t`; need to cast before assigning to `int`.Yukihiro "Matz" Matsumoto
2017-08-22(Try to) fix mixture of `int` and `size_t` in UTF-8 conversion.Yukihiro "Matz" Matsumoto
This only effects VC.
2017-08-18`mrb_str_cat`: `capa` should not be zero to avoid infinite loops.Yukihiro "Matz" Matsumoto
2017-08-18`mrb_str_cat`: `capa` should be bigger than `total`.Yukihiro "Matz" Matsumoto
2017-08-18`ARY_CAPA` handles capacity for embedded arrays by itself.Yukihiro "Matz" Matsumoto
2017-08-18Separate `mrb_str_buf_new` and `mrb_str_new_capa`.Yukihiro "Matz" Matsumoto
`mrb_str_buf_new` is an old function that ensures capacity size of `MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use `mrb_str_new_capa` instead.
2017-08-18Remove code duplication in `mrb_str_concat`.Yukihiro "Matz" Matsumoto
2017-08-18Merge `str_buf_cat` and `mrb_str_cat`.Yukihiro "Matz" Matsumoto
2017-08-11Silence integer type conversion warnings.Yukihiro "Matz" Matsumoto
2017-08-09Replaced tabs with spacesChristopher Aue
2017-07-28Added mrb_str_index to the mrb APIChristopher Aue
2017-07-12Use "$!" specifier of `mrb_get_args`.Yukihiro "Matz" Matsumoto
2017-07-05Avoid undefined behavior of signed integer overflow; fix #3728Yukihiro "Matz" Matsumoto
2017-05-13Make string embad from sharedksss
2017-05-05Adjust to the optimum typeksss
2017-04-06Make String#replace to check equality before modifying flags.Yukihiro "Matz" Matsumoto
ref #3588
2017-04-03Unify `else` clause styleYukihiro "Matz" Matsumoto
2017-04-03String#initialize to make a string empty; ref #3574Yukihiro "Matz" Matsumoto
2017-03-05String#index shouldn't return nil when "".index ""ksss
2017-02-28Fix integer overflow; fix #3473Yukihiro "Matz" Matsumoto
The fix is suggested by https://hackerone.com/lucnguyen
2017-02-28Add type check by mrb_get_args(); ref #3476Yukihiro "Matz" Matsumoto