Skip to content

Commit

Permalink
* include/ruby/intern.h,
Browse files Browse the repository at this point in the history
  include/ruby/io.h,
  include/ruby/ruby.h,
  include/ruby/win32.h,
  include/ruby/backward/rubysig.h,
  bignum.c,
  gc.c,
  io.c,
  process.c,
  safe.c,
  struct.c,
  thread.c,
  ext/socket/rubysocket.h,
  ext/-test-/old_thread_select: Remove deprecated definitions
  [ruby-core:60581] [Feature #9502]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Feb 14, 2014
1 parent f7cff3a commit 6f8b0e9
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 647 deletions.
18 changes: 18 additions & 0 deletions ChangeLog
@@ -1,3 +1,21 @@
Sat Feb 15 00:13:14 2014 Tanaka Akira <akr@fsij.org>

* include/ruby/intern.h,
include/ruby/io.h,
include/ruby/ruby.h,
include/ruby/win32.h,
include/ruby/backward/rubysig.h,
bignum.c,
gc.c,
io.c,
process.c,
safe.c,
struct.c,
thread.c,
ext/socket/rubysocket.h,
ext/-test-/old_thread_select: Remove deprecated definitions
[ruby-core:60581] [Feature #9502]

Fri Feb 14 18:38:46 2014 Eric Wong <e@80x24.org> Fri Feb 14 18:38:46 2014 Eric Wong <e@80x24.org>


* string.c (rb_str_format_m): trade volatile for RB_GC_GUARD * string.c (rb_str_format_m): trade volatile for RB_GC_GUARD
Expand Down
118 changes: 0 additions & 118 deletions bignum.c
Expand Up @@ -3686,24 +3686,6 @@ rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t na
return bignorm(val); return bignorm(val);
} }


#define QUAD_SIZE 8

void
rb_quad_pack(char *buf, VALUE val)
{
rb_integer_pack(val, buf, 1, QUAD_SIZE, 0,
INTEGER_PACK_NATIVE_BYTE_ORDER|
INTEGER_PACK_2COMP);
}

VALUE
rb_quad_unpack(const char *buf, int signed_p)
{
return rb_integer_unpack(buf, 1, QUAD_SIZE, 0,
INTEGER_PACK_NATIVE_BYTE_ORDER|
(signed_p ? INTEGER_PACK_2COMP : 0));
}

#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)]) #define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])


static void static void
Expand Down Expand Up @@ -4540,61 +4522,6 @@ power_cache_get_power(int base, int power_level, size_t *numdigits_ret)
return base36_power_cache[base - 2][power_level]; return base36_power_cache[base - 2][power_level];
} }


/*
* deprecated. (used only from deprecated rb_big2str0)
*
* big2str_muraken_find_n1
*
* Let a natural number x is given by:
* x = 2^0 * x_0 + 2^1 * x_1 + ... + 2^(B*n_0 - 1) * x_{B*n_0 - 1},
* where B is BITSPERDIG (i.e. BDIGITS*CHAR_BIT) and n_0 is
* RBIGNUM_LEN(x).
*
* Now, we assume n_1 = min_n \{ n | 2^(B*n_0/2) <= b_1^(n_1) \}, so
* it is realized that 2^(B*n_0) <= {b_1}^{2*n_1}, where b_1 is a
* given radix number. And then, we have n_1 <= (B*n_0) /
* (2*log_2(b_1)), therefore n_1 is given by ceil((B*n_0) /
* (2*log_2(b_1))).
*/
static long
big2str_find_n1(VALUE x, int base)
{
static const double log_2[] = {
1.0, 1.58496250072116, 2.0,
2.32192809488736, 2.58496250072116, 2.8073549220576,
3.0, 3.16992500144231, 3.32192809488736,
3.4594316186373, 3.58496250072116, 3.70043971814109,
3.8073549220576, 3.90689059560852, 4.0,
4.08746284125034, 4.16992500144231, 4.24792751344359,
4.32192809488736, 4.39231742277876, 4.4594316186373,
4.52356195605701, 4.58496250072116, 4.64385618977472,
4.70043971814109, 4.75488750216347, 4.8073549220576,
4.85798099512757, 4.90689059560852, 4.95419631038688,
5.0, 5.04439411935845, 5.08746284125034,
5.12928301694497, 5.16992500144231
};
long bits;

if (base < 2 || 36 < base)
rb_bug("invalid radix %d", base);

if (FIXNUM_P(x)) {
bits = (SIZEOF_LONG*CHAR_BIT - 1)/2 + 1;
}
else if (BIGZEROP(x)) {
return 0;
}
else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
}
else {
bits = BITSPERDIG*RBIGNUM_LEN(x);
}

