From 71ced86094ab5ee5c62374420f7b21d89ebab1b6 Mon Sep 17 00:00:00 2001 From: lebarsfa Date: Tue, 14 Mar 2023 19:06:40 +0100 Subject: [PATCH 1/3] Corrected warning '&': unsafe operation: no value of type 'bool' promoted to type 'unsigned int' can equal the given constant --- sdk/src/sl_tcp_channel.cpp | 2 +- sdk/src/sl_udp_channel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/src/sl_tcp_channel.cpp b/sdk/src/sl_tcp_channel.cpp index f4fd5ae..5b3b154 100644 --- a/sdk/src/sl_tcp_channel.cpp +++ b/sdk/src/sl_tcp_channel.cpp @@ -54,7 +54,7 @@ namespace sl { bool open() { - if(SL_IS_FAIL(bind(_ip, _port))) + if(bind(_ip, _port)) return false; return IS_OK(_binded_socket->connect(_socket)); diff --git a/sdk/src/sl_udp_channel.cpp b/sdk/src/sl_udp_channel.cpp index aa39d9e..6a71df7 100644 --- a/sdk/src/sl_udp_channel.cpp +++ b/sdk/src/sl_udp_channel.cpp @@ -53,7 +53,7 @@ namespace sl { bool open() { - if(SL_IS_FAIL(bind(_ip, _port))) + if(bind(_ip, _port)) return false; return SL_IS_OK(_binded_socket->setPairAddress(&_socket)); } From b6c07fccfa8a4048984303fd19c8c610be4eb4c4 Mon Sep 17 00:00:00 2001 From: lebarsfa Date: Tue, 14 Mar 2023 19:14:47 +0100 Subject: [PATCH 2/3] Corrected warning 'printf' : too many arguments passed for format string --- app/custom_baudrate/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/custom_baudrate/main.cpp b/app/custom_baudrate/main.cpp index be11fc9..66c3a02 100644 --- a/app/custom_baudrate/main.cpp +++ b/app/custom_baudrate/main.cpp @@ -66,7 +66,7 @@ void print_usage(int argc, const char* argv[]) " %s [baudrate]\n" " The baudrate can be ANY possible values between 115200 to 512000.\n" - , "SL_LIDAR_SDK_VERSION", argv[0], argv[0]); + , "SL_LIDAR_SDK_VERSION", argv[0]); } From bdb783f97cfb7e84ab80b603cd59a2304b410631 Mon Sep 17 00:00:00 2001 From: lebarsfa Date: Tue, 14 Mar 2023 19:16:39 +0100 Subject: [PATCH 3/3] Corrected warning 'fprintf' : format string '%s' requires an argument of type 'char *', but variadic argument 2 has type 'sl_u32' --- app/simple_grabber/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/simple_grabber/main.cpp b/app/simple_grabber/main.cpp index 6cdfddd..9b01a37 100644 --- a/app/simple_grabber/main.cpp +++ b/app/simple_grabber/main.cpp @@ -206,7 +206,7 @@ int main(int argc, const char * argv[]) { , opt_channel_param_first); break; case CHANNEL_TYPE_UDP: - fprintf(stderr, "Error, cannot connect to the ip addr %s with the udp port %s.\n" + fprintf(stderr, "Error, cannot connect to the ip addr %s with the udp port %u.\n" , opt_channel_param_first, opt_channel_param_second); break; }