Commit Graph

165 Commits

Author SHA1 Message Date
Jun Hiroe 39b78ee48c Replace 0 with '\0' as nul terminated string. 2013-07-11 01:08:40 +09:00
Masaki Muranaka e4ae05ed9b Cleanup mrb_str_resize(). 2013-06-21 16:06:35 +09:00
cubicdaiya 967c9cff2b make mrb_str_new_cstr DRY
Using str_new eliminates duplicated codes in mrb_str_new_cstr.
2013-06-21 09:53:10 +09:00
kimu_shu e720782f81 Add MRB_WORD_BOXING mode (represent mrb_value as a word) 2013-05-26 10:09:17 +09:00
Yukihiro "Matz" Matsumoto 8890a992a6 always use unsigned int as mrb_bool even in C++ 2013-04-29 09:23:43 +09:00
Yukihiro "Matz" Matsumoto a1df3fdb0c fix mrb_string_shared memory leaks 2013-04-29 07:47:12 +09:00
Yukihiro "Matz" Matsumoto 5077f9ec8b move mrb_shared_string definition to src/string.c 2013-04-29 07:24:55 +09:00
Yukihiro "Matz" Matsumoto 5c68195c88 mrb_str_new_static(): zero copy string creation 2013-04-28 02:47:22 +09:00
Yukihiro "Matz" Matsumoto fa0e41a84d remove unnecessary local variable 2013-04-25 18:25:06 +09:00
Masaki Muranaka 6684b7d1cf Remove sprintf(). 2013-04-25 15:36:19 +09:00
Yukihiro "Matz" Matsumoto 8464cac63c remove calling sprintf(); ref #1210 2013-04-25 15:00:09 +09:00
Tomoyuki Sahara b1114489ef a string may have a lot of non-printable chars. 2013-04-25 12:14:18 +09:00
Yukihiro "Matz" Matsumoto 30d580ecbc rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206 2013-04-25 09:47:36 +09:00
Masaki Muranaka 49d945bb59 Use memcmp instead of strcmp if it is possible. 2013-04-21 01:17:17 +09:00
Masaki Muranaka bd7cf9ba0d Remove a comment. 2013-04-21 01:17:17 +09:00
Masaki Muranaka 2613e5d955 Clean up variable types and type casts. 2013-04-21 01:17:17 +09:00
Yukihiro "Matz" Matsumoto c79172dfd5 put spaces after if/while 2013-04-20 23:11:43 +09:00
h2so5 b9674c735e Make str_modify public 2013-04-19 08:06:04 +09:00
h2so5 a4d59b4ceb Refactor mrb_str_dump 2013-04-10 23:32:51 +09:00
Yukihiro "Matz" Matsumoto 492688eecd factor out redundant Regexp check into functions 2013-04-05 04:41:17 +09:00
Masaki Muranaka c260ef894e Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consistency. 2013-03-29 22:19:26 +09:00
Masaki Muranaka 05ad6902fd Remove API mrb_string_value(). There have mrb_str_to_str() in the core. And mrb_string_value() is no merit to keep using. 2013-03-29 18:01:25 +09:00
Masaki Muranaka 74f04849c4 Rearrange SIZE_MAX. It is supported also VC++ since its version10. And there seems SIZE_MAX is defined in stdint.h. And it possibly (depends on the version of VC++) conflicts with SIZE_MAX in limits.h. This patch is no need if I did not support VC++. 2013-03-29 11:02:35 +09:00
Masaki Muranaka 2b5b161f8b Sort include files. Some redundant includes are removed. 2013-03-29 10:22:31 +09:00
Yukihiro Matz Matsumoto 18b2683b97 use new mrb_format API from mrb_raisef; its only format specifier is "%S" (stringify) and takes mrb_value; close #1062 2013-03-27 23:41:23 +09:00
Masaki Muranaka fd49ae0a84 Preprocessor # should be the top of line. 2013-03-26 15:14:01 +09:00
Masaki Muranaka eafd5f647a Remove unused macros. 2013-03-26 15:13:20 +09:00
MATSUMOTO Ryosuke 7328b68b9f Adjusted indent, space and tab 2013-03-24 11:35:42 +09:00
Yukihiro Matz Matsumoto 0940e4d462 rename mrb_ptr_as_string() to mrb_ptr_to_str() 2013-03-23 21:57:33 +09:00
Yukihiro Matz Matsumoto d8f48e9782 Merge branch 'pr-add-mrb_ptr_as_string' of https://github.com/monaka/mruby into monaka-pr-add-mrb_ptr_as_string 2013-03-23 21:53:49 +09:00
Masaki Muranaka d5b135a1e7 Remove _obj_classname() as unused. 2013-03-23 20:22:16 +09:00
Masaki Muranaka 9268636331 Use mrb_obj_classname() instead of _obj_classname(). They are complietely same. 2013-03-23 20:21:50 +09:00
Masaki Muranaka bbb367841a Add new API mrb_ptr_as_string(). 2013-03-23 20:00:04 +09:00
Masaki Muranaka 0cedf8fa02 Rename API mrb_str_cat2() to mrb_str_cat_cstr(). This is for naming orthogonality. mrb_str_cat2() is also left for backward compatibility. 2013-03-23 16:29:30 +09:00
Masaki Muranaka f8fa56d8c3 Use mrb_intern2() instead of mrb_intern(). This is for avoiding overhead by strlen(). 2013-03-22 14:22:45 +09:00
Yukihiro Matz Matsumoto d0d920e909 rename mrb_true_or_false_value() to mrb_bool_value() 2013-03-19 12:03:54 +09:00
Masaki Muranaka 68652da6f6 Use mrb_true_or_false_value() / in mrb_str_include(). 2013-03-19 11:04:23 +09:00
Masaki Muranaka 02a6334d0d Use mrb_true_or_false_value() / in mrb_str_eql(). 2013-03-19 11:04:23 +09:00
Masaki Muranaka 055cad0739 Use mrb_true_or_false_value() / in mrb_str_empty_p(). 2013-03-19 11:04:23 +09:00
Masaki Muranaka be5e5fd75e Use mrb_true_or_false_value() / in mrb_str_equal_m(). 2013-03-19 11:04:23 +09:00
Masaki Muranaka 11ed7a6128 Fix a warning happens on MRB_INT64 enabled. 2013-03-17 03:24:19 +09:00
Masaki Muranaka 3aa3b4af90 Remove stdlib.h from mruby.h. It is for portability (care for freestanding environments).
This is a first step. It will be reduced stdlib.h in each files later.
2013-03-16 21:29:39 +09:00
Masaki Muranaka 6ba298ed54 Remove unnecessory stdint.h. 2013-03-16 21:06:32 +09:00
Yukihiro Matz Matsumoto 08a0c9f328 add mrb_int overflow check for mrb_int 2013-03-14 23:12:21 +09:00
Yukihiro Matz Matsumoto 9d0bbdb7f8 use size_t for string length C API 2013-03-14 19:33:38 +09:00
Yukihiro Matz Matsumoto 535a5489c7 remove PARANOID from comments 2013-03-14 18:47:59 +09:00
Masaki Muranaka fe057faf1b Add the type check in mrb_str_to_cstr(). 2013-03-13 17:28:26 +09:00
Yukihiro "Matz" Matsumoto c9f3fd4779 Merge pull request #986 from monaka/pr-use-mrb_obj_alloc_string-instead-of-str_alloc
Remove str_alloc(). Use mrb_obj_alloc_string() instead.
2013-03-12 17:26:50 -07:00
Yukihiro "Matz" Matsumoto 3f4c2d451d Merge pull request #985 from monaka/pr-remove-unused-code-20130312
Remove mrb_str_sublen() as it is not used.
2013-03-12 17:26:04 -07:00
Yukihiro "Matz" Matsumoto e53628eb9d Merge pull request #984 from monaka/pr-make-mrb_str_new2-obsolete
Remove mrb_str_new2().
2013-03-12 17:25:23 -07:00