ruby-changes:27718
From: kosaki <ko1@a...>
Date: Sat, 16 Mar 2013 06:27:03 +0900 (JST)
Subject: [ruby-changes:27718] kosaki:r39770 (trunk): * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because
kosaki 2013-03-16 06:26:36 +0900 (Sat, 16 Mar 2013) New Revision: 39770 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39770 Log: * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because other all files use numberof(). Modified files: trunk/ChangeLog trunk/thread_pthread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 39769) +++ ChangeLog (revision 39770) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Mar 15 14:17:55 2013 KOSAKI Motohiro <kosaki.motohiro@g...> + + * thread_pthread.c (numberof): renamed from ARRAY_SIZE() because + other all files use numberof(). + Say Mar 15 01:33:00 2013 Charles Oliver Nutter <headius@h...> * test/ruby/test_lazy_enumerator.rb (TestLazyEnumerator#test_drop_while): Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 39769) +++ thread_pthread.c (revision 39770) @@ -64,8 +64,8 @@ static pthread_t timer_thread_id; https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L64 # define USE_SLEEPY_TIMER_THREAD 0 #endif -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#ifndef numberof +#define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) #endif static void @@ -1327,7 +1327,7 @@ timer_thread_sleep(rb_global_vm_lock_t* https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1327 } else { /* wait (infinite) */ - result = poll(pollfds, ARRAY_SIZE(pollfds), -1); + result = poll(pollfds, numberof(pollfds), -1); } if (result == 0) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/