[前][次][番号順一覧][スレッド一覧]

ruby-changes:26447

From: nobu <ko1@a...>
Date: Thu, 20 Dec 2012 18:28:46 +0900 (JST)
Subject: [ruby-changes:26447] nobu:r38498 (trunk): tkutil.c: NIL_P

nobu	2012-12-20 18:28:35 +0900 (Thu, 20 Dec 2012)

  New Revision: 38498

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38498

  Log:
    tkutil.c: NIL_P
    
    * ext/tk/tkutil/tkutil.c (tk_symbolkey2str, ary2list, ary2list2): do
      not assume NIL_P() to be parenthesized always.

  Modified files:
    trunk/ext/tk/tkutil/tkutil.c

Index: ext/tk/tkutil/tkutil.c
===================================================================
--- ext/tk/tkutil/tkutil.c	(revision 38497)
+++ ext/tk/tkutil/tkutil.c	(revision 38498)
@@ -277,7 +277,7 @@ tk_symbolkey2str(self, keys) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L277
 {
     volatile VALUE new_keys = rb_hash_new();
 
-    if NIL_P(keys) return new_keys;
+    if (NIL_P(keys)) return new_keys;
     keys = rb_convert_type(keys, T_HASH, "Hash", "to_hash");
     st_foreach_check(RHASH_TBL(keys), to_strkey, new_keys, Qundef);
     return new_keys;
@@ -309,7 +309,7 @@ ary2list(ary, enc_flag, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L309
       sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
     }
 
-    if NIL_P(enc_flag) {
+    if (NIL_P(enc_flag)) {
         dst_enc = sys_enc;
         req_chk_flag = 1;
     } else if (TYPE(enc_flag) == T_TRUE || TYPE(enc_flag) == T_FALSE) {
@@ -458,12 +458,12 @@ ary2list2(ary, enc_flag, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L458
     volatile VALUE sys_enc, dst_enc, str_enc;
 
     sys_enc = rb_funcall(cTclTkLib, ID_encoding, 0, 0);
-    if NIL_P(sys_enc) {
+    if (NIL_P(sys_enc)) {
       sys_enc = rb_funcall(cTclTkLib, ID_encoding_system, 0, 0);
       sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
     }
 
-    if NIL_P(enc_flag) {
+    if (NIL_P(enc_flag)) {
         dst_enc = sys_enc;
         req_chk_flag = 1;
     } else if (TYPE(enc_flag) == T_TRUE || TYPE(enc_flag) == T_FALSE) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]