Skip to content

Commit

Permalink
* README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
Browse files Browse the repository at this point in the history
  lex.c.blt, keywords, load.c, thread.c: more ANSI'ize.
  a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
  in [ruby-dev:32725]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Dec 25, 2007
1 parent 5f0b8af commit 3410fd6
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 47 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Tue Dec 25 13:13:09 2007 Yukihiro Matsumoto <[email protected]>

* README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
lex.c.blt, keywords, load.c, thread.c: more ANSI'ize.
a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
in [ruby-dev:32725]

Tue Dec 25 13:07:56 2007 Koichi Sasada <[email protected]>

* vm_core.h, thread.c, cont.c: add RUBY_VM_SET_INTERRUPT(),
Expand Down
58 changes: 28 additions & 30 deletions README.EXT.ja
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ FIXNUM
ȯ������)��Ʊ�ͤ˥����å�̵���ǻȤ����Ѵ��ޥ�����double��
���Ф���NUM2DBL()�פ�����ޤ���

char* ����Ф���硢version 1.6 �����Ǥϡ�STR2CSTR()�פ
�����ޥ�����ȤäƤ��ޤ������������ to_str() �ˤ����ۤ
���Ѵ���̤� GC ������ǽ�������뤿�ᡢversion 1.7 �ʹߤǤ�
obsolete �Ȥʤꡢ����� StringValue() �� StringValuePtr()
��Ȥ�����侩���Ƥ��ޤ���StringValue(var) �� var �� String
�Ǥ���в��⤻���������Ǥʤ���� var �� var.to_str() �η�̤
�֤�������ޥ�����StringValuePtr(var) ��Ʊ�ͤ� var ���֤����
�Ƥ��� var ��ʸ����ɽ�����Ф��� char* ���֤��ޥ����Ǥ���var ��
���Ƥ�ľ���֤����������������Τǡ�var �� lvalue �Ǥ���ɬ�פ
����ޤ���
char* ����Ф���硢version 1.6 �����Ǥϡ�STR2CSTR()�פȤ
���ޥ�����ȤäƤ��ޤ������������ to_str() �ˤ����ۤη��
����̤� GC ������ǽ�������뤿�ᡢversion 1.7 �ʹߤǤ�
obsolete �Ȥʤꡢ����� StringValue() �� StringValuePtr()
��Ȥ�����侩���Ƥ��ޤ���StringValue(var) �� var �� String
�Ǥ���в��⤻���������Ǥʤ���� var �� var.to_str() �η��
��֤�������ޥ�����StringValuePtr(var) ��Ʊ�ͤ� var ���֤�
����Ƥ��� var ��ʸ����ɽ�����Ф��� char* ���֤��ޥ����Ǥ���
var �����Ƥ�ľ���֤����������������Τǡ�var �� lvalue �Ǥ�
��ɬ�פ�����ޤ���

����ʳ��Υǡ��������פ��б�����C�ι�¤�Τ�����ޤ����б���
�빽¤�ΤΤ���VALUE�Ϥ��Τޤޥ��㥹��(���Ѵ�)����й�¤�Τ�
Expand Down Expand Up @@ -576,7 +576,8 @@ Ruby
�����Ԥ��ޤ���dbm.c����������Ѥ��ޤ���

--
Init_dbm()
void
Init_dbm(void)
{
/* DBM���饹��������� */
cDBM = rb_define_class("DBM", rb_cObject);
Expand Down Expand Up @@ -638,8 +639,7 @@ fdbm_delete()

--
static VALUE
fdbm_delete(obj, keystr)
VALUE obj, keystr;
fdbm_delete(VALUE obj, VALUE keystr)
{
:
}
Expand All @@ -655,10 +655,7 @@ fdbm_delete(obj, keystr)

--
static VALUE
fdbm_s_open(argc, argv, klass)
int argc;
VALUE *argv;
VALUE klass;
fdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
:
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
Expand Down Expand Up @@ -687,8 +684,7 @@ Ruby

--
static VALUE
fdbm_indexes(obj, args)
VALUE obj, args;
fdbm_indexes(VALUE obj, VALUE args)
{
:
}
Expand Down Expand Up @@ -1049,8 +1045,8 @@ char *rb_id2name(ID id)

char *rb_class2name(VALUE klass)

���饹��̾�����֤�(�ǥХå���)�����饹��̾��������ʤ����ˤ�,
������̤ä�̾������ĥ��饹��̾�����֤���
���饹��̾�����֤�(�ǥХå���)�����饹��̾��������ʤ����
��, ������̤ä�̾������ĥ��饹��̾�����֤���

int rb_respond_to(VALUE obj, ID id)

Expand Down Expand Up @@ -1193,10 +1189,10 @@ find_library(lib, func, path...)

have_func(func, header)

�إå��ե�����header�򥤥󥯥롼�ɤ��ƴؿ�func��¸�ߤ������
�����롥func��ɸ��Ǥϥ�󥯤���ʤ��饤�֥����Τ�ΤǤ
����ˤ����have_library�Ǥ��Υ饤�֥�������å����Ƥ��
�����ؿ���¸�ߤ����true���֤���
�إå��ե�����header�򥤥󥯥롼�ɤ��ƴؿ�func��¸�ߤ����
å����롥func��ɸ��Ǥϥ�󥯤���ʤ��饤�֥����Τ�Τ
������ˤ����have_library�Ǥ��Υ饤�֥�������å����Ƥ�
�������ؿ���¸�ߤ����true���֤���

have_var(var, header)

Expand Down Expand Up @@ -1247,7 +1243,8 @@ find_executable(command, path)

with_config(withval[, default=nil])

���ޥ�ɥ饤����--with-<withval>�ǻ��ꤵ�줿���ץ�����ͤ����롥
���ޥ�ɥ饤����--with-<withval>�ǻ��ꤵ�줿���ץ������
�����롥

enable_config(config, *defaults)
disable_config(config, *defaults)
Expand All @@ -1256,8 +1253,9 @@ disable_config(config, *defaults)
--disable-<config>�ǻ��ꤵ�줿�����ͤ����롥
--enable-<config>�����ꤵ��Ƥ�������true��
--disable-<config>�����ꤵ��Ƥ�������false���֤���
�ɤ������ꤵ��Ƥ��ʤ����ϡ��֥��å��Ĥ��ǸƤӽФ���Ƥ������
*defaults��yield������̡��֥��å��ʤ��ʤ�*defaults���֤���
�ɤ������ꤵ��Ƥ��ʤ����ϡ��֥��å��Ĥ��ǸƤӽФ����
�������*defaults��yield������̡��֥��å��ʤ��ʤ�
*defaults���֤���

dir_config(target[, default_dir])
dir_config(target[, default_include, default_lib])
Expand All @@ -1266,8 +1264,8 @@ dir_config(target[, default_include, default_lib])
--with-<target>-lib�Τ����줫�ǻ��ꤵ���ǥ��쥯�ȥ��
$CFLAGS �� $LDFLAGS ���ɲä��롥--with-<target>-dir=/path��
--with-<target>-include=/path/include --with-<target>-lib=/path/lib
�������Ǥ��롥�ɲä��줿 include �ǥ��쥯�ȥ�� lib �ǥ��쥯�ȥ�
������֤��� ([include_dir, lib_dir])
�������Ǥ��롥�ɲä��줿 include �ǥ��쥯�ȥ�� lib �ǥ���
���ȥ��������֤��� ([include_dir, lib_dir])

pkg_config(pkg)

Expand Down
2 changes: 1 addition & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ sys_warning_1(const char* mesg)

#define GLOB_VERBOSE (1UL << (sizeof(int) * CHAR_BIT - 1))
#define sys_warning(val) \
(void)((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)_((VALUE)))sys_warning_1, (VALUE)(val), 0))
(void)((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)(VALUE))sys_warning_1, (VALUE)(val), 0))

