summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-07-24 12:12:27 +0800
committeryangwei <[email protected]>2024-07-24 12:12:27 +0800
commit42149eae4a2eccd4bd104d8e5757766edd8cf477 (patch)
treead6b17bbb14652319f8d71ce083d6d30fa4b2ebe
parentaf19e929b05536d28dcffeb530ccbe72bcb74f21 (diff)
🔧 build(cmake parameter): set warning as error
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/stellar_on_sapp/stellar_on_sapp_api.c8
-rw-r--r--test/plugin_manager/plugin_manager_gtest_main.cpp20
3 files changed, 20 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52f279c..261d071 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,10 @@ add_definitions(-D_GNU_SOURCE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
+#set warning as error
+add_compile_options(-Wall -Wextra -Werror -Wno-error=unused-variable -Wno-error=unused-parameter)
+
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
diff --git a/src/stellar_on_sapp/stellar_on_sapp_api.c b/src/stellar_on_sapp/stellar_on_sapp_api.c
index dafdd3c..269a41c 100644
--- a/src/stellar_on_sapp/stellar_on_sapp_api.c
+++ b/src/stellar_on_sapp/stellar_on_sapp_api.c
@@ -550,14 +550,6 @@ const char *session_get0_l2_l3_hdr(struct session *sess, int session_direction,
}
-static const void *session_get_cached_rawpkt(struct session *sess, int session_direction)
-{
- struct streaminfo *pstream=sess->pstream;
- assert(pstream);
- int route_direction=(session_direction==SESSION_DIRECTION_IN)?(DIR_ROUTE_UP):(DIR_ROUTE_DOWN);
- return get_rawpkt_from_streaminfo(pstream, route_direction);
-}
-
uint16_t *session_get0_segment_id_list(struct session *sess, int session_direction, size_t *sid_num)
{
*sid_num=0;
diff --git a/test/plugin_manager/plugin_manager_gtest_main.cpp b/test/plugin_manager/plugin_manager_gtest_main.cpp
index df0b080..d412ee6 100644
--- a/test/plugin_manager/plugin_manager_gtest_main.cpp
+++ b/test/plugin_manager/plugin_manager_gtest_main.cpp
@@ -1981,8 +1981,14 @@ static void test_session_mq_priority_plugin_1_on_msg(struct session *sess, int t
}
if(topic_id == env->test_mq_topic_id)
{
- if(ctx->called%3 == 2)EXPECT_EQ((int)(long)msg, env->plugin_id_2);
- if(ctx->called%3 == 0)EXPECT_EQ((int )(long)msg, env->plugin_id_1);
+ if(ctx->called%3 == 2)
+ {
+ EXPECT_EQ((int)(long)msg, env->plugin_id_2);
+ }
+ if(ctx->called%3 == 0)
+ {
+ EXPECT_EQ((int )(long)msg, env->plugin_id_1);
+ }
}
return;
}
@@ -2004,8 +2010,14 @@ static void test_session_mq_priority_plugin_2_on_msg(struct session *sess, int t
}
if(topic_id == env->test_mq_topic_id)
{
- if(ctx->called%3 == 2)EXPECT_EQ((int)(long)msg, env->plugin_id_2);
- if(ctx->called%3 == 0)EXPECT_EQ((int)(long)msg, env->plugin_id_1);
+ if(ctx->called%3 == 2)
+ {
+ EXPECT_EQ((int)(long)msg, env->plugin_id_2);
+ }
+ if(ctx->called%3 == 0)
+ {
+ EXPECT_EQ((int)(long)msg, env->plugin_id_1);
+ }
}
return;
}