Protoized old pre-ANSI K&R style declarations and definitions
This commit is contained in:
parent
99644514db
commit
0bbab1e515
16
dln.c
16
dln.c
@ -312,7 +312,7 @@ dln_load(const char *file)
|
|||||||
HINSTANCE handle;
|
HINSTANCE handle;
|
||||||
WCHAR *winfile;
|
WCHAR *winfile;
|
||||||
char message[1024];
|
char message[1024];
|
||||||
void (*init_fct)();
|
void (*init_fct)(void);
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
/* Load the file as an object one */
|
/* Load the file as an object one */
|
||||||
@ -341,7 +341,7 @@ dln_load(const char *file)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((init_fct = (void(*)())GetProcAddress(handle, buf)) == NULL) {
|
if ((init_fct = (void(*)(void))GetProcAddress(handle, buf)) == NULL) {
|
||||||
dln_loaderror("%s - %s\n%s", dln_strerror(), buf, file);
|
dln_loaderror("%s - %s\n%s", dln_strerror(), buf, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ dln_load(const char *file)
|
|||||||
#define DLN_DEFINED
|
#define DLN_DEFINED
|
||||||
{
|
{
|
||||||
void *handle;
|
void *handle;
|
||||||
void (*init_fct)();
|
void (*init_fct)(void);
|
||||||
|
|
||||||
#ifndef RTLD_LAZY
|
#ifndef RTLD_LAZY
|
||||||
# define RTLD_LAZY 1
|
# define RTLD_LAZY 1
|
||||||
@ -393,7 +393,7 @@ dln_load(const char *file)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
|
init_fct = (void(*)(void))(VALUE)dlsym(handle, buf);
|
||||||
if (init_fct == NULL) {
|
if (init_fct == NULL) {
|
||||||
const size_t errlen = strlen(error = dln_strerror()) + 1;
|
const size_t errlen = strlen(error = dln_strerror()) + 1;
|
||||||
error = memcpy(ALLOCA_N(char, errlen), error, errlen);
|
error = memcpy(ALLOCA_N(char, errlen), error, errlen);
|
||||||
@ -412,7 +412,7 @@ dln_load(const char *file)
|
|||||||
{
|
{
|
||||||
shl_t lib = NULL;
|
shl_t lib = NULL;
|
||||||
int flags;
|
int flags;
|
||||||
void (*init_fct)();
|
void (*init_fct)(void);
|
||||||
|
|
||||||
flags = BIND_DEFERRED;
|
flags = BIND_DEFERRED;
|
||||||
lib = shl_load(file, flags, 0);
|
lib = shl_load(file, flags, 0);
|
||||||
@ -436,9 +436,9 @@ dln_load(const char *file)
|
|||||||
#if defined(_AIX)
|
#if defined(_AIX)
|
||||||
#define DLN_DEFINED
|
#define DLN_DEFINED
|
||||||
{
|
{
|
||||||
void (*init_fct)();
|
void (*init_fct)(void);
|
||||||
|
|
||||||
init_fct = (void(*)())load((char*)file, 1, 0);
|
init_fct = (void(*)(void))load((char*)file, 1, 0);
|
||||||
if (init_fct == NULL) {
|
if (init_fct == NULL) {
|
||||||
aix_loaderror(file);
|
aix_loaderror(file);
|
||||||
}
|
}
|
||||||
@ -467,7 +467,7 @@ dln_load(const char *file)
|
|||||||
/* "file" is module file name .
|
/* "file" is module file name .
|
||||||
"buf" is pointer to initial function name with "_" . */
|
"buf" is pointer to initial function name with "_" . */
|
||||||
|
|
||||||
void (*init_fct)();
|
void (*init_fct)(void);
|
||||||
|
|
||||||
|
|
||||||
dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file);
|
dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file);
|
||||||
|
@ -48,7 +48,7 @@ rb_f_at_exit(VALUE _)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct end_proc_data {
|
struct end_proc_data {
|
||||||
void (*func) ();
|
void (*func) (VALUE);
|
||||||
VALUE data;
|
VALUE data;
|
||||||
struct end_proc_data *next;
|
struct end_proc_data *next;
|
||||||
};
|
};
|
||||||
|
4
gc.c
4
gc.c
@ -2382,7 +2382,7 @@ rvargc_find_region(size_t size, rb_ractor_t *cr, RVALUE *freelist)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_slot_size()
|
rb_slot_size(void)
|
||||||
{
|
{
|
||||||
return sizeof(RVALUE);
|
return sizeof(RVALUE);
|
||||||
}
|
}
|
||||||
@ -4592,7 +4592,7 @@ obj_memsize_of(VALUE obj, int use_all_types)
|
|||||||
case T_HASH:
|
case T_HASH:
|
||||||
if (RHASH_AR_TABLE_P(obj)) {
|
if (RHASH_AR_TABLE_P(obj)) {
|
||||||
if (RHASH_AR_TABLE(obj) != NULL) {
|
if (RHASH_AR_TABLE(obj) != NULL) {
|
||||||
size_t rb_hash_ar_table_size();
|
size_t rb_hash_ar_table_size(void);
|
||||||
size += rb_hash_ar_table_size();
|
size += rb_hash_ar_table_size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
hash.c
2
hash.c
@ -4820,7 +4820,7 @@ extern char **environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline rb_encoding *
|
static inline rb_encoding *
|
||||||
env_encoding()
|
env_encoding(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return rb_utf8_encoding();
|
return rb_utf8_encoding();
|
||||||
|
@ -47,7 +47,7 @@ typedef pthread_cond_t rb_nativethread_cond_t;
|
|||||||
|
|
||||||
RUBY_SYMBOL_EXPORT_BEGIN
|
RUBY_SYMBOL_EXPORT_BEGIN
|
||||||
|
|
||||||
rb_nativethread_id_t rb_nativethread_self();
|
rb_nativethread_id_t rb_nativethread_self(void);
|
||||||
|
|
||||||
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
|
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock);
|
||||||
void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
|
void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
|
||||||
|
@ -114,7 +114,7 @@ void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
|
|||||||
void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
|
void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
|
||||||
void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
|
void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
|
||||||
void ruby_sized_xfree(void *x, size_t size);
|
void ruby_sized_xfree(void *x, size_t size);
|
||||||
int rb_slot_size();
|
int rb_slot_size(void);
|
||||||
RUBY_SYMBOL_EXPORT_END
|
RUBY_SYMBOL_EXPORT_END
|
||||||
|
|
||||||
MJIT_SYMBOL_EXPORT_BEGIN
|
MJIT_SYMBOL_EXPORT_BEGIN
|
||||||
|
@ -102,7 +102,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
|
|||||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// on Darwin, TLS can not be accessed across .so
|
// on Darwin, TLS can not be accessed across .so
|
||||||
struct rb_execution_context_struct *rb_current_ec();
|
struct rb_execution_context_struct *rb_current_ec(void);
|
||||||
void rb_current_ec_set(struct rb_execution_context_struct *);
|
void rb_current_ec_set(struct rb_execution_context_struct *);
|
||||||
#else
|
#else
|
||||||
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
|
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;
|
||||||
|
@ -1857,7 +1857,7 @@ vm_search_method(VALUE cd_owner, struct rb_call_data *cd, VALUE recv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
check_cfunc(const rb_callable_method_entry_t *me, VALUE (*func)())
|
check_cfunc(const rb_callable_method_entry_t *me, VALUE (*func)(ANYARGS))
|
||||||
{
|
{
|
||||||
if (! me) {
|
if (! me) {
|
||||||
return false;
|
return false;
|
||||||
@ -1876,7 +1876,7 @@ check_cfunc(const rb_callable_method_entry_t *me, VALUE (*func)())
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
vm_method_cfunc_is(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv, VALUE (*func)())
|
vm_method_cfunc_is(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv, VALUE (*func)(ANYARGS))
|
||||||
{
|
{
|
||||||
VM_ASSERT(iseq != NULL);
|
VM_ASSERT(iseq != NULL);
|
||||||
const struct rb_callcache *cc = vm_search_method((VALUE)iseq, cd, recv);
|
const struct rb_callcache *cc = vm_search_method((VALUE)iseq, cd, recv);
|
||||||
|
@ -416,7 +416,7 @@ static VALUE
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_method_cfunc_struct(rb_method_cfunc_t *cfunc, VALUE (*func)(), int argc)
|
setup_method_cfunc_struct(rb_method_cfunc_t *cfunc, VALUE (*func)(ANYARGS), int argc)
|
||||||
{
|
{
|
||||||
cfunc->func = func;
|
cfunc->func = func;
|
||||||
cfunc->argc = argc;
|
cfunc->argc = argc;
|
||||||
|
@ -166,6 +166,8 @@ struct __sbuf {
|
|||||||
*
|
*
|
||||||
* NB: see WARNING above before changing the layout of this structure!
|
* NB: see WARNING above before changing the layout of this structure!
|
||||||
*/
|
*/
|
||||||
|
struct __suio;
|
||||||
|
|
||||||
typedef struct __sFILE {
|
typedef struct __sFILE {
|
||||||
unsigned char *_p; /* current position in (some) buffer */
|
unsigned char *_p; /* current position in (some) buffer */
|
||||||
#if 0
|
#if 0
|
||||||
@ -178,8 +180,8 @@ typedef struct __sFILE {
|
|||||||
#if 0
|
#if 0
|
||||||
size_t _lbfsize; /* 0 or -_bf._size, for inline putc */
|
size_t _lbfsize; /* 0 or -_bf._size, for inline putc */
|
||||||
#endif
|
#endif
|
||||||
int (*vwrite)(/* struct __sFILE*, struct __suio * */);
|
int (*vwrite)(struct __sFILE*, struct __suio *);
|
||||||
const char *(*vextra)(/* struct __sFILE*, size_t, void*, long*, int */);
|
const char *(*vextra)(struct __sFILE*, size_t, void*, long*, int);
|
||||||
} FILE;
|
} FILE;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user