diff options
author | Nicholas Clark <nick@ccl4.org> | 2022-08-05 15:05:54 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2022-08-19 14:36:39 +0200 |
commit | c3d21af2da4882bcb0aa19d4a8ea05b5cf0ec6cc (patch) | |
tree | 2ed124cba0f5d2390193aec365fff5867f4269ef /ext/DynaLoader | |
parent | 7aa33fb654378247f1b9e8253fe0b99e077b6f04 (diff) | |
download | perl-c3d21af2da4882bcb0aa19d4a8ea05b5cf0ec6cc.tar.gz |
dl_dyld.xs should not create a `mode` variable only to ignore it
This unused variable dates back to when the file was first added. The code
was structured as a static C wrapper emulating the dlopen() API with the
native APIs, and then a copy of the existing XS code that called dlopen().
However, there is (and was) no need to keep it exactly this way, as the
wrapper is only visible inside this file, meaning that it does not need to
conform to any externally defined prototype.
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r-- | ext/DynaLoader/DynaLoader_pm.PL | 2 | ||||
-rw-r--r-- | ext/DynaLoader/dl_dyld.xs | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 93a858a0b3..0cef38e77f 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -90,7 +90,7 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - our $VERSION = '1.52'; + our $VERSION = '1.53'; } # Note: in almost any other piece of code "our" would have been a better diff --git a/ext/DynaLoader/dl_dyld.xs b/ext/DynaLoader/dl_dyld.xs index 38a38400d4..716c6ea421 100644 --- a/ext/DynaLoader/dl_dyld.xs +++ b/ext/DynaLoader/dl_dyld.xs @@ -104,7 +104,7 @@ static void TranslateError sv_setpv(MY_CXT.x_dl_last_error, error); } -static char *dlopen(char *path, int mode /* mode is ignored */) +static char *dlopen(char *path) { int dyld_result; NSObjectFileImage ofile; @@ -159,13 +159,11 @@ void * dl_load_file(filename, flags=0) char * filename int flags - PREINIT: - int mode = 1; CODE: DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags)); if (flags & 0x01) Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename); - RETVAL = dlopen(filename, mode) ; + RETVAL = dlopen(filename); DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) |