From: Sangchul Lee Date: Mon, 27 Sep 2021 08:07:32 +0000 (+0900) Subject: Apply -Wshadow and fix the errors X-Git-Tag: submit/tizen/20210928.033014~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F264616%2F3;p=platform%2Fcore%2Fapi%2Fwebrtc.git Apply -Wshadow and fix the errors It is added to comply with VD build configuration. [Version] 0.2.104 [Issue Type] Improvement Change-Id: Id1481b5077723fd0ca74107fe1d618a0d5974c20 Signed-off-by: Sangchul Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c6aa2e7..aafc9e0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wshadow -Werror") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" STREQUAL "arm") diff --git a/include/webrtc_private.h b/include/webrtc_private.h index 6e7251d6..16bf224b 100644 --- a/include/webrtc_private.h +++ b/include/webrtc_private.h @@ -119,16 +119,16 @@ do { \ #define RET_ERR_IF_PRIVILEGE_IS_NOT_ALLOWED(x_privilege) \ do { \ - int ret = _check_privilege(x_privilege); \ - if (ret != WEBRTC_ERROR_NONE) \ - return ret; \ + int pret = _check_privilege(x_privilege); \ + if (pret != WEBRTC_ERROR_NONE) \ + return pret; \ } while (0) #define RET_ERR_IF_FEATURE_IS_NOT_SUPPORTED(x_feature) \ do { \ - int ret = _check_feature(x_feature); \ - if (ret != WEBRTC_ERROR_NONE) \ - return ret; \ + int fret = _check_feature(x_feature); \ + if (fret != WEBRTC_ERROR_NONE) \ + return fret; \ } while (0) #define _WEBRTC_FEATURE_NETWORK_WIFI "http://tizen.org/feature/network.wifi" @@ -136,14 +136,14 @@ do { \ #define _WEBRTC_FEATURE_NETWORK_ETH "http://tizen.org/feature/network.ethernet" #define RET_ERR_IF_NETWORK_FEATURES_ARE_NOT_SUPPORTED() \ do { \ - int ret = _check_feature(_WEBRTC_FEATURE_NETWORK_WIFI); \ - if (ret == WEBRTC_ERROR_NONE) \ + int fret = _check_feature(_WEBRTC_FEATURE_NETWORK_WIFI); \ + if (fret == WEBRTC_ERROR_NONE) \ break; \ - ret = _check_feature(_WEBRTC_FEATURE_NETWORK_TELE); \ - if (ret == WEBRTC_ERROR_NONE) \ + fret = _check_feature(_WEBRTC_FEATURE_NETWORK_TELE); \ + if (fret == WEBRTC_ERROR_NONE) \ break; \ - ret = _check_feature(_WEBRTC_FEATURE_NETWORK_ETH); \ - if (ret == WEBRTC_ERROR_NONE) \ + fret = _check_feature(_WEBRTC_FEATURE_NETWORK_ETH); \ + if (fret == WEBRTC_ERROR_NONE) \ break; \ return WEBRTC_ERROR_NOT_SUPPORTED; \ } while (0) diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index e621d8bd..0e259486 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.2.103 +Version: 0.2.104 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/test/webrtc_test.c b/test/webrtc_test.c index 310fedb9..da8fa284 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -222,7 +222,7 @@ typedef struct _connection_s { static gchar g_signaling_server[MAX_STRING_LEN]; static gchar g_proxy[MAX_STRING_LEN]; -static appdata_s ad; +static appdata_s g_ad; static connection_s g_conns[MAX_CONNECTION_LEN]; static int g_conn_index; @@ -2347,12 +2347,12 @@ static media_packet_h __make_media_packet(media_packet_source_s *packet_source, media_packet_has_tbm_surface_buffer(packet, &has_tbm_surface); if (has_tbm_surface) { - int ret = TBM_SURFACE_ERROR_NONE; + int tbm_ret = TBM_SURFACE_ERROR_NONE; tbm_surface_h ts; media_packet_get_tbm_surface(packet, &ts); - ret = tbm_surface_get_info(ts, &ts_info); - if (ret != TBM_SURFACE_ERROR_NONE) { + tbm_ret = tbm_surface_get_info(ts, &ts_info); + if (tbm_ret != TBM_SURFACE_ERROR_NONE) { g_printerr("failed to tbm_surface_get_info()\n"); goto error; } @@ -4637,8 +4637,8 @@ int main(int argc, char *argv[]) g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL); displaymenu(); - memset(&ad, 0x0, sizeof(appdata_s)); - ops.data = &ad; + memset(&g_ad, 0x0, sizeof(appdata_s)); + ops.data = &g_ad; return appcore_efl_main(PACKAGE, &argc, &argv, &ops); }