]> granicus.if.org Git - vim/commitdiff
patch 8.0.0199: compiler warnings for libcall v8.0.0199
authorBram Moolenaar <Bram@vim.org>
Tue, 17 Jan 2017 15:56:28 +0000 (16:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Jan 2017 15:56:28 +0000 (16:56 +0100)
Problem:    Warning for an unused parameter when the libcall feature is
            disabled.  Warning for a function type cast when compiling with
            -pedantic.
Solution:   Add UNUSED.  Use a different type cast. (Damien Molinier)

src/evalfunc.c
src/os_unix.c
src/version.c

index 768a0f1574405ab8b987eba4cbf727460c8175a5..4b6bfaa1379cff12bf582ffb46c6d856dd3a805e 100644 (file)
@@ -6859,10 +6859,8 @@ f_len(typval_T *argvars, typval_T *rettv)
     }
 }
 
-static void libcall_common(typval_T *argvars, typval_T *rettv, int type);
-
     static void
-libcall_common(typval_T *argvars, typval_T *rettv, int type)
+libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
 {
 #ifdef FEAT_LIBCALL
     char_u             *string_in;
index aa3c3e506d8787c763071d390868a85147e20f8f..48359d31ea1217cd93616e0708c96f98f023f9a5 100644 (file)
@@ -6918,7 +6918,7 @@ mch_libcall(
            if (argstring != NULL)
            {
 # if defined(USE_DLOPEN)
-               ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
+               *(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
                dlerr = (char *)dlerror();
 # else
                if (shl_findsym(&hinstLib, (const char *)funcname,
@@ -6940,7 +6940,7 @@ mch_libcall(
            else
            {
 # if defined(USE_DLOPEN)
-               ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
+               *(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
                dlerr = (char *)dlerror();
 # else
                if (shl_findsym(&hinstLib, (const char *)funcname,
index d826cb31f30ab3ac6fff13d95fb7c26f34be6b03..50bcce0ba84af78ff322353eaa9626af70432c00 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    199,
 /**/
     198,
 /**/