ndentation fixups

This commit is contained in:
Richard Frith-Macdonald 2018-01-23 16:17:57 +00:00
parent 07ba3ec932
commit 746f2a2a1a
5 changed files with 54 additions and 52 deletions

View file

@ -39,7 +39,7 @@ typedef void* dl_symbol_t;
static int
__objc_dynamic_init(const char* exec_path)
{
return 0;
return 0;
}
/* Link in the module given by the name 'module'. Return a handle which can
@ -48,7 +48,7 @@ __objc_dynamic_init(const char* exec_path)
static dl_handle_t
__objc_dynamic_link(const char* module, int mode, const char* debug_file)
{
return (dl_handle_t)shl_load(module, LINK_FLAGS, 0L);
return (dl_handle_t)shl_load(module, LINK_FLAGS, 0L);
}
/* Return the address of a symbol given by the name 'symbol' from the module
@ -61,19 +61,19 @@ __objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
static dl_symbol_t
__objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
{
int ok;
void *value;
ok = shl_findsym(&handle, symbol, TYPE_UNDEFINED, value);
if (ok != 0)
value = 0;
return value;
int ok;
void *value;
ok = shl_findsym(&handle, symbol, TYPE_UNDEFINED, value);
if (ok != 0)
value = 0;
return value;
}
/* remove the code from memory associated with the module 'handle' */
static int
__objc_dynamic_unlink(dl_handle_t handle)
{
return shl_unload(handle);
return shl_unload(handle);
}
/* Print an error message (prefaced by 'error_string') relevant to the
@ -82,20 +82,20 @@ __objc_dynamic_unlink(dl_handle_t handle)
static void
__objc_dynamic_error(FILE *error_stream, const char *error_string)
{
fprintf(error_stream, "%s\n", error_string);
fprintf(error_stream, "%s\n", error_string);
}
/* Debugging: define these if they are available */
static int
__objc_dynamic_undefined_symbol_count(void)
{
return 0;
return 0;
}
static char**
__objc_dynamic_list_undefined_symbols(void)
{
return NULL;
return NULL;
}
// TODO: search for an hp-ux equivalent of dladdr() */

View file

@ -33,7 +33,7 @@ typedef void* dl_symbol_t;
static int
__objc_dynamic_init(const char* exec_path)
{
return -1;
return -1;
}
/* Link in the module given by the name 'module'. Return a handle which can
@ -42,7 +42,7 @@ __objc_dynamic_init(const char* exec_path)
static dl_handle_t
__objc_dynamic_link(const char* module, int mode, const char* debug_file)
{
return 0;
return 0;
}
/* Return the address of a symbol given by the name 'symbol' from the module
@ -55,14 +55,14 @@ __objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
static dl_symbol_t
__objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
{
return 0;
return 0;
}
/* remove the code from memory associated with the module 'handle' */
static int
__objc_dynamic_unlink(dl_handle_t handle)
{
return 0;
return 0;
}
/* Print an error message (prefaced by 'error_string') relevant to the
@ -71,20 +71,20 @@ __objc_dynamic_unlink(dl_handle_t handle)
static void
__objc_dynamic_error(FILE *error_stream, const char *error_string)
{
fprintf(error_stream, "%s\n", error_string);
fprintf(error_stream, "%s\n", error_string);
}
/* Debugging: define these if they are available */
static int
__objc_dynamic_undefined_symbol_count(void)
{
return 0;
return 0;
}
static char**
__objc_dynamic_list_undefined_symbols(void)
{
return NULL;
return NULL;
}
static char *

View file