/* @shyouhei note: vvvvvvvvvvvvv this cast is suspicious. But I believe it is OK, because if that cast loses data, this x value is too big, and should have raised RangeError. */
return (long)ceil(((double)bits)/log_2[base - 2]);
}

struct big2str_struct { struct big2str_struct {
int negative; int negative;
int base; int base;
Expand Down Expand Up @@ -4976,41 +4903,6 @@ rb_big2str1(VALUE x, int base)
return big2str_generic(x, base); return big2str_generic(x, base);
} }


/* deprecated */
VALUE
rb_big2str0(VALUE x, int base, int trim)
{
VALUE str;
long oldlen;
long n2;

str = rb_big2str1(x, base);

if (trim || FIXNUM_P(x) || BIGZEROP(x))
return str;

oldlen = RSTRING_LEN(str);
if (oldlen && RSTRING_PTR(str)[0] != '-') {
rb_str_resize(str, oldlen+1);
MEMMOVE(RSTRING_PTR(str)+1, RSTRING_PTR(str), char, oldlen);
RSTRING_PTR(str)[0] = '+';
}

n2 = big2str_find_n1(x, base);

oldlen = RSTRING_LEN(str);
if (oldlen-1 < n2) {
long off = n2 - (oldlen-1);
rb_str_resize(str, n2+1);
MEMMOVE(RSTRING_PTR(str)+1+off, RSTRING_PTR(str)+1, char, oldlen-1);
memset(RSTRING_PTR(str)+1, '0', off);
}

RSTRING_PTR(str)[RSTRING_LEN(str)] = '\0';

return str;
}

VALUE VALUE
rb_big2str(VALUE x, int base) rb_big2str(VALUE x, int base)
{ {
Expand Down Expand Up @@ -5071,16 +4963,6 @@ big2ulong(VALUE x, const char *type)
return num; return num;
} }


/* deprecated */
VALUE
rb_big2ulong_pack(VALUE x)
{
unsigned long num;
rb_integer_pack(x, &num, 1, sizeof(num), 0,
INTEGER_PACK_NATIVE_BYTE_ORDER|INTEGER_PACK_2COMP);
return num;
}

VALUE VALUE
rb_big2ulong(VALUE x) rb_big2ulong(VALUE x)
{ {
Expand Down
4 changes: 0 additions & 4 deletions ext/-test-/old_thread_select/depend

This file was deleted.

4 changes: 0 additions & 4 deletions ext/-test-/old_thread_select/extconf.rb

This file was deleted.

75 changes: 0 additions & 75 deletions ext/-test-/old_thread_select/old_thread_select.c

This file was deleted.

1 change: 0 additions & 1 deletion ext/socket/rubysocket.h
Expand Up @@ -256,7 +256,6 @@ int Rconnect();


#include "constdefs.h" #include "constdefs.h"


#define BLOCKING_REGION(func, arg) (long)rb_thread_blocking_region((func), (arg), RUBY_UBF_IO, 0)
#define BLOCKING_REGION_FD(func, arg) (long)rb_thread_io_blocking_region((func), (arg), (arg)->fd) #define BLOCKING_REGION_FD(func, arg) (long)rb_thread_io_blocking_region((func), (arg), (arg)->fd)


#define SockAddrStringValue(v) rsock_sockaddr_string_value(&(v)) #define SockAddrStringValue(v) rsock_sockaddr_string_value(&(v))
Expand Down
6 changes: 0 additions & 6 deletions gc.c
Expand Up @@ -5817,12 +5817,6 @@ ruby_gc_set_params(int safe_level)
#endif #endif
} }


void
rb_gc_set_params(void)
{
ruby_gc_set_params(rb_safe_level());
}

