mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* internal.h (numberof): Gathered from various files.
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									8e65ff7e31
								
							
						
					
					
						commit
						bd15d4ca78
					
				
					 18 changed files with 10 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,11 @@
 | 
			
		|||
Fri Jun  7 18:58:56 2013  Tanaka Akira  <akr@fsij.org>
 | 
			
		||||
 | 
			
		||||
	* internal.h (numberof): Gathered from various files.
 | 
			
		||||
 | 
			
		||||
	* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
 | 
			
		||||
	  load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
 | 
			
		||||
	  error.c, ruby.c: Remove the definitions of numberof.
 | 
			
		||||
 | 
			
		||||
Fri Jun  7 18:24:39 2013  Tanaka Akira  <akr@fsij.org>
 | 
			
		||||
 | 
			
		||||
	* bignum.c (rb_absint_size): Declare a variable, i, just before used
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								array.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								array.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -24,8 +24,6 @@
 | 
			
		|||
#endif
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
VALUE rb_cArray;
 | 
			
		||||
 | 
			
		||||
static ID id_cmp, id_div, id_power;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,6 @@
 | 
			
		|||
#include "insns.inc"
 | 
			
		||||
#include "insns_info.inc"
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
 | 
			
		||||
#define FIXNUM_OR(n, i) ((n)|INT2FIX(i))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								enum.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								enum.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -17,8 +17,6 @@
 | 
			
		|||
 | 
			
		||||
#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
 | 
			
		||||
 | 
			
		||||
VALUE rb_mEnumerable;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								error.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								error.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -25,8 +25,6 @@
 | 
			
		|||
#include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#ifndef EXIT_SUCCESS
 | 
			
		||||
#define EXIT_SUCCESS 0
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								eval.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								eval.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -20,8 +20,6 @@
 | 
			
		|||
#include "vm_core.h"
 | 
			
		||||
#include "probes_helper.h"
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
NORETURN(void rb_raise_jump(VALUE));
 | 
			
		||||
 | 
			
		||||
NODE *rb_vm_get_cref(const rb_iseq_t *, const VALUE *);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								gc.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								gc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2825,8 +2825,6 @@ mark_const_tbl(rb_objspace_t *objspace, st_table *tbl)
 | 
			
		|||
     ((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,8 @@ extern "C" {
 | 
			
		|||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
 | 
			
		||||
 | 
			
		||||
#define GCC_VERSION_SINCE(major, minor, patchlevel) \
 | 
			
		||||
  (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
 | 
			
		||||
   ((__GNUC__ > (major)) ||  \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								io.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								io.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -119,8 +119,6 @@
 | 
			
		|||
off_t __syscall(quad_t number, ...);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#define IO_RBUF_CAPA_MIN  8192
 | 
			
		||||
#define IO_CBUF_CAPA_MIN  (128*1024)
 | 
			
		||||
#define IO_RBUF_CAPA_FOR(fptr) (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								iseq.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								iseq.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -18,8 +18,6 @@
 | 
			
		|||
#include "vm_core.h"
 | 
			
		||||
#include "iseq.h"
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#include "insns.inc"
 | 
			
		||||
#include "insns_info.inc"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								load.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								load.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -11,8 +11,6 @@
 | 
			
		|||
 | 
			
		||||
VALUE ruby_dln_librefs;
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#define IS_RBEXT(e) (strcmp((e), ".rb") == 0)
 | 
			
		||||
#define IS_SOEXT(e) (strcmp((e), ".so") == 0 || strcmp((e), ".o") == 0)
 | 
			
		||||
#ifdef DLEXT2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								math.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								math.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -19,8 +19,6 @@
 | 
			
		|||
    extern int signbit(double);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
VALUE rb_mMath;
 | 
			
		||||
VALUE rb_eMathDomainError;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								parse.y
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								parse.y
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -31,8 +31,6 @@
 | 
			
		|||
#include <ctype.h>
 | 
			
		||||
#include "probes.h"
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#define YYMALLOC(size)		rb_parser_malloc(parser, (size))
 | 
			
		||||
#define YYREALLOC(ptr, size)	rb_parser_realloc(parser, (ptr), (size))
 | 
			
		||||
#define YYCALLOC(nelem, size)	rb_parser_calloc(parser, (nelem), (size))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,8 +80,6 @@
 | 
			
		|||
#include <grp.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array)/sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#if defined(HAVE_TIMES) || defined(_WIN32)
 | 
			
		||||
static VALUE rb_cProcessTms;
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								ruby.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								ruby.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -52,8 +52,6 @@
 | 
			
		|||
char *getenv();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
 | 
			
		||||
#define DEFAULT_RUBYGEMS_ENABLED "disabled"
 | 
			
		||||
#else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								string.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								string.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -31,8 +31,6 @@
 | 
			
		|||
 | 
			
		||||
#define STRING_ENUMERATORS_WANTARRAY 0 /* next major */
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
 | 
			
		||||
#undef rb_str_new_cstr
 | 
			
		||||
#undef rb_tainted_str_new_cstr
 | 
			
		||||
#undef rb_usascii_str_new_cstr
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								struct.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								struct.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -125,7 +125,6 @@ static VALUE rb_struct_ref7(VALUE obj) {return RSTRUCT_PTR(obj)[7];}
 | 
			
		|||
static VALUE rb_struct_ref8(VALUE obj) {return RSTRUCT_PTR(obj)[8];}
 | 
			
		||||
static VALUE rb_struct_ref9(VALUE obj) {return RSTRUCT_PTR(obj)[9];}
 | 
			
		||||
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
#define N_REF_FUNC numberof(ref_func)
 | 
			
		||||
 | 
			
		||||
static VALUE (*const ref_func[])(VALUE) = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,10 +64,6 @@ static pthread_t timer_thread_id;
 | 
			
		|||
# define USE_SLEEPY_TIMER_THREAD 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef numberof
 | 
			
		||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
gvl_acquire_common(rb_vm_t *vm)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue