summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-19 03:58:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-19 03:58:57 +0000
commit33163ad123a14488cf163c274d1af56c8e5e7bcb (patch)
tree12198a7c64eeb738685ba20f555dde0587dc5782
parenta20ecf3be4aa83647f243ff29fa9d0b23a9b9b63 (diff)
* regparse.c, etc.: K&R to ANSI code cleanup patch from Stefan
Huehner <stefan at huehner.org>. [ruby-core:10543] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--debug.h2
-rw-r--r--error.c6
-rw-r--r--ext/curses/curses.c6
-rw-r--r--ext/etc/etc.c8
-rw-r--r--ext/socket/socket.c2
-rw-r--r--ext/syck/node.c6
-rw-r--r--ext/syck/rubyext.c8
-rw-r--r--ext/syck/syck.c2
-rw-r--r--ext/syck/syck.h8
-rw-r--r--oniguruma.h6
-rw-r--r--regcomp.c6
-rw-r--r--regenc.c4
-rw-r--r--regparse.c12
-rw-r--r--regparse.h2
-rw-r--r--ruby.h2
-rw-r--r--thread.c16
-rw-r--r--util.c8
-rw-r--r--vm.c2
-rw-r--r--vm_dump.c2
-rw-r--r--yarvcore.h2
21 files changed, 57 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 2825d3f..1e89cc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 19 12:13:36 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * regparse.c, etc.: K&R to ANSI code cleanup patch from Stefan
+ Huehner <stefan at huehner.org>. [ruby-core:10543]
+
Mon Mar 19 11:27:13 2007 Minero Aoki <aamine@loveruby.net>
* lib/net/protocol.rb (rbuf_read): extend buffer size for speed.
diff --git a/debug.h b/debug.h
index 290dfbc..5f9fb27 100644
--- a/debug.h
+++ b/debug.h
@@ -24,7 +24,7 @@ VALUE ruby_debug_value(int level, int debug_level, char *header, VALUE v);
ID ruby_debug_id(int level, int debug_level, char *header, ID id);
void ruby_debug_indent(int level, int debug_level, int indent_level);
void ruby_debug_breakpoint(void);
-void ruby_debug_gc_check_func();
+void ruby_debug_gc_check_func(void);
#if GCDEBUG == 1
diff --git a/error.c b/error.c
index 7eecc67..d296bff 100644
--- a/error.c
+++ b/error.c
@@ -26,8 +26,8 @@
extern const char ruby_version[], ruby_release_date[], ruby_platform[];
int ruby_nerrs;
-const char *rb_sourcefile();
-int rb_sourceline();
+const char *rb_sourcefile(void);
+int rb_sourceline(void);
static int
err_position(char *buf, long len)
@@ -148,7 +148,7 @@ rb_warn_m(VALUE self, VALUE mesg)
return Qnil;
}
-void yarv_bug();
+void yarv_bug(void);
void
rb_bug(const char *fmt, ...)
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 9e448bf..615bd65 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -72,9 +72,9 @@ struct windata {
#define CHECK(c) c
-static VALUE window_attroff();
-static VALUE window_attron();
-static VALUE window_attrset();
+static VALUE window_attroff(VALUE obj, VALUE attrs);
+static VALUE window_attron(VALUE obj, VALUE attrs);
+static VALUE window_attrset(VALUE obj, VALUE attrs);
static void
no_window(void)
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 5e15176..94c8b6b 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -164,14 +164,14 @@ etc_getpwnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETPWENT
static int passwd_blocking = 0;
static VALUE
-passwd_ensure()
+passwd_ensure(void)
{
passwd_blocking = Qfalse;
return Qnil;
}
static VALUE
-passwd_iterate()
+passwd_iterate(void)
{
struct passwd *pw;
@@ -368,14 +368,14 @@ etc_getgrnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETGRENT
static int group_blocking = 0;
static VALUE
-group_ensure()
+group_ensure(void)
{
group_blocking = Qfalse;
return Qnil;
}
static VALUE
-group_iterate()
+group_iterate(void)
{
struct group *pw;
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index ffe5104..9af9339 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -750,7 +750,7 @@ bsock_recv_nonblock(int argc, VALUE *argv, VALUE sock)
}
static VALUE
-bsock_do_not_rev_lookup()
+bsock_do_not_rev_lookup(void)
{
return do_not_reverse_lookup?Qtrue:Qfalse;
}
diff --git a/ext/syck/node.c b/ext/syck/node.c
index cbc2adb..47bce64 100644
--- a/ext/syck/node.c
+++ b/ext/syck/node.c
@@ -46,7 +46,7 @@ syck_free_node( SyckNode *n )
}
SyckNode *
-syck_alloc_map()
+syck_alloc_map(void)
{
SyckNode *n;
struct SyckMap *m;
@@ -65,7 +65,7 @@ syck_alloc_map()
}
SyckNode *
-syck_alloc_seq()
+syck_alloc_seq(void)
{
SyckNode *n;
struct SyckSeq *s;
@@ -83,7 +83,7 @@ syck_alloc_seq()
}
SyckNode *
-syck_alloc_str()
+syck_alloc_str(void)
{
SyckNode *n;
struct SyckStr *s;
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 371ef15..1966a2d 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -60,10 +60,10 @@ static VALUE oDefaultResolver, oGenericResolver;
/*
* my private collection of numerical oddities.
*/
-static double S_zero() { return 0.0; }
-static double S_one() { return 1.0; }
-static double S_inf() { return S_one() / S_zero(); }
-static double S_nan() { return S_zero() / S_zero(); }
+static double S_zero(void) { return 0.0; }
+static double S_one(void) { return 1.0; }
+static double S_inf(void) { return S_one() / S_zero(); }
+static double S_nan(void) { return S_zero() / S_zero(); }
static VALUE syck_node_transform( VALUE );
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index daf5316..bab7ee5 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -155,7 +155,7 @@ syck_parser_set_root_on_error( SyckParser *p, SYMID roer )
* Allocate the parser
*/
SyckParser *
-syck_new_parser()
+syck_new_parser(void)
{
SyckParser *p;
p = S_ALLOC( SyckParser );
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index 0833644..8d878a4 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -390,7 +390,7 @@ SyckLevel *syck_emitter_parent_level( SyckEmitter * );
void syck_emitter_pop_level( SyckEmitter * );
void syck_emitter_add_level( SyckEmitter *, int, enum syck_level_status );
void syck_emitter_reset_levels( SyckEmitter * );
-SyckParser *syck_new_parser();
+SyckParser *syck_new_parser(void);
void syck_free_parser( SyckParser * );
void syck_parser_set_root_on_error( SyckParser *, SYMID );
void syck_parser_implicit_typing( SyckParser *, int );
@@ -416,9 +416,9 @@ char *syck_yaml2byte( char * );
/*
* Allocation prototypes
*/
-SyckNode *syck_alloc_map();
-SyckNode *syck_alloc_seq();
-SyckNode *syck_alloc_str();
+SyckNode *syck_alloc_map(void);
+SyckNode *syck_alloc_seq(void);
+SyckNode *syck_alloc_str(void);
void syck_free_node( SyckNode * );
void syck_free_members( SyckNode * );
SyckNode *syck_new_str( const char *, enum scalar_style );
diff --git a/oniguruma.h b/oniguruma.h
index 2bb822b..2dd5323 100644
--- a/oniguruma.h
+++ b/oniguruma.h
@@ -425,11 +425,11 @@ OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const
/* encoding API */
ONIG_EXTERN
-int onigenc_init P_(());
+int onigenc_init P_((void));
ONIG_EXTERN
int onigenc_set_default_encoding P_((OnigEncoding enc));
ONIG_EXTERN
-OnigEncoding onigenc_get_default_encoding P_(());
+OnigEncoding onigenc_get_default_encoding P_((void));
ONIG_EXTERN
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
ONIG_EXTERN
@@ -888,7 +888,7 @@ int onig_set_meta_char P_((OnigEncoding enc, unsigned int what, OnigCodePoint co
ONIG_EXTERN
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
ONIG_EXTERN
-OnigAmbigType onig_get_default_ambig_flag P_(());
+OnigAmbigType onig_get_default_ambig_flag P_((void));
ONIG_EXTERN
int onig_set_default_ambig_flag P_((OnigAmbigType ambig_flag));
ONIG_EXTERN
diff --git a/regcomp.c b/regcomp.c
index 3f7168d..7a5e952 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -34,7 +34,7 @@ OnigAmbigType OnigDefaultAmbigFlag =
ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE);
extern OnigAmbigType
-onig_get_default_ambig_flag()
+onig_get_default_ambig_flag(void)
{
return OnigDefaultAmbigFlag;
}
@@ -5402,9 +5402,9 @@ onig_init()
extern int
-onig_end()
+onig_end(void)
{
- extern int onig_free_shared_cclass_table();
+ extern int onig_free_shared_cclass_table(void);
THREAD_ATOMIC_START;
diff --git a/regenc.c b/regenc.c
index bbbf1a2..e505a5f 100644
--- a/regenc.c
+++ b/regenc.c
@@ -32,13 +32,13 @@
OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT;
extern int
-onigenc_init()
+onigenc_init(void)
{
return 0;
}
extern OnigEncoding
-onigenc_get_default_encoding()
+onigenc_get_default_encoding(void)
{
return OnigEncDefaultCharEncoding;
}
diff --git a/regparse.c b/regparse.c
index 5bbd6a0..b9a9452 100644
--- a/regparse.c
+++ b/regparse.c
@@ -1088,7 +1088,7 @@ onig_node_free(Node* node)
#ifdef USE_RECYCLE_NODE
extern int
-onig_free_node_list()
+onig_free_node_list(void)
{
FreeNode* n;
@@ -1104,7 +1104,7 @@ onig_free_node_list()
#endif
static Node*
-node_new()
+node_new(void)
{
Node* node;
@@ -1133,7 +1133,7 @@ initialize_cclass(CClassNode* cc)
}
static Node*
-node_new_cclass()
+node_new_cclass(void)
{
Node* node = node_new();
CHECK_NULL_RETURN(node);
@@ -1202,7 +1202,7 @@ node_new_ctype(int type)
}
static Node*
-node_new_anychar()
+node_new_anychar(void)
{
Node* node = node_new();
CHECK_NULL_RETURN(node);
@@ -1490,7 +1490,7 @@ node_new_str_raw(UChar* s, UChar* end)
}
static Node*
-node_new_empty()
+node_new_empty(void)
{
return node_new_str(NULL, NULL);
}
@@ -4826,7 +4826,7 @@ i_free_shared_class(type_cclass_key* key, Node* node, void* arg)
}
extern int
-onig_free_shared_cclass_table()
+onig_free_shared_cclass_table(void)
{
if (IS_NOT_NULL(OnigTypeCClassTable)) {
onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);
diff --git a/regparse.h b/regparse.h
index ca62ddd..80f5283 100644
--- a/regparse.h
+++ b/regparse.h
@@ -315,7 +315,7 @@ extern Node* onig_node_new_anchor P_((int type));
extern Node* onig_node_new_str P_((const UChar* s, const UChar* end));
extern Node* onig_node_new_list P_((Node* left, Node* right));
extern void onig_node_str_clear P_((Node* node));
-extern int onig_free_node_list();
+extern int onig_free_node_list(void);
extern int onig_names_free P_((regex_t* reg));
extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env));
diff --git a/ruby.h b/ruby.h
index 823b00b..99bc98d 100644
--- a/ruby.h
+++ b/ruby.h
@@ -291,7 +291,7 @@ VALUE rb_get_path(VALUE);
#define FilePathValue(v) ((v) = rb_get_path(v))
void rb_secure(int);
-int rb_safe_level();
+int rb_safe_level(void);
void rb_set_safe_level(int);
void rb_set_safe_level_force(int);
void rb_secure_update(VALUE);
diff --git a/thread.c b/thread.c
index ab1863f..8c689bd 100644
--- a/thread.c
+++ b/thread.c
@@ -53,7 +53,6 @@
#define THREAD_DEBUG 0
#endif
-static void sleep_for_polling();
static void sleep_timeval(rb_thread_t *th, struct timeval time);
static void sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec);
static void sleep_forever(rb_thread_t *th);
@@ -62,7 +61,7 @@ struct timeval rb_time_interval(VALUE);
static int rb_thread_dead(rb_thread_t *th);
void rb_signal_exec(rb_thread_t *th, int sig);
-void rb_disable_interrupt();
+void rb_disable_interrupt(void);
static VALUE eKillSignal = INT2FIX(0);
static VALUE eTerminateSignal = INT2FIX(1);
@@ -595,7 +594,7 @@ rb_thread_sleep(int sec)
}
void
-rb_thread_schedule()
+rb_thread_schedule(void)
{
thread_debug("rb_thread_schedule\n");
if (!rb_thread_alone()) {
@@ -722,7 +721,7 @@ rb_thread_execute_interrupts(rb_thread_t *th)
void
-rb_gc_mark_threads()
+rb_gc_mark_threads(void)
{
/* TODO: remove */
}
@@ -905,7 +904,7 @@ rb_thread_s_kill(VALUE obj, VALUE th)
*/
static VALUE
-rb_thread_exit()
+rb_thread_exit(void)
{
return rb_thread_kill(GET_THREAD()->self);
}
@@ -1094,7 +1093,7 @@ rb_thread_s_main(VALUE klass)
*/
static VALUE
-rb_thread_s_abort_exc()
+rb_thread_s_abort_exc(void)
{
return GET_THREAD()->vm->thread_abort_on_exception ? Qtrue : Qfalse;
}
@@ -1980,8 +1979,7 @@ thgroup_list(VALUE group)
*/
VALUE
-thgroup_enclose(group)
- VALUE group;
+thgroup_enclose(VALUE group)
{
struct thgroup *data;
@@ -2501,7 +2499,7 @@ Init_Thread(void)
}
VALUE
-is_ruby_native_thread()
+is_ruby_native_thread(void)
{
return Qtrue;
}
diff --git a/util.c b/util.c
index ab6d7b8..9000a37 100644
--- a/util.c
+++ b/util.c
@@ -393,9 +393,7 @@ __crt0_glob_function(char *path)
#define mmarg mmkind, size, high, low
-static void mmswap_(a, b, mmarg)
- register char *a, *b;
- int mmarg;
+static void mmswap_(register char *a, register char *b, int mmkind, int size, int high, int low)
{
register int s;
if (a == b) return;
@@ -420,9 +418,7 @@ static void mmswap_(a, b, mmarg)
}
#define mmswap(a,b) mmswap_((a),(b),mmarg)
-static void mmrot3_(a, b, c, mmarg)
- register char *a, *b, *c;
- int mmarg;
+static void mmrot3_(register char *a, register char *b, register char *c, int mmkind, int size, int high, int low)
{
register int s;
if (mmkind >= 0) {
diff --git a/vm.c b/vm.c
index 8bec3bf..959f811 100644
--- a/vm.c
+++ b/vm.c
@@ -843,7 +843,7 @@ th_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
}
static struct RValues *
-new_value()
+new_value(void)
{
struct RValues *val = RVALUES(rb_newobj());
OBJSETUP(val, 0, T_VALUES);
diff --git a/vm_dump.c b/vm_dump.c
index b758337..235a516 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -576,7 +576,7 @@ thread_dump_state(VALUE self)
}
void
-yarv_bug()
+yarv_bug(void)
{
rb_thread_t *th = GET_THREAD();
VALUE bt;
diff --git a/yarvcore.h b/yarvcore.h
index b828968..189ae86 100644
--- a/yarvcore.h
+++ b/yarvcore.h
@@ -539,7 +539,7 @@ typedef struct {
#define ic_vmstat u3.cnt
typedef NODE *IC;
-void rb_vm_change_state();
+void rb_vm_change_state(void);
typedef VALUE CDHASH;