Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings in sensor.cpp #8805

Merged
merged 2 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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