mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c65638ce29
commit
e29b4b4862
3 changed files with 13 additions and 12 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jan 9 13:26:18 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* st.h, st.c: Back out the introduction of st_*_func_t. Some
|
||||||
|
compilers complain about function type mismatch.
|
||||||
|
|
||||||
Wed Jan 08 17:10:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Jan 08 17:10:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/Win32API/lib/win32/registry.rb: added. [new]
|
* ext/Win32API/lib/win32/registry.rb: added. [new]
|
||||||
|
|
|
||||||
6
st.c
6
st.c
|
|
@ -43,8 +43,8 @@ static struct st_hash_type type_numhash = {
|
||||||
/* extern int strcmp(const char *, const char *); */
|
/* extern int strcmp(const char *, const char *); */
|
||||||
static int strhash(const char *);
|
static int strhash(const char *);
|
||||||
static struct st_hash_type type_strhash = {
|
static struct st_hash_type type_strhash = {
|
||||||
(st_compare_func_t)strcmp,
|
strcmp,
|
||||||
(st_hash_func_t)strhash,
|
strhash,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef RUBY_PLATFORM
|
#ifdef RUBY_PLATFORM
|
||||||
|
|
@ -482,7 +482,7 @@ st_cleanup_safe(table, never)
|
||||||
void
|
void
|
||||||
st_foreach(table, func, arg)
|
st_foreach(table, func, arg)
|
||||||
st_table *table;
|
st_table *table;
|
||||||
st_each_func_t func;
|
int (*func)();
|
||||||
st_data_t arg;
|
st_data_t arg;
|
||||||
{
|
{
|
||||||
st_table_entry *ptr, *last, *tmp;
|
st_table_entry *ptr, *last, *tmp;
|
||||||
|
|
|
||||||
14
st.h
14
st.h
|
|
@ -8,15 +8,11 @@
|
||||||
|
|
||||||
typedef long st_data_t;
|
typedef long st_data_t;
|
||||||
|
|
||||||
typedef int (*st_compare_func_t)(st_data_t data1, st_data_t data2);
|
|
||||||
typedef int (*st_hash_func_t)(st_data_t data);
|
|
||||||
typedef int (*st_each_func_t)(st_data_t key, st_data_t value, st_data_t data);
|
|
||||||
|
|
||||||
typedef struct st_table st_table;
|
typedef struct st_table st_table;
|
||||||
|
|
||||||
struct st_hash_type {
|
struct st_hash_type {
|
||||||
st_compare_func_t compare;
|
int (*compare)();
|
||||||
st_hash_func_t hash;
|
int (*hash)();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct st_table {
|
struct st_table {
|
||||||
|
|
@ -40,14 +36,14 @@ int st_delete(st_table *, st_data_t *, st_data_t *);
|
||||||
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
|
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
|
||||||
int st_insert(st_table *, st_data_t, st_data_t);
|
int st_insert(st_table *, st_data_t, st_data_t);
|
||||||
int st_lookup(st_table *, st_data_t, st_data_t *);
|
int st_lookup(st_table *, st_data_t, st_data_t *);
|
||||||
void st_foreach(st_table *, st_each_func_t, st_data_t);
|
void st_foreach(st_table *, int (*)(), st_data_t);
|
||||||
void st_add_direct(st_table *, st_data_t, st_data_t);
|
void st_add_direct(st_table *, st_data_t, st_data_t);
|
||||||
void st_free_table(st_table *);
|
void st_free_table(st_table *);
|
||||||
void st_cleanup_safe(st_table *, st_data_t);
|
void st_cleanup_safe(st_table *, st_data_t);
|
||||||
st_table *st_copy(st_table *);
|
st_table *st_copy(st_table *);
|
||||||
|
|
||||||
#define ST_NUMCMP ((st_compare_func_t) 0)
|
#define ST_NUMCMP ((int (*)()) 0)
|
||||||
#define ST_NUMHASH ((st_hash_func_t) -2)
|
#define ST_NUMHASH ((int (*)()) -2)
|
||||||
|
|
||||||
#define st_numcmp ST_NUMCMP
|
#define st_numcmp ST_NUMCMP
|
||||||
#define st_numhash ST_NUMHASH
|
#define st_numhash ST_NUMHASH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue