changeset 49843:e0af66d6e968

8201226: missing JNIEXPORT / JNICALL at some places in function declarations/implementations Reviewed-by: ihse, mdoerr Contributed-by: matthias.baesken@sap.com, alexey.ivanov@oracle.com
author mbaesken
date Tue, 10 Apr 2018 08:38:56 +0200
parents 8c1a4628b2f0
children fa6f8bce6490
files src/hotspot/share/classfile/classLoader.cpp src/java.base/share/native/launcher/main.c src/java.base/share/native/libjimage/jimage.cpp src/java.base/share/native/libjimage/jimage.hpp src/java.base/share/native/libzip/CRC32.c src/java.base/share/native/libzip/zip_util.c src/java.base/share/native/libzip/zip_util.h src/java.desktop/share/native/common/awt/medialib/mlib_ImageCreate.c src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.c src/java.desktop/share/native/libmlib_image/mlib_ImageConvKernelConvert.c src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN.c src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp.c src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c src/jdk.pack/share/native/unpack200/main.cpp
diffstat 15 files changed, 46 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classLoader.cpp	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/hotspot/share/classfile/classLoader.cpp	Tue Apr 10 08:38:56 2018 +0200
@@ -80,13 +80,13 @@
 
 // Entry points in zip.dll for loading zip/jar file entries
 
-typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg);
-typedef void (JNICALL *ZipClose_t)(jzfile *zip);
-typedef jzentry* (JNICALL *FindEntry_t)(jzfile *zip, const char *name, jint *sizeP, jint *nameLen);
-typedef jboolean (JNICALL *ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
-typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n);
-typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
-typedef jint     (JNICALL *Crc32_t)(jint crc, const jbyte *buf, jint len);
+typedef void * * (*ZipOpen_t)(const char *name, char **pmsg);
+typedef void (*ZipClose_t)(jzfile *zip);
+typedef jzentry* (*FindEntry_t)(jzfile *zip, const char *name, jint *sizeP, jint *nameLen);
+typedef jboolean (*ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
+typedef jzentry* (*GetNextEntry_t)(jzfile *zip, jint n);
+typedef jboolean (*ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
+typedef jint     (*Crc32_t)(jint crc, const jbyte *buf, jint len);
 
 static ZipOpen_t         ZipOpen            = NULL;
 static ZipClose_t        ZipClose           = NULL;
--- a/src/java.base/share/native/launcher/main.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/launcher/main.c	Tue Apr 10 08:38:56 2018 +0200
@@ -93,7 +93,7 @@
     __initenv = _environ;
 
 #else /* JAVAW */
-JNIEXPORT int JNICALL
+JNIEXPORT int
 main(int argc, char **argv)
 {
     int margc;
--- a/src/java.base/share/native/libjimage/jimage.cpp	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/libjimage/jimage.cpp	Tue Apr 10 08:38:56 2018 +0200
@@ -55,7 +55,7 @@
  *   }
  *   ...
  */
-extern "C" JNIEXPORT JImageFile* JNICALL
+extern "C" JNIEXPORT JImageFile*
 JIMAGE_Open(const char *name, jint* error) {
     // TODO - return a meaningful error code
     *error = 0;
@@ -72,7 +72,7 @@
  * Ex.
  *  (*JImageClose)(image);
  */
-extern "C" JNIEXPORT void JNICALL
+extern "C" JNIEXPORT void
 JIMAGE_Close(JImageFile* image) {
     ImageFileReader::close((ImageFileReader*) image);
 }
@@ -89,7 +89,7 @@
  *  tty->print_cr(package);
  *  -> java.base
  */
-extern "C" JNIEXPORT const char* JNICALL
+extern "C" JNIEXPORT const char*
 JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
     return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name);
 }
@@ -108,7 +108,7 @@
  *   JImageLocationRef location = (*JImageFindResource)(image,
  *                                 "java.base", "9.0", "java/lang/String.class", &size);
  */
-extern "C" JNIEXPORT JImageLocationRef JNICALL
+extern "C" JNIEXPORT JImageLocationRef
 JIMAGE_FindResource(JImageFile* image,
         const char* module_name, const char* version, const char* name,
         jlong* size) {
@@ -155,7 +155,7 @@
  *  char* buffer = new char[size];
  *  (*JImageGetResource)(image, location, buffer, size);
  */
-extern "C" JNIEXPORT jlong JNICALL
+extern "C" JNIEXPORT jlong
 JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
         char* buffer, jlong size) {
     ((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer);
@@ -184,7 +184,7 @@
  *   }
  *   (*JImageResourceIterator)(image, ctw_visitor, loader);
  */
-extern "C" JNIEXPORT void JNICALL
+extern "C" JNIEXPORT void
 JIMAGE_ResourceIterator(JImageFile* image,
         JImageResourceVisitor_t visitor, void* arg) {
     ImageFileReader* imageFile = (ImageFileReader*) image;
@@ -226,7 +226,7 @@
  *   char path[JIMAGE_MAX_PATH];
  *    (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
  */
-extern "C" JNIEXPORT bool JNICALL
+extern "C" JNIEXPORT bool
 JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
                                     char* path, size_t max) {
     ImageFileReader* imageFile = (ImageFileReader*) image;
--- a/src/java.base/share/native/libjimage/jimage.hpp	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/libjimage/jimage.hpp	Tue Apr 10 08:38:56 2018 +0200
@@ -72,7 +72,7 @@
  *   ...
  */
 
-extern "C" JNIEXPORT JImageFile* JNICALL
+extern "C" JNIEXPORT JImageFile*
 JIMAGE_Open(const char *name, jint* error);
 
 typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
@@ -87,7 +87,7 @@
  *  (*JImageClose)(image);
  */
 
-extern "C" JNIEXPORT void JNICALL
+extern "C" JNIEXPORT void
 JIMAGE_Close(JImageFile* jimage);
 
 typedef void (*JImageClose_t)(JImageFile* jimage);
@@ -106,7 +106,7 @@
  *  -> java.base
  */
 
-extern "C" JNIEXPORT const char * JNICALL
+extern "C" JNIEXPORT const char *
 JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
 
 typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name);
@@ -150,7 +150,7 @@
  *  char* buffer = new char[size];
  *  (*JImageGetResource)(image, location, buffer, size);
  */
-extern "C" JNIEXPORT jlong JNICALL
+extern "C" JNIEXPORT jlong
 JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
         char* buffer, jlong size);
 
@@ -185,7 +185,7 @@
         const char* module_name, const char* version, const char* package,
         const char* name, const char* extension, void* arg);
 
-extern "C" JNIEXPORT void JNICALL
+extern "C" JNIEXPORT void
 JIMAGE_ResourceIterator(JImageFile* jimage,
         JImageResourceVisitor_t visitor, void *arg);
 
@@ -202,7 +202,7 @@
  *   char path[JIMAGE_MAX_PATH];
  *    (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
  */
-extern "C" JNIEXPORT bool JNICALL
+extern "C" JNIEXPORT bool
 JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
                                     char* path, size_t max);
 
--- a/src/java.base/share/native/libzip/CRC32.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/libzip/CRC32.c	Tue Apr 10 08:38:56 2018 +0200
@@ -54,7 +54,7 @@
     return crc;
 }
 
