Add unused markers if MULTIPLE_OWNER is undefined 41/24841/2
authorMats Wichmann <mats@linux.com>
Mon, 23 Apr 2018 16:18:47 +0000 (10:18 -0600)
committerMats Wichmann <mats@linux.com>
Tue, 24 Apr 2018 13:30:31 +0000 (13:30 +0000)
Several functions in one source file have code which is bracketed
by #ifdef MULTIPLE_OWNER. If not defined, these trigger warnings
about unused parameters; since warnings now cause error, this is
fatal. Add OC_UNUSED() wrappings for these.

Change-Id: I6b6320e8a6444a43c6400527f2f982a39a3d9128
Signed-off-by: Mats Wichmann <mats@linux.com>
java/jni/JniOcSecureResource.cpp

index f93f0cd..8fd2d41 100644 (file)
@@ -736,6 +736,9 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_selectMOTMethod0
         ThrowOcException(e.code(), e.reason().c_str());
     }
 #else
+    OC_UNUSED(thiz);
+    OC_UNUSED(oxmSelVal);
+    OC_UNUSED(jListener);
     ThrowOcException(OC_STACK_INVALID_PARAM, "MULTIPLE_OWNER not enabled");
     return;
 #endif
@@ -779,6 +782,9 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_changeMOTMode0
         ThrowOcException(e.code(), e.reason().c_str());
     }
 #else
+    OC_UNUSED(thiz);
+    OC_UNUSED(momType);
+    OC_UNUSED(jListener);
     ThrowOcException(OC_STACK_INVALID_PARAM, "MULTIPLE_OWNER not enabled");
     return;
 #endif
@@ -823,6 +829,9 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_addPreConfigPIN0
         ThrowOcException(e.code(), e.reason().c_str());
     }
 #else
+    OC_UNUSED(thiz);
+    OC_UNUSED(jPin);
+    OC_UNUSED(pinSize);
     ThrowOcException(OC_STACK_INVALID_PARAM, "MULTIPLE_OWNER not enabled");
     return;
 #endif
@@ -873,6 +882,10 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionPreConfi
         ThrowOcException(e.code(), e.reason().c_str());
     }
 #else
+    OC_UNUSED(thiz);
+    OC_UNUSED(jPin);
+    OC_UNUSED(pinSize);
+    OC_UNUSED(jListener);
     ThrowOcException(OC_STACK_INVALID_PARAM, "MULTIPLE_OWNER not enabled");
     return;
 #endif
@@ -916,6 +929,8 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_doMultipleOwnersh
         ThrowOcException(e.code(), e.reason().c_str());
     }
 #else
+    OC_UNUSED(thiz);
+    OC_UNUSED(jListener);
     ThrowOcException(OC_STACK_INVALID_PARAM, "MULTIPLE_OWNER not enabled");
     return;
 #endif