Commit 9e6a2a51 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Explicitly mark unused function parameters

This allows re-enabling the unused-parameter warnings globally.
parent 8c18566f
......@@ -25,6 +25,12 @@
*/
#define PACKED __attribute__ ((__packed__))
#ifdef __GNUC__
#define UNUSED(p) UNUSED_ ## p __attribute__ ((__unused__))
#else
#define UNUSED(p) UNUSED_ ## p
#endif
#if defined(WHOLE) && __has_attribute(externally_visible)
#define VISIBLE __attribute__ ((externally_visible))
#else
......
......@@ -484,8 +484,8 @@ __thread_info_done (jvmtiEnv * jvmti, struct thread_info * info) {
void JNICALL
disl_jvmti_callback_class_file_load (
jvmtiEnv * jvmti, JNIEnv * jni,
jclass class_being_redefined, jobject classloader,
const char * class_name, jobject protection_domain,
jclass UNUSED (class_being_redefined), jobject classloader,
const char * class_name, jobject UNUSED (protection_domain),
jint class_byte_count, const unsigned char * class_bytes,
jint * new_class_byte_count, unsigned char ** new_class_bytes
) {
......@@ -575,7 +575,7 @@ __release_thread_info:
// ****************************************************************************
void JNICALL
disl_jvmti_callback_vm_init (jvmtiEnv * jvmti, JNIEnv * jni, jthread thread) {
disl_jvmti_callback_vm_init (jvmtiEnv * jvmti, JNIEnv * jni, jthread UNUSED (thread)) {
//
// Update flags to reflect that the VM has stopped booting.
//
......@@ -615,7 +615,7 @@ disl_jvmti_callback_vm_init (jvmtiEnv * jvmti, JNIEnv * jni, jthread thread) {
// ****************************************************************************
void JNICALL
disl_jvmti_callback_vm_start (jvmtiEnv * jvmti, JNIEnv * jni) {
disl_jvmti_callback_vm_start (jvmtiEnv * UNUSED (jvmti), JNIEnv * UNUSED (jni)) {
//
// Update flags to reflect that the VM has started, and that any
// JNI function can be called from now on (but not before the
......
......@@ -76,7 +76,7 @@ jvmti_callback_class_file_load (
static void JNICALL
jvmti_callback_class_prepare (
jvmtiEnv * jvmti, JNIEnv * jni, jthread thread, jclass klass
jvmtiEnv * jvmti, JNIEnv * jni, jthread UNUSED (thread), jclass klass
) {
static long natives_registered = 0;
......@@ -136,19 +136,23 @@ jvmti_callback_vm_init (jvmtiEnv * jvmti, JNIEnv * jni, jthread thread) {
static void JNICALL
jvmti_callback_object_free (jvmtiEnv * jvmti, jlong tag) {
jvmti_callback_object_free (jvmtiEnv * UNUSED (jvmti), jlong tag) {
redispatcher_object_free (tag);
}
static void JNICALL
jvmti_callback_thread_start (jvmtiEnv * jvmti, JNIEnv * jni, jthread thread) {
jvmti_callback_thread_start (
jvmtiEnv * UNUSED (jvmti), JNIEnv * UNUSED (jni), jthread UNUSED (thread)
) {
/* nothing at the moment */
}
static void JNICALL
jvmti_callback_thread_end (jvmtiEnv * jvmti, JNIEnv * jni, jthread thread) {
jvmti_callback_thread_end (
jvmtiEnv * UNUSED (jvmti), JNIEnv * UNUSED (jni), jthread UNUSED (thread)
) {
redispatcher_thread_end ();
}
......@@ -195,7 +199,7 @@ jvmti_callback_vm_death (jvmtiEnv * jvmti, JNIEnv * jni) {
// ****************************************************************************
JNIEXPORT jint JNICALL VISIBLE
Agent_OnLoad (JavaVM * jvm, char * options, void * reserved) {
Agent_OnLoad (JavaVM * jvm, char * options, void * UNUSED (reserved)) {
#ifdef DEBUG
setvbuf (stdout, NULL, _IONBF, 0);
setvbuf (stderr, NULL, _IONBF, 0);
......@@ -297,7 +301,7 @@ Agent_OnLoad (JavaVM * jvm, char * options, void * reserved) {
// ****************************************************************************
JNIEXPORT void JNICALL VISIBLE
Agent_OnUnload (JavaVM * jvm) {
Agent_OnUnload (JavaVM * UNUSED (jvm)) {
rdaprintf ("agent unloaded, closing connections\n");
//
......
......@@ -145,7 +145,7 @@ __register_method (
static jshort JNICALL
native_registerMethod (
JNIEnv * jni, jclass this_class, jstring analysis_method_desc
JNIEnv * jni, jclass UNUSED (this_class), jstring analysis_method_desc
) {
return __register_method (jni, analysis_method_desc, tld_get ()->id);
}
......@@ -153,7 +153,7 @@ native_registerMethod (
static void JNICALL
native_analysisStart_default (
JNIEnv * jni, jclass this_class, jshort analysis_method_id
JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jshort analysis_method_id
) {
tl_insert_analysis_item (analysis_method_id);
}
......@@ -161,7 +161,7 @@ native_analysisStart_default (
static void JNICALL
native_analysisStart_ordering (
JNIEnv * jni, jclass this_class,
JNIEnv * UNUSED (jni), jclass UNUSED (this_class),
jshort analysis_method_id, jbyte ordering_id
) {
tl_insert_analysis_item_ordering (analysis_method_id, ordering_id);
......@@ -169,55 +169,55 @@ native_analysisStart_ordering (
static void JNICALL
native_analysisEnd (JNIEnv * jni, jclass this_class) {
native_analysisEnd (JNIEnv * UNUSED (jni), jclass UNUSED (this_class)) {
tl_analysis_end (local_jvmti);
}
static void JNICALL
native_sendBoolean (JNIEnv * jni, jclass this_class, jboolean value) {
native_sendBoolean (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jboolean value) {
buffer_append_jboolean (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendByte (JNIEnv * jni, jclass this_class, jbyte value) {
native_sendByte (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jbyte value) {
buffer_append_jbyte (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendChar (JNIEnv * jni, jclass this_class, jchar value) {
native_sendChar (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jchar value) {
buffer_append_jchar (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendShort (JNIEnv * jni, jclass this_class, jshort value) {
native_sendShort (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jshort value) {
buffer_append_jshort (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendInt (JNIEnv * jni, jclass this_class, jint value) {
native_sendInt (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jint value) {
buffer_append_jint (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendLong (JNIEnv * jni, jclass this_class, jlong value) {
native_sendLong (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jlong value) {
buffer_append_jlong (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendFloat (JNIEnv * jni, jclass this_class, jfloat value) {
native_sendFloat (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jfloat value) {
buffer_append_jfloat (tld_get ()->analysis_buff, value);
}
static void JNICALL
native_sendDouble (JNIEnv * jni, jclass this_class, jdouble value) {
native_sendDouble (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jdouble value) {
buffer_append_jdouble (tld_get ()->analysis_buff, value);
}
......@@ -231,26 +231,26 @@ __analysis_append_object (
static void JNICALL
native_sendObject (JNIEnv * jni, jclass this_class, jobject object) {
native_sendObject (JNIEnv * jni, jclass UNUSED (this_class), jobject object) {
__analysis_append_object (jni, tld_get (), object, OT_OBJECT);
}
static void JNICALL
native_sendObjectPlusData (JNIEnv * jni, jclass this_class, jobject object) {
native_sendObjectPlusData (JNIEnv * jni, jclass UNUSED (this_class), jobject object) {
__analysis_append_object (jni, tld_get (), object, OT_DATA_OBJECT);
}
static void JNICALL
native_sendObjectSize (JNIEnv * jni, jclass this_class, jobject object) {
native_sendObjectSize (JNIEnv * UNUSED (jni), jclass UNUSED (this_class), jobject object) {
jlong size = jvmti_get_object_size (local_jvmti, object);
buffer_append_jlong (tld_get ()->analysis_buff, size);
}
static void JNICALL
native_sendCurrentThread (JNIEnv * jni, jclass this_class) {
native_sendCurrentThread (JNIEnv * jni, jclass UNUSED (this_class)) {
//
// GetCurrentThread may return null if called in the wrong phase,
// and even if it fails for other reason, we at least send null.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment