Commit Graph

298 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 1a45447b8b add String#freeze to the core 2015-08-27 17:54:30 +09:00
Yukihiro "Matz" Matsumoto 5cfc0d0dc0 Merge pull request #2877 from cremno/fix-dangling-ptr
Coverity: fix dangling pointer
2015-07-07 07:40:38 +09:00
Anton Davydov 03ae38df4e Fix typo in comment in String#mrb_cstr_to_inum [skip ci] 2015-07-05 13:53:14 +03:00
cremno 7206a8c4f9 fix dangling pointer
CID 75872 (#3-2 of 3): Pointer to local outside scope (RETURN_LOCAL)
38. use_invalid: Using p, which points to an out-of-scope variable buf.
2015-07-03 02:48:22 +02:00
Franck Verrot 2588507285 Remove unnecessary backticks.
Dr Markus Kuhn published in 1999 an article [1] explaining in details
why we shouldn't use the ASCII grave accent (0x60) as a left quotation.

Backticks have been used most notably to produce nice-looking LaTeX
documents but it doesn't seem to be an issue on modern platforms and
for the oldest ones, there are workarounds as mentioned by Dr Kuhn.

[1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2015-06-24 13:07:07 +02:00
Jared Breeden 9ad632559e *Correctly* removing extra mrb_str_to_str call 2015-06-22 20:49:09 -07:00
Jared Breeden cfcca2a727 Reverting overzealous changes 2015-06-22 19:49:12 -07:00
Jared Breeden 9553e20d34 Removing redundant mrb_str_to_str call 2015-06-22 19:07:25 -07:00
Jared Breeden 338ca305ae Calling mrb_str_to_str in mrb_string_value_cstr. Fixes #2847 2015-06-22 18:37:14 -07:00
Yukihiro "Matz" Matsumoto a219e8b717 Merge pull request #2839 from yui-knk/fix/string_split_sample
[ci skip] Remove some Srting#split samples
2015-06-19 23:53:49 +09:00
yui-knk d1e6d647bd [ci skip] Remove some Srting#split samples
mruby not support regexp, so remove these samples.
2015-06-19 20:34:32 +09:00
cremno 2ee84eb3df remove unnecessary including of <ctype.h>
Not needed anymore since 85075bef75
2015-05-28 10:44:20 +02:00
Tomoyuki Sahara 4308f3c686 remove an always-true conditional. 2015-05-21 11:50:02 +09:00
Tomoyuki Sahara 64ab781266 RSTRING_PTR may be changed in while loop. 2015-05-20 10:15:19 +09:00
Tatsuhiko Kubo 093560e7d1 Use suitable type. 2014-12-27 10:18:18 +09:00
Yukihiro "Matz" Matsumoto 2732879f3e String#[]: float handling merged to #2677 2014-12-17 20:19:52 +09:00
Yukihiro "Matz" Matsumoto 4319eaaa45 try to convert not only nil but every objects to fixnums; ref #2677 2014-12-17 20:08:26 +09:00
h2so5 05b00a14c5 String#[] should reject nil index 2014-12-17 14:01:39 +09:00
Yukihiro "Matz" Matsumoto a19a6edb7c mrb_str_new(mrb, "", len) creates an unmodifiable string object; ref #2674 2014-12-17 08:06:44 +09:00
Yukihiro "Matz" Matsumoto e1a7fa925e add "fall through" comment 2014-11-26 01:03:57 +09:00
Robert Mosolgo 0133d9ac70 fix(String) String#[] accepts float; close #2650 #2651 2014-11-26 01:03:38 +09:00
Hiroyuki Matsuzaki e77ea4e5f2 fixed. cygwin-gcc(ver4.8.3) warning in conv_digit() 2014-10-02 19:50:58 +09:00
Yukihiro "Matz" Matsumoto b72e94fa6b mrbconf.h option MRB_USE_ETEXT_EDATA to reduce memory.
on platforms with _etext and _edata, mruby can distinguish string literals so that it avoids memory allocation to copy them.
for example, on my Linux box (x86 32bit), memory consumed by mrbtest decreased from 8,168,203 to 8,078,848 (reduced 88KB).
2014-09-30 23:48:57 +09:00
Tatsuhiko Kubo cfb321e877 Add inline to str_with_class(). 2014-09-09 00:44:49 +09:00
cremno 26bbc81e12 get rid of shadowing variables
Mostly by renaming the shadowing variable.
If a shadowing variable was deleted,
the shadowed one can be used instead.
2014-09-03 10:00:37 +02:00
Tatsuhiko Kubo 6b8e06a5b9 Remove unused macro.
OutOfRange() is no longer used.
2014-08-29 02:22:55 +09:00
Yukihiro "Matz" Matsumoto 9e4b012478 Merge pull request #2570 from cubicdaiya/issues/unify_duplicated_functions
Unify and rename duplicated functions (noregexp() and regexp_check()).
2014-08-29 01:09:33 +09:00
Tatsuhiko Kubo 5fa30aeaea Fix mismatches for MRB_API declarations. 2014-08-29 01:06:22 +09:00
Tatsuhiko Kubo db29a25ada Rename functions for avoinding symbol confiliction.
Add prefix(mrb) to noregexp() and regexp_check().
2014-08-28 19:18:52 +09:00
Tatsuhiko Kubo d958aa2cb1 Unify duplicated functions (noregexp() and regexp_check()). 2014-08-28 19:13:57 +09:00
Tatsuhiko Kubo 3202938099 Add a missing space after ",". 2014-08-27 19:13:40 +09:00
kkkkkt b27738f036 changed some string method's mrb-aspec 2014-08-12 16:20:02 +09:00
Tomoyuki Sahara c4f5c2473a mrb_str_bytesize is a carbon copy of mrb_str_size. remove it.
mruby core does not support any character encodings but ASCII.
2014-08-11 17:46:40 +09:00
kkkkkt 513be0052e changed mrb_str_size and mrb_str_bytesize comments. 2014-08-11 12:02:31 +09:00
Tomoyuki Sahara 412b9eb827 revert accidental constify. 2014-08-05 15:02:27 +09:00
cremno 7dabb33cf0 change linkage of mrb_str_size to internal
Use RSTRING_LEN to get the length.
2014-08-04 01:14:23 +02:00
Yukihiro "Matz" Matsumoto 206f89e209 add MRB_API modifiers to mruby API functions 2014-08-04 00:47:08 +09:00
Tatsuhiko Kubo 5b5313ec97 use C style comments instead of C++ style comments 2014-07-13 00:24:45 +09:00
cremno 881f054cbf remove unused mrb_str_body 2014-07-09 11:56:29 +02:00
Yukihiro "Matz" Matsumoto 8459b39886 update String#slice doc 2014-06-18 15:56:34 +09:00
Jun Hiroe eab4a7492f Unsupported Regex in mrb_str_aref_m() 2014-06-15 21:21:20 +09:00
Yukihiro "Matz" Matsumoto be3e36cb05 Merge pull request #2389 from ksss/str-mem-leaks
Fix memory leaks in String
2014-06-12 07:36:36 +09:00
ksss bd53818999 str_replace: self should not be shared and nofree 2014-06-11 14:42:18 +00:00
Jun Hiroe 75d1412410 Refactor how to use RSTR_NOFREE_P macro 2014-06-11 23:10:41 +09:00
Jun Hiroe 9c259c501a Add NOFREE macros 2014-06-11 01:00:35 +09:00
take_cheeze 64994a1764 Check RSTRING_EMBED_LEN_MAX with static assert. 2014-06-08 23:16:55 +09:00
Yukihiro "Matz" Matsumoto 6459a98448 move String#clear to mruby-string-ext; ref #2370 2014-06-07 22:28:42 +09:00
Yukihiro "Matz" Matsumoto 32e450166f move STR_* macros to mruby/string.h with renaming 2014-06-07 22:16:16 +09:00
Yukihiro "Matz" Matsumoto b0c90141d9 clear shared and nofree flags; ref #2370 2014-06-07 17:24:18 +09:00
Yukihiro "Matz" Matsumoto 20dc629b11 inline str_discard(); ref #2370 2014-06-07 16:51:40 +09:00