ruby-changes:28965
From: nobu <ko1@a...>
Date: Sat, 1 Jun 2013 11:16:38 +0900 (JST)
Subject: [ruby-changes:28965] nobu:r41017 (trunk): error.c: better names for rb_exc_new family
nobu 2013-06-01 11:16:25 +0900 (Sat, 01 Jun 2013) New Revision: 41017 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41017 Log: error.c: better names for rb_exc_new family * error.c (rb_exc_new_cstr): rename from rb_exc_new2. * error.c (rb_exc_new_str): rename from rb_exc_new3. Modified files: trunk/ChangeLog trunk/error.c trunk/include/ruby/intern.h Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 41016) +++ include/ruby/intern.h (revision 41017) @@ -207,8 +207,10 @@ VALUE rb_enumeratorize_with_size(VALUE, https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L207 #define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0) /* error.c */ VALUE rb_exc_new(VALUE, const char*, long); -VALUE rb_exc_new2(VALUE, const char*); -VALUE rb_exc_new3(VALUE, VALUE); +VALUE rb_exc_new_cstr(VALUE, const char*); +VALUE rb_exc_new_str(VALUE, VALUE); +#define rb_exc_new2 rb_exc_new_cstr +#define rb_exc_new3 rb_exc_new_str PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2); PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3); PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3); @@ -786,11 +788,11 @@ VALUE rb_str_ellipsize(VALUE, long); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L788 rb_str_cat((str), (ptr), (long)strlen(ptr)) : \ rb_str_cat2((str), (ptr)); \ }) -#define rb_exc_new2(klass, ptr) __extension__ ( \ +#define rb_exc_new_cstr(klass, ptr) __extension__ ( \ { \ (__builtin_constant_p(ptr)) ? \ rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \ - rb_exc_new2((klass), (ptr)); \ + rb_exc_new_cstr((klass), (ptr)); \ }) #endif #define rb_str_new2 rb_str_new_cstr Index: ChangeLog =================================================================== --- ChangeLog (revision 41016) +++ ChangeLog (revision 41017) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jun 1 11:16:22 2013 Nobuyoshi Nakada <nobu@r...> + + * error.c (rb_exc_new_cstr): rename from rb_exc_new2. + + * error.c (rb_exc_new_str): rename from rb_exc_new3. + Sat Jun 1 10:13:17 2013 Nobuyoshi Nakada <nobu@r...> * string.c (rb_str_new[2-5], rb_{tainted,usascii}_str_new2), Index: error.c =================================================================== --- error.c (revision 41016) +++ error.c (revision 41017) @@ -534,7 +534,7 @@ VALUE rb_eSystemCallError; https://github.com/ruby/ruby/blob/trunk/error.c#L534 VALUE rb_mErrno; static VALUE rb_eNOERROR; -#undef rb_exc_new2 +#undef rb_exc_new_cstr VALUE rb_exc_new(VALUE etype, const char *ptr, long len) @@ -543,13 +543,13 @@ rb_exc_new(VALUE etype, const char *ptr, https://github.com/ruby/ruby/blob/trunk/error.c#L543 } VALUE -rb_exc_new2(VALUE etype, const char *s) +rb_exc_new_cstr(VALUE etype, const char *s) { return rb_exc_new(etype, s, strlen(s)); } VALUE -rb_exc_new3(VALUE etype, VALUE str) +rb_exc_new_str(VALUE etype, VALUE str) { StringValue(str); return rb_funcall(etype, rb_intern("new"), 1, str); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/