void void
rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data) rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data)
{ {
Expand Down
5 changes: 0 additions & 5 deletions include/ruby/backward/rubysig.h
Expand Up @@ -29,11 +29,6 @@ extern "C" {


RUBY_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN


struct rb_blocking_region_buffer;
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
#define RUBY_CRITICAL(statements) do {statements;} while (0) #define RUBY_CRITICAL(statements) do {statements;} while (0)
#define DEFER_INTS (0) #define DEFER_INTS (0)
#define ENABLE_INTS (1) #define ENABLE_INTS (1)
Expand Down
24 changes: 0 additions & 24 deletions include/ruby/intern.h
Expand Up @@ -102,18 +102,14 @@ VALUE rb_str_to_inum(VALUE, int, int);
VALUE rb_cstr2inum(const char*, int); VALUE rb_cstr2inum(const char*, int);
VALUE rb_str2inum(VALUE, int); VALUE rb_str2inum(VALUE, int);
VALUE rb_big2str(VALUE, int); VALUE rb_big2str(VALUE, int);
DEPRECATED(VALUE rb_big2str0(VALUE, int, int));
SIGNED_VALUE rb_big2long(VALUE); SIGNED_VALUE rb_big2long(VALUE);
#define rb_big2int(x) rb_big2long(x) #define rb_big2int(x) rb_big2long(x)
VALUE rb_big2ulong(VALUE); VALUE rb_big2ulong(VALUE);
#define rb_big2uint(x) rb_big2ulong(x) #define rb_big2uint(x) rb_big2ulong(x)
DEPRECATED(VALUE rb_big2ulong_pack(VALUE x));
#if HAVE_LONG_LONG #if HAVE_LONG_LONG
LONG_LONG rb_big2ll(VALUE); LONG_LONG rb_big2ll(VALUE);
unsigned LONG_LONG rb_big2ull(VALUE); unsigned LONG_LONG rb_big2ull(VALUE);
#endif /* HAVE_LONG_LONG */ #endif /* HAVE_LONG_LONG */
DEPRECATED(void rb_quad_pack(char*,VALUE));
DEPRECATED(VALUE rb_quad_unpack(const char*,int));
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs); void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
VALUE rb_big_unpack(unsigned long *buf, long num_longs); VALUE rb_big_unpack(unsigned long *buf, long num_longs);
int rb_uv_to_utf8(char[6],unsigned long); int rb_uv_to_utf8(char[6],unsigned long);
Expand Down Expand Up @@ -427,7 +423,6 @@ void rb_thread_wait_fd(int);
int rb_thread_fd_writable(int); int rb_thread_fd_writable(int);
void rb_thread_fd_close(int); void rb_thread_fd_close(int);
int rb_thread_alone(void); int rb_thread_alone(void);
DEPRECATED(void rb_thread_polling(void));
void rb_thread_sleep(int); void rb_thread_sleep(int);
void rb_thread_sleep_forever(void); void rb_thread_sleep_forever(void);
void rb_thread_sleep_deadly(void); void rb_thread_sleep_deadly(void);
Expand All @@ -437,7 +432,6 @@ VALUE rb_thread_wakeup_alive(VALUE);
VALUE rb_thread_run(VALUE); VALUE rb_thread_run(VALUE);
VALUE rb_thread_kill(VALUE); VALUE rb_thread_kill(VALUE);
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*); VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *); int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
void rb_thread_wait_for(struct timeval); void rb_thread_wait_for(struct timeval);
VALUE rb_thread_current(void); VALUE rb_thread_current(void);
Expand Down Expand Up @@ -482,7 +476,6 @@ void rb_gc_call_finalizer_at_exit(void);
VALUE rb_gc_enable(void); VALUE rb_gc_enable(void);
VALUE rb_gc_disable(void); VALUE rb_gc_disable(void);
VALUE rb_gc_start(void); VALUE rb_gc_start(void);
DEPRECATED(void rb_gc_set_params(void));
VALUE rb_define_finalizer(VALUE, VALUE); VALUE rb_define_finalizer(VALUE, VALUE);
VALUE rb_undefine_finalizer(VALUE); VALUE rb_undefine_finalizer(VALUE);
size_t rb_gc_count(void); size_t rb_gc_count(void);
Expand Down Expand Up @@ -623,20 +616,7 @@ VALUE rb_sym_all_symbols(void);
/* process.c */ /* process.c */
void rb_last_status_set(int status, rb_pid_t pid); void rb_last_status_set(int status, rb_pid_t pid);
VALUE rb_last_status_get(void); VALUE rb_last_status_get(void);
struct rb_exec_arg {
VALUE execarg_obj;
};
DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
int rb_proc_exec(const char*); int rb_proc_exec(const char*);
DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e));
DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val));
DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e));
DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s));
DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t));
DEPRECATED(int rb_exec(const struct rb_exec_arg*));
DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t));
DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE));
DEPRECATED(rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t));
VALUE rb_f_exec(int,VALUE*); VALUE rb_f_exec(int,VALUE*);
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags); rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
void rb_syswait(rb_pid_t pid); void rb_syswait(rb_pid_t pid);
Expand Down Expand Up @@ -853,7 +833,6 @@ VALUE rb_struct_initialize(VALUE, VALUE);
VALUE rb_struct_aref(VALUE, VALUE); VALUE rb_struct_aref(VALUE, VALUE);
VALUE rb_struct_aset(VALUE, VALUE, VALUE); VALUE rb_struct_aset(VALUE, VALUE, VALUE);
VALUE rb_struct_getmember(VALUE, ID); VALUE rb_struct_getmember(VALUE, ID);
DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
VALUE rb_struct_s_members(VALUE); VALUE rb_struct_s_members(VALUE);
VALUE rb_struct_members(VALUE); VALUE rb_struct_members(VALUE);
VALUE rb_struct_alloc_noinit(VALUE); VALUE rb_struct_alloc_noinit(VALUE);
Expand All @@ -866,9 +845,6 @@ typedef VALUE rb_blocking_function_t(void *);
void rb_thread_check_ints(void); void rb_thread_check_ints(void);
int rb_thread_interrupted(VALUE thval); int rb_thread_interrupted(VALUE thval);


