From 8e38dbd3dd5f11e62e9acfed3660c02dc56236b5 Mon Sep 17 00:00:00 2001 From: Pavel Kotucek Date: Mon, 29 Apr 2019 08:35:06 +0200 Subject: Fixed ACL compiler warnings Fixed warnings : - scvpp/inc/scvpp/comm.h:52:0: warning: "ARG_CHECK" redefined - comm.c:127:12: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] Change-Id: I666c0347d10435681220c451976194e655d8aa04 Signed-off-by: Pavel Kotucek --- src/plugins/sc_plugins.c | 2 +- src/plugins/sc_plugins.h | 26 -------------------------- src/scvpp/inc/scvpp/comm.h | 2 +- src/scvpp/src/comm.c | 2 +- 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/plugins/sc_plugins.c b/src/plugins/sc_plugins.c index 0a36afb..df191bf 100644 --- a/src/plugins/sc_plugins.c +++ b/src/plugins/sc_plugins.c @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "sc_plugins.h" #include "sc_model.h" +#include "sc_plugins.h" #include static int vpp_pid_start; diff --git a/src/plugins/sc_plugins.h b/src/plugins/sc_plugins.h index feec482..4a784fb 100644 --- a/src/plugins/sc_plugins.h +++ b/src/plugins/sc_plugins.h @@ -20,32 +20,6 @@ #include #include -#define ARG_CHECK(retval, arg) \ - do \ - { \ - if (NULL == (arg)) \ - { \ - SRP_LOG_ERR_MSG(#arg ":NULL pointer passed."); \ - return (retval); \ - } \ - } \ - while (0) - -#define ARG_CHECK2(retval, arg1, arg2) \ - ARG_CHECK(retval, arg1); \ - ARG_CHECK(retval, arg2) - -#define ARG_CHECK3(retval, arg1, arg2, arg3) \ - ARG_CHECK(retval, arg1); \ - ARG_CHECK(retval, arg2); \ - ARG_CHECK(retval, arg3) - -#define ARG_CHECK4(retval, arg1, arg2, arg3, arg4) \ - ARG_CHECK(retval, arg1); \ - ARG_CHECK(retval, arg2); \ - ARG_CHECK(retval, arg3); \ - ARG_CHECK(retval, arg4) - //functions that sysrepo-plugin need int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx); void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_ctx); diff --git a/src/scvpp/inc/scvpp/comm.h b/src/scvpp/inc/scvpp/comm.h index 3e6122e..da83fa7 100644 --- a/src/scvpp/inc/scvpp/comm.h +++ b/src/scvpp/inc/scvpp/comm.h @@ -196,7 +196,7 @@ api_name##_all_cb(vapi_ctx_t ctx, void *caller_ctx, vapi_error_e rv, bool is_las int sc_aton(const char *cp, u8 * buf, size_t length); char * sc_ntoa(const u8 * buf); int sc_pton(int af, const char *cp, u8 * buf); -char * sc_ntop(int af, const u8 * buf, char *addr); +const char * sc_ntop(int af, const u8 * buf, char *addr); /** * @brief Function converts the u8 array from network byte order to host byte order. diff --git a/src/scvpp/src/comm.c b/src/scvpp/src/comm.c index 0169d0a..532ee1e 100644 --- a/src/scvpp/src/comm.c +++ b/src/scvpp/src/comm.c @@ -111,7 +111,7 @@ int sc_pton(int af, const char *cp, u8 * buf) return 0; } -char* sc_ntop(int af, const u8 * buf, char *addr) +const char* sc_ntop(int af, const u8 * buf, char *addr) { ARG_CHECK(NULL, buf); ARG_CHECK(NULL, addr); -- cgit 1.2.3-korg