From 581230092ba530c79a0637ed0def6d1719e12cb8 Mon Sep 17 00:00:00 2001 From: Eran Date: Mon, 12 Apr 2021 13:17:32 +0300 Subject: [PATCH 1/2] fix warnings in sensor.cpp --- src/sensor.cpp | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/sensor.cpp b/src/sensor.cpp index 2ac9b5f873..87a529323e 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -141,34 +141,20 @@ namespace librealsense rs2_format sensor_base::fourcc_to_rs2_format(uint32_t fourcc_format) const { - rs2_format f = RS2_FORMAT_ANY; + auto it = _fourcc_to_rs2_format->find( fourcc_format ); + if( it != _fourcc_to_rs2_format->end() ) + return it->second; - std::find_if(_fourcc_to_rs2_format->begin(), _fourcc_to_rs2_format->end(), [&fourcc_format, &f](const std::pair& p) { - if (p.first == fourcc_format) - { - f = p.second; - return true; - } - return false; - }); - - return f; + return RS2_FORMAT_ANY; } rs2_stream sensor_base::fourcc_to_rs2_stream(uint32_t fourcc_format) const { - rs2_stream s = RS2_STREAM_ANY; + auto it = _fourcc_to_rs2_stream->find( fourcc_format ); + if( it != _fourcc_to_rs2_stream->end() ) + return it->second; - std::find_if(_fourcc_to_rs2_stream->begin(), _fourcc_to_rs2_stream->end(), [&fourcc_format, &s](const std::pair& p) { - if (p.first == fourcc_format) - { - s = p.second; - return true; - } - return false; - }); - - return s; + return RS2_STREAM_ANY; } void sensor_base::raise_on_before_streaming_changes(bool streaming) @@ -1506,7 +1492,7 @@ namespace librealsense { for (size_t i = 0; i < composite->get_embedded_frames_count(); i++) { - processed_frames.push_back(composite->get_frame(i)); + processed_frames.push_back( composite->get_frame( (int)i ) ); } } From 4eae580a133884704445854e936f7147858524d1 Mon Sep 17 00:00:00 2001 From: Eran Date: Tue, 13 Apr 2021 13:34:50 +0300 Subject: [PATCH 2/2] update warning count --- unit-tests/LRS_windows_compile_pipeline.stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit-tests/LRS_windows_compile_pipeline.stats b/unit-tests/LRS_windows_compile_pipeline.stats index 46e3f288e1..8f4042cbfd 100644 --- a/unit-tests/LRS_windows_compile_pipeline.stats +++ b/unit-tests/LRS_windows_compile_pipeline.stats @@ -1,2 +1,2 @@ -warnings 343 +warnings 342