8201226: missing JNIEXPORT / JNICALL at some places in function declarations/implementations

Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Reviewed-by: ihse, mdoerr
This commit is contained in:
Matthias Baesken 2018-04-10 08:38:56 +02:00
parent a9b0242eef
commit cfcd657702
15 changed files with 46 additions and 50 deletions

View File

@ -80,13 +80,13 @@
// Entry points in zip.dll for loading zip/jar file entries // Entry points in zip.dll for loading zip/jar file entries
typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg); typedef void * * (*ZipOpen_t)(const char *name, char **pmsg);
typedef void (JNICALL *ZipClose_t)(jzfile *zip); typedef void (*ZipClose_t)(jzfile *zip);
typedef jzentry* (JNICALL *FindEntry_t)(jzfile *zip, const char *name, jint *sizeP, jint *nameLen); typedef jzentry* (*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 jboolean (*ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n); typedef jzentry* (*GetNextEntry_t)(jzfile *zip, jint n);
typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg); typedef jboolean (*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 jint (*Crc32_t)(jint crc, const jbyte *buf, jint len);
static ZipOpen_t ZipOpen = NULL; static ZipOpen_t ZipOpen = NULL;
static ZipClose_t ZipClose = NULL; static ZipClose_t ZipClose = NULL;

View File

@ -93,7 +93,7 @@ WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)
__initenv = _environ; __initenv = _environ;
#else /* JAVAW */ #else /* JAVAW */
JNIEXPORT int JNICALL JNIEXPORT int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int margc; int margc;

View File