-JNIEXPORT jint JNICALL
+JNIEXPORT jint
 ZIP_CRC32(jint crc, const jbyte *buf, jint len)
 {
     return crc32(crc, (Bytef*)buf, len);
--- a/src/java.base/share/native/libzip/zip_util.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/libzip/zip_util.c	Tue Apr 10 08:38:56 2018 +0200
@@ -881,7 +881,7 @@
  * set to the error message text if msg != 0. Otherwise, *msg will be
  * set to NULL. Caller doesn't need to free the error message.
  */
-JNIEXPORT jzfile * JNICALL
+JNIEXPORT jzfile *
 ZIP_Open(const char *name, char **pmsg)
 {
     jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
@@ -895,7 +895,7 @@
 /*
  * Closes the specified zip file object.
  */
-JNIEXPORT void JNICALL
+JNIEXPORT void
 ZIP_Close(jzfile *zip)
 {
     MLOCK(zfiles_lock);
@@ -1115,7 +1115,7 @@
  * Returns the zip entry corresponding to the specified name, or
  * NULL if not found.
  */
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_GetEntry(jzfile *zip, char *name, jint ulen)
 {
     if (ulen == 0) {
@@ -1238,7 +1238,7 @@
  * Returns the n'th (starting at zero) zip file entry, or NULL if the
  * specified index was out of range.
  */
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_GetNextEntry(jzfile *zip, jint n)
 {
     jzentry *result;
@@ -1439,7 +1439,7 @@
  * The current implementation does not support reading an entry that
  * has the size bigger than 2**32 bytes in ONE invocation.
  */
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
 {
     jzentry *entry = ZIP_GetEntry(zip, name, 0);
@@ -1456,7 +1456,7 @@
  * Note: this is called from the separately delivered VM (hotspot/classic)
  * so we have to be careful to maintain the expected behaviour.
  */
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
 {
     char *msg;
@@ -1515,7 +1515,7 @@
     return JNI_TRUE;
 }
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
 {
     z_stream strm;
--- a/src/java.base/share/native/libzip/zip_util.h	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.base/share/native/libzip/zip_util.h	Tue Apr 10 08:38:56 2018 +0200
@@ -241,16 +241,16 @@
  */
 #define ZIP_ENDCHAIN ((jint)-1)
 
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP);
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entrynm);
 
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_GetNextEntry(jzfile *zip, jint n);
 
-JNIEXPORT jzfile * JNICALL
+JNIEXPORT jzfile *
 ZIP_Open(const char *name, char **pmsg);
 
 jzfile *
@@ -265,10 +265,10 @@
 jzfile *
 ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap);
 
-JNIEXPORT void JNICALL
+JNIEXPORT void
 ZIP_Close(jzfile *zip);
 
-JNIEXPORT jzentry * JNICALL
+JNIEXPORT jzentry *
 ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
 JNIEXPORT void JNICALL
 ZIP_Lock(jzfile *zip);
@@ -281,7 +281,7 @@
 jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
 jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash);
 
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jboolean
 ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
 
 #endif /* !_ZIP_H_ */
--- a/src/java.desktop/share/native/common/awt/medialib/mlib_ImageCreate.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/common/awt/medialib/mlib_ImageCreate.c	Tue Apr 10 08:38:56 2018 +0200
@@ -227,7 +227,7 @@
 }
 
 /***************************************************************/
-mlib_image *mlib_ImageCreateStruct(mlib_type  type,
+JNIEXPORT mlib_image* JNICALL mlib_ImageCreateStruct(mlib_type  type,
                                    mlib_s32   channels,
                                    mlib_s32   width,
                                    mlib_s32   height,
@@ -253,7 +253,7 @@
 }
 
 /***************************************************************/
-mlib_image *mlib_ImageCreate(mlib_type type,
+JNIEXPORT mlib_image* JNICALL mlib_ImageCreate(mlib_type type,
                              mlib_s32  channels,
                              mlib_s32  width,
                              mlib_s32  height)
@@ -352,7 +352,7 @@
 }
 
 /***************************************************************/
-void mlib_ImageDelete(mlib_image *img)
+JNIEXPORT void JNICALL mlib_ImageDelete(mlib_image *img)
 {
   if (img == NULL) return;
   if ((img -> flags & MLIB_IMAGE_USERALLOCATED) == 0) {
--- a/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.c	Tue Apr 10 08:38:56 2018 +0200
@@ -299,7 +299,7 @@
 }
 
 /***************************************************************/
-mlib_status mlib_ImageAffine(mlib_image       *dst,
+JNIEXPORT mlib_status JNICALL mlib_ImageAffine(mlib_image       *dst,
                              const mlib_image *src,
                              const mlib_d64   *mtx,
                              mlib_filter      filter,
--- a/src/java.desktop/share/native/libmlib_image/mlib_ImageConvKernelConvert.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/libmlib_image/mlib_ImageConvKernelConvert.c	Tue Apr 10 08:38:56 2018 +0200
@@ -78,7 +78,7 @@
 #endif /* __sparc */
 
 /***************************************************************/
-mlib_status mlib_ImageConvKernelConvert(mlib_s32       *ikernel,
+JNIEXPORT mlib_status JNICALL mlib_ImageConvKernelConvert(mlib_s32       *ikernel,
                                         mlib_s32       *iscale,
                                         const mlib_d64 *fkernel,
                                         mlib_s32       m,
--- a/src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN.c	Tue Apr 10 08:38:56 2018 +0200
@@ -90,7 +90,7 @@
 #include "mlib_ImageConvEdge.h"
 
 /***************************************************************/
-mlib_status mlib_ImageConvMxN(mlib_image       *dst,
+JNIEXPORT mlib_status JNICALL mlib_ImageConvMxN(mlib_image       *dst,
                               const mlib_image *src,
                               const mlib_s32   *kernel,
                               mlib_s32         m,
--- a/src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp.c	Tue Apr 10 08:38:56 2018 +0200
@@ -78,7 +78,7 @@
 #include "mlib_c_ImageLookUp.h"
 
 /***************************************************************/
-mlib_status mlib_ImageLookUp(mlib_image       *dst,
+JNIEXPORT mlib_status JNICALL mlib_ImageLookUp(mlib_image       *dst,
                              const mlib_image *src,
                              const void       **table)
 {
--- a/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h	Tue Apr 10 08:38:56 2018 +0200
@@ -132,9 +132,6 @@
 
 unsigned SplashTime();
 char* SplashConvertStringAlloc(const char* in, int *size);
-jboolean SplashGetScaledImageName(const char* jarName,
-                 const char* fileName, float *scaleFactor,
-                 char *scaleImageName, const size_t scaledImageNameLength);
 void SplashLock(Splash * splash);
 void SplashUnlock(Splash * splash);
 
@@ -157,8 +154,7 @@
 void SplashUpdateScreenData(Splash * splash);
 
 void SplashCleanup(Splash * splash);
-void SplashSetScaleFactor(float scaleFactor);
-int  SplashGetScaledImgNameMaxPstfixLen(const char *fileName);
+
 void cleanUp(char *fName, char *xName, char *pctName, float *scaleFactor);
 jboolean GetScaledImageName(const char *fileName, char *scaledImgName,
                   float *scaleFactor, const size_t scaledImageLength);
--- a/src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c	Tue Apr 10 08:38:56 2018 +0200
@@ -574,7 +574,7 @@
     PostMessage(splash->hWnd, WM_SPLASHRECONFIGURE, 0, 0);
 }
 
-jboolean
+JNIEXPORT jboolean JNICALL
 SplashGetScaledImageName(const char* jarName, const char* fileName,
                            float *scaleFactor, char *scaleImageName,
                            const size_t scaledImageLength)
--- a/src/jdk.pack/share/native/unpack200/main.cpp	Tue Apr 17 15:54:14 2018 +0200
+++ b/src/jdk.pack/share/native/unpack200/main.cpp	Tue Apr 10 08:38:56 2018 +0200
@@ -59,7 +59,7 @@
 #include "unpack.h"
 
 
-JNIEXPORT int JNICALL
+JNIEXPORT int
 main(int argc, char **argv) {
     return unpacker::run(argc, argv);
 }