Skip to content

Commit

Permalink
fix warnings in sensor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Apr 12, 2021
1 parent 3c769f8 commit 1a81688
Showing 1 changed file with 9 additions and 23 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

0 comments on commit 1a81688

Please sign in to comment.