Skip to content

Commit

Permalink
PR #8805 from Eran: fix warnings in sensor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Apr 13, 2021
2 parents 7710530 + 4eae580 commit cc1f38f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
32 changes: 9 additions & 23 deletions src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t, rs2_format>& 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<uint32_t, rs2_stream>& 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)
Expand Down Expand Up @@ -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 ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion unit-tests/LRS_windows_compile_pipeline.stats
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
warnings 343
warnings 342

0 comments on commit cc1f38f

Please sign in to comment.