Skip to content

Commit e29b4b4

Browse files
committed
* st.h, st.c: Back out the introduction of st_*_func_t. Some
compilers complain about function type mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c65638c commit e29b4b4

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Thu Jan 9 13:26:18 2003 Akinori MUSHA <knu@iDaemons.org>
2+
3+
* st.h, st.c: Back out the introduction of st_*_func_t. Some
4+
compilers complain about function type mismatch.
5+
16
Wed Jan 08 17:10:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
27

38
* ext/Win32API/lib/win32/registry.rb: added. [new]

st.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ static struct st_hash_type type_numhash = {
4343
/* extern int strcmp(const char *, const char *); */
4444
static int strhash(const char *);
4545
static struct st_hash_type type_strhash = {
46-
(st_compare_func_t)strcmp,
47-
(st_hash_func_t)strhash,
46+
strcmp,
47+
strhash,
4848
};
4949

5050
#ifdef RUBY_PLATFORM
@@ -482,7 +482,7 @@ st_cleanup_safe(table, never)
482482
void
483483
st_foreach(table, func, arg)
484484
st_table *table;
485-
st_each_func_t func;
485+
int (*func)();
486486
st_data_t arg;
487487
{
488488
st_table_entry *ptr, *last, *tmp;

st.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88

99
typedef long st_data_t;
1010

11-
typedef int (*st_compare_func_t)(st_data_t data1, st_data_t data2);
12-
typedef int (*st_hash_func_t)(st_data_t data);
13-
typedef int (*st_each_func_t)(st_data_t key, st_data_t value, st_data_t data);
14-
1511
typedef struct st_table st_table;
1612

1713
struct st_hash_type {
18-
st_compare_func_t compare;
19-
st_hash_func_t hash;
14+
int (*compare)();
15+
int (*hash)();
2016
};
2117

2218
struct st_table {
@@ -40,14 +36,14 @@ int st_delete(st_table *, st_data_t *, st_data_t *);
4036
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
4137
int st_insert(st_table *, st_data_t, st_data_t);
4238
int st_lookup(st_table *, st_data_t, st_data_t *);
43-
void st_foreach(st_table *, st_each_func_t, st_data_t);
39+
void st_foreach(st_table *, int (*)(), st_data_t);
4440
void st_add_direct(st_table *, st_data_t, st_data_t);
4541
void st_free_table(st_table *);
4642
void st_cleanup_safe(st_table *, st_data_t);
4743
st_table *st_copy(st_table *);
4844

49-
#define ST_NUMCMP ((st_compare_func_t) 0)
50-
#define ST_NUMHASH ((st_hash_func_t) -2)
45+
#define ST_NUMCMP ((int (*)()) 0)
46+
#define ST_NUMHASH ((int (*)()) -2)
5147

5248
#define st_numcmp ST_NUMCMP
5349
#define st_numhash ST_NUMHASH

0 commit comments

Comments
 (0)