summaryrefslogtreecommitdiffstats
path: root/src/scvpp/src/sc_vpp_comm.h
diff options
context:
space:
mode:
authorYohanPipereau <ypiperea@cisco.com>2019-03-15 11:23:07 +0100
committerYohanPipereau <ypiperea@cisco.com>2019-03-19 20:27:11 +0100
commit7dd61fc820323344c7479dd767a2ee0f84abd810 (patch)
treec8708178c67bfb0c94af11e90ce8075828ebf7a8 /src/scvpp/src/sc_vpp_comm.h
parent5776cb5567b68470f23acafb4bec3d01833ce6df (diff)
Suppress compiler Warnings for scvpp
-Unused Warnings for callbacks are suppressed with UNUSED maccro -Remove unused function. Change-Id: Ic31a1b40d59a4d9c4fc638452dee36586d1dacd5 Signed-off-by: YohanPipereau <ypiperea@cisco.com>
Diffstat (limited to 'src/scvpp/src/sc_vpp_comm.h')
-rw-r--r--src/scvpp/src/sc_vpp_comm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/scvpp/src/sc_vpp_comm.h b/src/scvpp/src/sc_vpp_comm.h
index 649295d..2405259 100644
--- a/src/scvpp/src/sc_vpp_comm.h
+++ b/src/scvpp/src/sc_vpp_comm.h
@@ -64,11 +64,17 @@ DEFINE_VAPI_MSG_IDS_VPE_API_JSON;
ARG_CHECK(retval, arg3); \
ARG_CHECK(retval, arg4)
+/* Suppress compiler warning about unused variable.
+ * This must be used only for callback function else suppress your unused
+ * parameter in function prototype. */
+#define UNUSED(x) (void)x
+
#define VAPI_RETVAL_CB(api_name) \
static vapi_error_e \
api_name##_cb (vapi_ctx_t ctx, void *caller_ctx, vapi_error_e rv, bool is_last, \
vapi_payload_##api_name##_reply * reply) \
{ \
+ UNUSED(ctx); UNUSED(caller_ctx); UNUSED(rv); UNUSED(is_last); \
return reply->retval; \
}
@@ -77,6 +83,7 @@ static vapi_error_e \
api_name##_cb (vapi_ctx_t ctx, void *caller_ctx, vapi_error_e rv, bool is_last, \
vapi_payload_##api_name##_reply * reply) \
{ \
+ UNUSED(ctx); UNUSED(rv); UNUSED(is_last); \
if (caller_ctx) \
{ \
vapi_payload_##api_name##_reply * passed = (vapi_payload_##api_name##_reply *)caller_ctx; \