@ -55,7 +55,7 @@
* } * }
* ... * ...
*/ */
extern "C" JNIEXPORT JImageFile* JNICALL extern "C" JNIEXPORT JImageFile*
JIMAGE_Open(const char *name, jint* error) { JIMAGE_Open(const char *name, jint* error) {
// TODO - return a meaningful error code // TODO - return a meaningful error code
*error = 0; *error = 0;
@ -72,7 +72,7 @@ JIMAGE_Open(const char *name, jint* error) {
* Ex. * Ex.
* (*JImageClose)(image); * (*JImageClose)(image);
*/ */
extern "C" JNIEXPORT void JNICALL extern "C" JNIEXPORT void
JIMAGE_Close(JImageFile* image) { JIMAGE_Close(JImageFile* image) {
ImageFileReader::close((ImageFileReader*) image); ImageFileReader::close((ImageFileReader*) image);
} }
@ -89,7 +89,7 @@ JIMAGE_Close(JImageFile* image) {
* tty->print_cr(package); * tty->print_cr(package);
* -> java.base * -> java.base
*/ */
extern "C" JNIEXPORT const char* JNICALL extern "C" JNIEXPORT const char*
JIMAGE_PackageToModule(JImageFile* image, const char* package_name) { JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name); return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name);
} }
@ -108,7 +108,7 @@ JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
* JImageLocationRef location = (*JImageFindResource)(image, * JImageLocationRef location = (*JImageFindResource)(image,
* "java.base", "9.0", "java/lang/String.class", &size); * "java.base", "9.0", "java/lang/String.class", &size);
*/ */
extern "C" JNIEXPORT JImageLocationRef JNICALL extern "C" JNIEXPORT JImageLocationRef
JIMAGE_FindResource(JImageFile* image, JIMAGE_FindResource(JImageFile* image,
const char* module_name, const char* version, const char* name, const char* module_name, const char* version, const char* name,
jlong* size) { jlong* size) {
@ -155,7 +155,7 @@ JIMAGE_FindResource(JImageFile* image,
* char* buffer = new char[size]; * char* buffer = new char[size];
* (*JImageGetResource)(image, location, buffer, size); * (*JImageGetResource)(image, location, buffer, size);
*/ */
extern "C" JNIEXPORT jlong JNICALL extern "C" JNIEXPORT jlong
JIMAGE_GetResource(JImageFile* image, JImageLocationRef location, JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
char* buffer, jlong size) { char* buffer, jlong size) {
((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer); ((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer);
@ -184,7 +184,7 @@ JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
* } * }
* (*JImageResourceIterator)(image, ctw_visitor, loader); * (*JImageResourceIterator)(image, ctw_visitor, loader);
*/ */
extern "C" JNIEXPORT void JNICALL extern "C" JNIEXPORT void
JIMAGE_ResourceIterator(JImageFile* image, JIMAGE_ResourceIterator(JImageFile* image,
JImageResourceVisitor_t visitor, void* arg) { JImageResourceVisitor_t visitor, void* arg) {
ImageFileReader* imageFile = (ImageFileReader*) image; ImageFileReader* imageFile = (ImageFileReader*) image;
@ -226,7 +226,7 @@ JIMAGE_ResourceIterator(JImageFile* image,
* char path[JIMAGE_MAX_PATH]; * char path[JIMAGE_MAX_PATH];
* (*JImageResourcePath)(image, location, 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, JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
char* path, size_t max) { char* path, size_t max) {
ImageFileReader* imageFile = (ImageFileReader*) image; ImageFileReader* imageFile = (ImageFileReader*) image;

View File

@ -72,7 +72,7 @@ typedef jlong JImageLocationRef;
* ... * ...
*/ */
extern "C" JNIEXPORT JImageFile* JNICALL extern "C" JNIEXPORT JImageFile*
JIMAGE_Open(const char *name, jint* error); JIMAGE_Open(const char *name, jint* error);
typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error); typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
@ -87,7 +87,7 @@ typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
* (*JImageClose)(image); * (*JImageClose)(image);
*/ */
extern "C" JNIEXPORT void JNICALL extern "C" JNIEXPORT void
JIMAGE_Close(JImageFile* jimage); JIMAGE_Close(JImageFile* jimage);
typedef void (*JImageClose_t)(JImageFile* jimage); typedef void (*JImageClose_t)(JImageFile* jimage);
@ -106,7 +106,7 @@ typedef void (*JImageClose_t)(JImageFile* jimage);
* -> java.base * -> java.base
*/ */
extern "C" JNIEXPORT const char * JNICALL extern "C" JNIEXPORT const char *
JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name); JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name); typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name);
@ -150,7 +150,7 @@ typedef JImageLocationRef(*JImageFindResource_t)(JImageFile* jimage,
* char* buffer = new char[size]; * char* buffer = new char[size];
* (*JImageGetResource)(image, location, buffer, size); * (*JImageGetResource)(image, location, buffer, size);
*/ */
extern "C" JNIEXPORT jlong JNICALL extern "C" JNIEXPORT jlong
JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location, JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
char* buffer, jlong size); char* buffer, jlong size);
@ -185,7 +185,7 @@ typedef bool (*JImageResourceVisitor_t)(JImageFile* jimage,
const char* module_name, const char* version, const char* package, const char* module_name, const char* version, const char* package,
const char* name, const char* extension, void* arg); const char* name, const char* extension, void* arg);
extern "C" JNIEXPORT void JNICALL extern "C" JNIEXPORT void
JIMAGE_ResourceIterator(JImageFile* jimage, JIMAGE_ResourceIterator(JImageFile* jimage,
JImageResourceVisitor_t visitor, void *arg); JImageResourceVisitor_t visitor, void *arg);
@ -202,7 +202,7 @@ typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
* char path[JIMAGE_MAX_PATH]; * char path[JIMAGE_MAX_PATH];
* (*JImageResourcePath)(image, location, 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, JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
char* path, size_t max); char* path, size_t max);

View File

@ -54,7 +54,7 @@ Java_java_util_zip_CRC32_updateBytes0(JNIEnv *env, jclass cls, jint crc,
return crc; return crc;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint
ZIP_CRC32(jint crc, const jbyte *buf, jint len) ZIP_CRC32(jint crc, const jbyte *buf, jint len)
{ {
return crc32(crc, (Bytef*)buf, len); return crc32(crc, (Bytef*)buf, len);

View File

@ -881,7 +881,7 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified,
* set to the error message text if msg != 0. Otherwise, *msg will be * 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. * set to NULL. Caller doesn't need to free the error message.
*/ */
JNIEXPORT jzfile * JNICALL JNIEXPORT jzfile *
ZIP_Open(const char *name, char **pmsg) ZIP_Open(const char *name, char **pmsg)
{ {
jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0); jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
@ -895,7 +895,7 @@ ZIP_Open(const char *name, char **pmsg)
/* /*
* Closes the specified zip file object. * Closes the specified zip file object.
*/ */
JNIEXPORT void JNICALL JNIEXPORT void
ZIP_Close(jzfile *zip) ZIP_Close(jzfile *zip)
{ {
MLOCK(zfiles_lock); MLOCK(zfiles_lock);
@ -1115,7 +1115,7 @@ ZIP_FreeEntry(jzfile *jz, jzentry *ze)
* Returns the zip entry corresponding to the specified name, or * Returns the zip entry corresponding to the specified name, or
* NULL if not found. * NULL if not found.
*/ */
JNIEXPORT jzentry * JNICALL JNIEXPORT jzentry *
ZIP_GetEntry(jzfile *zip, char *name, jint ulen) ZIP_GetEntry(jzfile *zip, char *name, jint ulen)
{ {
if (ulen == 0) { if (ulen == 0) {
@ -1238,7 +1238,7 @@ Finally:
* Returns the n'th (starting at zero) zip file entry, or NULL if the * Returns the n'th (starting at zero) zip file entry, or NULL if the
* specified index was out of range. * specified index was out of range.
*/ */
JNIEXPORT jzentry * JNICALL JNIEXPORT jzentry *
ZIP_GetNextEntry(jzfile *zip, jint n) ZIP_GetNextEntry(jzfile *zip, jint n)
{ {
jzentry *result; jzentry *result;
@ -1439,7 +1439,7 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
* The current implementation does not support reading an entry that * The current implementation does not support reading an entry that
* has the size bigger than 2**32 bytes in ONE invocation. * 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) ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
{ {
jzentry *entry = ZIP_GetEntry(zip, name, 0); jzentry *entry = ZIP_GetEntry(zip, name, 0);
@ -1456,7 +1456,7 @@ ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
* Note: this is called from the separately delivered VM (hotspot/classic) * Note: this is called from the separately delivered VM (hotspot/classic)
* so we have to be careful to maintain the expected behaviour. * 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) ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
{ {
char *msg; char *msg;
@ -1515,7 +1515,7 @@ ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
return JNI_TRUE; return JNI_TRUE;
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean
ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg) ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
{ {
z_stream strm; z_stream strm;

View File

@ -241,16 +241,16 @@ typedef struct jzfile { /* Zip file */
*/ */
#define ZIP_ENDCHAIN ((jint)-1) #define ZIP_ENDCHAIN ((jint)-1)
JNIEXPORT jzentry * JNICALL JNIEXPORT jzentry *
ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP); 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); ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entrynm);
JNIEXPORT jzentry * JNICALL JNIEXPORT jzentry *
ZIP_GetNextEntry(jzfile *zip, jint n); ZIP_GetNextEntry(jzfile *zip, jint n);
JNIEXPORT jzfile * JNICALL JNIEXPORT jzfile *
ZIP_Open(const char *name, char **pmsg); ZIP_Open(const char *name, char **pmsg);
jzfile * jzfile *
@ -265,10 +265,10 @@ ZIP_Put_In_Cache(const char *name, ZFILE zfd, char **pmsg, jlong lastModified);
jzfile * jzfile *
ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap); ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap);
JNIEXPORT void JNICALL JNIEXPORT void
ZIP_Close(jzfile *zip); ZIP_Close(jzfile *zip);
JNIEXPORT jzentry * JNICALL JNIEXPORT jzentry *
ZIP_GetEntry(jzfile *zip, char *name, jint ulen); ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
ZIP_Lock(jzfile *zip); ZIP_Lock(jzfile *zip);
@ -281,7 +281,7 @@ ZIP_FreeEntry(jzfile *zip, jzentry *ze);
jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry); jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash); 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); ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
#endif /* !_ZIP_H_ */ #endif /* !_ZIP_H_ */

View File

@ -227,7 +227,7 @@ mlib_image* mlib_ImageSet(mlib_image *image,
} }
/***************************************************************/ /***************************************************************/
mlib_image *mlib_ImageCreateStruct(mlib_type type, JNIEXPORT mlib_image* JNICALL mlib_ImageCreateStruct(mlib_type type,
mlib_s32 channels, mlib_s32 channels,
mlib_s32 width, mlib_s32 width,
mlib_s32 height, mlib_s32 height,
@ -253,7 +253,7 @@ mlib_image *mlib_ImageCreateStruct(mlib_type type,
} }
/***************************************************************/ /***************************************************************/
mlib_image *mlib_ImageCreate(mlib_type type, JNIEXPORT mlib_image* JNICALL mlib_ImageCreate(mlib_type type,
mlib_s32 channels, mlib_s32 channels,
mlib_s32 width, mlib_s32 width,
mlib_s32 height) mlib_s32 height)
@ -352,7 +352,7 @@ mlib_image *mlib_ImageCreate(mlib_type type,
} }
/***************************************************************/ /***************************************************************/
void mlib_ImageDelete(mlib_image *img) JNIEXPORT void JNICALL mlib_ImageDelete(mlib_image *img)
{ {
if (img == NULL) return; if (img == NULL) return;
if ((img -> flags & MLIB_IMAGE_USERALLOCATED) == 0) { if ((img -> flags & MLIB_IMAGE_USERALLOCATED) == 0) {

View File

@ -299,7 +299,7 @@ mlib_status mlib_ImageAffine_alltypes(mlib_image *dst,
} }
/***************************************************************/ /***************************************************************/
mlib_status mlib_ImageAffine(mlib_image *dst, JNIEXPORT mlib_status JNICALL mlib_ImageAffine(mlib_image *dst,
const mlib_image *src, const mlib_image *src,
const mlib_d64 *mtx, const mlib_d64 *mtx,
mlib_filter filter, mlib_filter filter,

View File

@ -78,7 +78,7 @@
#endif /* __sparc */ #endif /* __sparc */
/***************************************************************/ /***************************************************************/
mlib_status mlib_ImageConvKernelConvert(mlib_s32 *ikernel, JNIEXPORT mlib_status JNICALL mlib_ImageConvKernelConvert(mlib_s32 *ikernel,
mlib_s32 *iscale, mlib_s32 *iscale,
const mlib_d64 *fkernel, const mlib_d64 *fkernel,
mlib_s32 m, mlib_s32 m,

View File

@ -90,7 +90,7 @@
#include "mlib_ImageConvEdge.h" #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_image *src,
const mlib_s32 *kernel, const mlib_s32 *kernel,
mlib_s32 m, mlib_s32 m,

View File

@ -78,7 +78,7 @@
#include "mlib_c_ImageLookUp.h" #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 mlib_image *src,
const void **table) const void **table)
{ {

View File

@ -132,9 +132,6 @@ void SplashDonePlatform(Splash * splash);
unsigned SplashTime(); unsigned SplashTime();
char* SplashConvertStringAlloc(const char* in, int *size); 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 SplashLock(Splash * splash);
void SplashUnlock(Splash * splash); void SplashUnlock(Splash * splash);
@ -157,8 +154,7 @@ void SplashDone(Splash * splash);
void SplashUpdateScreenData(Splash * splash); void SplashUpdateScreenData(Splash * splash);
void SplashCleanup(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); void cleanUp(char *fName, char *xName, char *pctName, float *scaleFactor);
jboolean GetScaledImageName(const char *fileName, char *scaledImgName, jboolean GetScaledImageName(const char *fileName, char *scaledImgName,
float *scaleFactor, const size_t scaledImageLength); float *scaleFactor, const size_t scaledImageLength);

View File

@ -574,7 +574,7 @@ SplashReconfigure(Splash * splash)
PostMessage(splash->hWnd, WM_SPLASHRECONFIGURE, 0, 0); PostMessage(splash->hWnd, WM_SPLASHRECONFIGURE, 0, 0);
} }
jboolean JNIEXPORT jboolean JNICALL
SplashGetScaledImageName(const char* jarName, const char* fileName, SplashGetScaledImageName(const char* jarName, const char* fileName,
float *scaleFactor, char *scaleImageName, float *scaleFactor, char *scaleImageName,
const size_t scaledImageLength) const size_t scaledImageLength)

View File

@ -59,7 +59,7 @@
#include "unpack.h" #include "unpack.h"
JNIEXPORT int JNICALL JNIEXPORT int
main(int argc, char **argv) { main(int argc, char **argv) {
return unpacker::run(argc, argv); return unpacker::run(argc, argv);
} }