#define GLOB_ALLOC(type) (type *)malloc(sizeof(type))
#define GLOB_ALLOC_N(type, n) (type *)malloc(sizeof(type) * (n))
Expand Down
10 changes: 5 additions & 5 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ char **rb_origenviron;
void rb_clear_trace_func(void);
void rb_thread_stop_timer_thread(void);

void rb_call_inits _((void));
void Init_stack _((VALUE *));
void Init_heap _((void));
void Init_ext _((void));
void rb_call_inits(void);
void Init_stack(VALUE *);
void Init_heap(void);
void Init_ext(void);
void Init_BareVM(void);

void
Expand Down Expand Up @@ -268,7 +268,7 @@ rb_eval_string(const char *str)
VALUE
rb_eval_string_protect(const char *str, int *state)
{
return rb_protect((VALUE (*)_((VALUE)))rb_eval_string, (VALUE)str, state);
return rb_protect((VALUE (*)(VALUE))rb_eval_string, (VALUE)str, state);
}

VALUE
Expand Down
12 changes: 6 additions & 6 deletions eval_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void *alloca();
#endif

#ifndef HAVE_STRING_H
char *strrchr _((const char *, const char));
char *strrchr(const char *, const char);
#endif

#ifdef HAVE_UNISTD_H
Expand Down Expand Up @@ -192,19 +192,19 @@ char *strrchr _((const char *, const char));
} \
while (0)

void rb_thread_cleanup _((void));
void rb_thread_wait_other_threads _((void));
void rb_thread_cleanup(void);
void rb_thread_wait_other_threads(void);

int thread_set_raised(rb_thread_t *th);
int thread_reset_raised(rb_thread_t *th);

VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
VALUE rb_make_exception _((int argc, VALUE *argv));
VALUE rb_make_exception(int argc, VALUE *argv);

NORETURN(void rb_fiber_start(void));

NORETURN(void rb_raise_jump _((VALUE)));
NORETURN(void rb_print_undef _((VALUE, ID, int)));
NORETURN(void rb_raise_jump(VALUE));
NORETURN(void rb_print_undef(VALUE, ID, int));
NORETURN(void vm_localjump_error(const char *, VALUE, int));
NORETURN(void vm_jump_tag_but_local_jump(int, VALUE));

Expand Down
2 changes: 1 addition & 1 deletion keywords
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
struct kwtable {char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word _((const char *, unsigned int));
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
%}

Expand Down
2 changes: 1 addition & 1 deletion lex.c.blt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ error "gperf generated tables don't work with this execution character set. Plea
#line 1 "keywords"

struct kwtable {char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word _((const char *, unsigned int));
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
#line 7 "keywords"
struct kwtable;
Expand Down
2 changes: 1 addition & 1 deletion lex.c.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
struct kwtable {char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word _((const char *, unsigned int));
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
%}

Expand Down
2 changes: 1 addition & 1 deletion load.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ rb_provide(const char *feature)
rb_provide_feature(rb_str_new2(feature));
}

NORETURN(static void load_failed _((VALUE)));
NORETURN(static void load_failed(VALUE));

void
rb_load(VALUE fname, int wrap)
Expand Down
2 changes: 1 addition & 1 deletion thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ struct thgroup {
* were created.
*/

static VALUE thgroup_s_alloc _((VALUE));
static VALUE thgroup_s_alloc(VALUE);
static VALUE
thgroup_s_alloc(VALUE klass)
{
Expand Down

0 comments on commit 3410fd6

Please sign in to comment.