/* Use rb_thread_call_without_gvl family instead. */
DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
rb_unblock_function_t *ubf, void *data2));
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1) #define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1) #define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
VALUE rb_mutex_new(void); VALUE rb_mutex_new(void);
Expand Down
1 change: 0 additions & 1 deletion include/ruby/io.h
Expand Up @@ -195,7 +195,6 @@ NORETURN(void rb_eof_error(void));


void rb_io_read_check(rb_io_t*); void rb_io_read_check(rb_io_t*);
int rb_io_read_pending(rb_io_t*); int rb_io_read_pending(rb_io_t*);
DEPRECATED(void rb_read_check(FILE*));


struct stat; struct stat;
VALUE rb_stat_new(const struct stat *); VALUE rb_stat_new(const struct stat *);
Expand Down
3 changes: 0 additions & 3 deletions include/ruby/ruby.h
Expand Up @@ -541,13 +541,10 @@ char *rb_string_value_cstr(volatile VALUE*);
#define StringValueCStr(v) rb_string_value_cstr(&(v)) #define StringValueCStr(v) rb_string_value_cstr(&(v))


void rb_check_safe_obj(VALUE); void rb_check_safe_obj(VALUE);
DEPRECATED(void rb_check_safe_str(VALUE));
#define SafeStringValue(v) do {\ #define SafeStringValue(v) do {\
StringValue(v);\ StringValue(v);\
rb_check_safe_obj(v);\ rb_check_safe_obj(v);\
} while (0) } while (0)
/* obsolete macro - use SafeStringValue(v) */
#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))


VALUE rb_str_export(VALUE); VALUE rb_str_export(VALUE);
#define ExportStringValue(v) do {\ #define ExportStringValue(v) do {\
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/win32.h
Expand Up @@ -782,7 +782,7 @@ int rb_w32_unwrap_io_handle(int);
== ***CAUTION*** == ***CAUTION***
Since this function is very dangerous, ((*NEVER*)) Since this function is very dangerous, ((*NEVER*))
* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or, * lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
* use anything like TRAP_BEG...TRAP_END block structure, * use anything like rb_thread_call_without_gvl,
in asynchronous_func_t. in asynchronous_func_t.
*/ */
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv); typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
Expand Down

0 comments on commit 6f8b0e9

Please sign in to comment.