Skip to content

Commit

Permalink
Merge pull request #1000 from matthiasblaesing/gcc8
Browse files Browse the repository at this point in the history
Fix GCC8 warnings
  • Loading branch information
matthiasblaesing authored Aug 10, 2018
2 parents b62607c + b773e62 commit 8d7efcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions native/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ dispatch(JNIEnv *env, void* func, jint flags, jobjectArray args,
int err = GET_LAST_ERROR();
JNA_set_last_error(env, err);
if ((flags & THROW_LAST_ERROR) && err) {
char emsg[MSG_SIZE];
char emsg[MSG_SIZE - 3 /* literal characters */ - 10 /* max length of %d */];
snprintf(msg, sizeof(msg), "[%d] %s", err, STR_ERROR(err, emsg, sizeof(emsg)));
throw_type = ELastError;
throw_msg = msg;
Expand Down Expand Up @@ -1896,7 +1896,7 @@ dispatch_direct(ffi_cif* cif, void* volatile resp, void** argp, void *cdata) {
int err = GET_LAST_ERROR();
JNA_set_last_error(env, err);
if (data->throw_last_error && err) {
char emsg[MSG_SIZE];
char emsg[MSG_SIZE - 3 /* literal characters */ - 10 /* max length of %d */];
snprintf(msg, sizeof(msg), "[%d] %s", err, STR_ERROR(err, emsg, sizeof(emsg)));
throw_type = ELastError;
throw_msg = msg;
Expand Down Expand Up @@ -3096,7 +3096,7 @@ Java_com_sun_jna_Native_getWindowHandle0(JNIEnv* UNUSED_JAWT(env), jclass UNUSED
return -1;
}
if ((pJAWT_GetAWT = (void*)FIND_ENTRY(jawt_handle, METHOD_NAME)) == NULL) {
char msg[MSG_SIZE], buf[MSG_SIZE];
char msg[MSG_SIZE], buf[MSG_SIZE - 31 /* literal characters */ - sizeof(METHOD_NAME)];
snprintf(msg, sizeof(msg), "Error looking up JAWT method %s: %s",
METHOD_NAME, LOAD_ERROR(buf, sizeof(buf)));
throwByName(env, EUnsatisfiedLink, msg);
Expand Down
2 changes: 1 addition & 1 deletion native/testlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ callCallbackWithStructByValue(TestStructureByValue (*func)(TestStructureByValue)

EXPORT callback_t
callCallbackWithCallback(cb_callback_t cb) {
return (*cb)((callback_t)cb);
return (*cb)((callback_t)(void*)cb);
}

static int32_t
Expand Down

0 comments on commit 8d7efcc

Please sign in to comment.