st.c: fix up

* st.c (_st_table_list, _st_table_pool): symbols beginning with an
  underscore and a lower letter are preserved by the standard.

* st.c (get_st_table): protoized.

* st.c (st_insert_generic): adjust local variable type to an
  argument argc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-12-19 12:20:21 +00:00
parent 602fda25ab
commit d20f4eb169

10
st.c
View File

@ -126,16 +126,16 @@
#define st_assert(cond) ((void)(0 && (cond))) #define st_assert(cond) ((void)(0 && (cond)))
#endif #endif
typedef struct _st_table_list { typedef struct st_table_list {
st_table table; st_table table;
struct list_node node; struct list_node node;
} st_table_list; } st_table_list;
struct _st_table_pool { struct st_table_pool {
struct list_head head; struct list_head head;
int length; int length;
}; };
static struct _st_table_pool st_table_pool; static struct st_table_pool st_table_pool;
#define ST_TABLE_POOL_MAX_LENGTH 500 #define ST_TABLE_POOL_MAX_LENGTH 500
/* The type of hashes. */ /* The type of hashes. */
@ -562,7 +562,7 @@ stat_col(void)
#endif #endif
static st_table * static st_table *
get_st_table() get_st_table(void)
{ {
st_table_list *table; st_table_list *table;
@ -2195,7 +2195,7 @@ st_insert_linear(st_table *tab, long argc, const VALUE *argv, VALUE hash)
static void static void
st_insert_generic(st_table *tab, long argc, const VALUE *argv, VALUE hash) st_insert_generic(st_table *tab, long argc, const VALUE *argv, VALUE hash)
{ {
int i; long i;
/* push elems */ /* push elems */
for (i = 0; i < argc; /* */) { for (i = 0; i < argc; /* */) {