Protoized old pre-ANSI K&R style declarations and definitions

This commit is contained in:
Nobuyoshi Nakada 2021-05-07 00:04:36 +09:00
parent 99644514db
commit 0bbab1e515
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
10 changed files with 22 additions and 20 deletions

16
dln.c
View file

@ -312,7 +312,7 @@ dln_load(const char *file)
HINSTANCE handle;
WCHAR *winfile;
char message[1024];
void (*init_fct)();
void (*init_fct)(void);
char *buf;
/* Load the file as an object one */
@ -341,7 +341,7 @@ dln_load(const char *file)
}
#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);
}
@ -358,7 +358,7 @@ dln_load(const char *file)
#define DLN_DEFINED
{
void *handle;
void (*init_fct)();
void (*init_fct)(void);
#ifndef RTLD_LAZY
# define RTLD_LAZY 1
@ -393,7 +393,7 @@ dln_load(const char *file)
}
# endif
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
init_fct = (void(*)(void))(VALUE)dlsym(handle, buf);
if (init_fct == NULL) {
const size_t errlen = strlen(error = dln_strerror()) + 1;
error = memcpy(ALLOCA_N(char, errlen), error, errlen);
@ -412,7 +412,7 @@ dln_load(const char *file)
{
shl_t lib = NULL;
int flags;
void (*init_fct)();
void (*init_fct)(void);
flags = BIND_DEFERRED;
lib = shl_load(file, flags, 0);
@ -436,9 +436,9 @@ dln_load(const char *file)
#if defined(_AIX)
#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) {
aix_loaderror(file);
}
@ -467,7 +467,7 @@ dln_load(const char *file)
/* "file" is module file name .
"buf" is pointer to initial function name with "_" . */
void (*init_fct)();
void (*init_fct)(void);
dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file);