@ -266,15 +266,17 @@ GSPrivateSymbolPath(Class theClass, Category *theCategory)
#elif LINKER_GETSYMBOL
NSString *GSPrivateSymbolPath(Class theClass, Category *theCategory)
{
void *addr = (NULL == theCategory) ? (void*)theClass : (void*)theCategory;
Dl_info info;
// This is correct: dladdr() does the opposite thing to all other UNIX
// functions.
if (0 == dladdr(addr, &info))
{
return nil;
}
return [NSString stringWithUTF8String: info.dli_fname];
void *addr = (NULL == theCategory) ? (void*)theClass : (void*)theCategory;
Dl_info info;
/* This is correct: dladdr() does the opposite thing to all other UNIX
* functions.
*/
if (0 == dladdr(addr, &info))
{
return nil;
}
return [NSString stringWithUTF8String: info.dli_fname];
}
#else
NSString *
@ -299,7 +301,7 @@ GSPrivateSymbolPath(Class theClass, Category *theCategory)
}
memcpy(p, "__objc_class_name_", sizeof(char)*18);
memcpy(&p[18*sizeof(char)], className, strlen(className) + 1);
memcpy(&p[18*sizeof(char)], className, strlen(className) + 1);
}
else
{
@ -318,10 +320,10 @@ GSPrivateSymbolPath(Class theClass, Category *theCategory)
memcpy(p, "__objc_category_name_", sizeof(char)*21);
memcpy(&p[21*sizeof(char)], theCategory->class_name,
strlen(theCategory->class_name) + 1);
strlen(theCategory->class_name) + 1);
memcpy(&p[strlen(p)], "_", 2*sizeof(char));
memcpy(&p[strlen(p)], theCategory->category_name,
strlen(theCategory->category_name) + 1);
strlen(theCategory->category_name) + 1);
}
ret = __objc_dynamic_get_symbol_path(0, p);

View file

@ -53,7 +53,7 @@ typedef void* dl_symbol_t;
static int
__objc_dynamic_init(const char* exec_path)
{
return 0;
return 0;
}
/* Link in the module given by the name 'module'. Return a handle which can
@ -63,18 +63,18 @@ static dl_handle_t
__objc_dynamic_link(const char* module, int mode, const char* debug_file)
{
#ifdef RTLD_NOLOAD
/*
* If we've got RTLD_NOLOAD, then ask the dynamic linker first to check if
* the library is already loaded. If it is, then just return a handle to
* it. If not, then load it again.
*/
void *handle = dlopen(module, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
if (NULL != handle)
{
return handle;
}
/*
* If we've got RTLD_NOLOAD, then ask the dynamic linker first to check if
* the library is already loaded. If it is, then just return a handle to
* it. If not, then load it again.
*/
void *handle = dlopen(module, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
if (NULL != handle)
{
return handle;
}
#endif
return (dl_handle_t)dlopen(module, RTLD_LAZY | RTLD_GLOBAL);
return (dl_handle_t)dlopen(module, RTLD_LAZY | RTLD_GLOBAL);
}
/* Return the address of a symbol given by the name 'symbol' from the module
@ -87,14 +87,14 @@ __objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
static dl_symbol_t
__objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
{
return dlsym(handle, (char*)symbol);
return dlsym(handle, (char*)symbol);
}
/* remove the code from memory associated with the module 'handle' */
static int
__objc_dynamic_unlink(dl_handle_t handle)
{
return dlclose(handle);
return dlclose(handle);
}
/* Print an error message (prefaced by 'error_string') relevant to the
@ -103,20 +103,20 @@ __objc_dynamic_unlink(dl_handle_t handle)
static void
__objc_dynamic_error(FILE *error_stream, const char *error_string)
{
fprintf(error_stream, "%s:%s\n", error_string, dlerror());
fprintf(error_stream, "%s:%s\n", error_string, dlerror());
}
/* Debugging: define these if they are available */
static int
__objc_dynamic_undefined_symbol_count(void)
{
return 0;
return 0;
}
static char**
__objc_dynamic_list_undefined_symbols(void)
{
return NULL;
return NULL;
}
static inline const char *

View file

@ -59,14 +59,14 @@ __objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
static dl_symbol_t
__objc_dynamic_find_symbol(dl_handle_t handle, const char* symbol)
{
return NULL;
return NULL;
}
/* remove the code from memory associated with the module 'handle' */
static int
__objc_dynamic_unlink(dl_handle_t handle)
{
return 0;
return 0;
}
static char *
@ -88,13 +88,13 @@ __objc_dynamic_error(FILE *error_stream, const char *error_string)
static int
__objc_dynamic_undefined_symbol_count(void)
{
return 0;
return 0;
}
static char**
__objc_dynamic_list_undefined_symbols(void)
{
return NULL;
return NULL;
}
#endif /* __sunos_load_h_INCLUDE */