Skip to content

Commit

Permalink
Fixing -Wshadow in the API
Browse files Browse the repository at this point in the history
  • Loading branch information
dorodnic committed Nov 28, 2018
1 parent db66f54 commit 6d16dfc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
28 changes: 13 additions & 15 deletions include/librealsense2/hpp/rs_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ namespace rs2
* Base class for multiple frame extensions with internal frame handle
* \param[in] rs2_frame frame_ref - internal frame instance
*/
frame(rs2_frame* frame_ref) : frame_ref(frame_ref)
frame(rs2_frame* ref) : frame_ref(ref)
{
#ifdef _DEBUG
if (frame_ref)
if (ref)
{
rs2_error* e = nullptr;
auto r = rs2_get_frame_number(frame_ref, &e);
auto r = rs2_get_frame_number(ref, &e);
if (!e)
frame_number = r;
auto s = rs2_get_frame_stream_profile(frame_ref, &e);
auto s = rs2_get_frame_stream_profile(ref, &e);
if (!e)
profile = stream_profile(s);
}
Expand Down Expand Up @@ -656,7 +656,6 @@ namespace rs2

if (get())
{
rs2_error* e = nullptr;
_size = rs2_get_frame_points_count(get(), &e);
error::handle(e);
}
Expand Down Expand Up @@ -853,7 +852,6 @@ namespace rs2

if (get())
{
rs2_error* e = nullptr;
_size = rs2_embedded_frames_count(get(), &e);
error::handle(e);
}
Expand All @@ -868,10 +866,10 @@ namespace rs2
frame first_or_default(rs2_stream s, rs2_format f = RS2_FORMAT_ANY) const
{
frame result;
foreach([&result, s, f](frame frame) {
if (!result && frame.get_profile().stream_type() == s && (f == RS2_FORMAT_ANY || f == frame.get_profile().format()))
foreach([&result, s, f](frame frm) {
if (!result && frm.get_profile().stream_type() == s && (f == RS2_FORMAT_ANY || f == frm.get_profile().format()))
{
result = std::move(frame);
result = std::move(frm);
}
});
return result;
Expand All @@ -884,9 +882,9 @@ namespace rs2
*/
frame first(rs2_stream s, rs2_format f = RS2_FORMAT_ANY) const
{
auto frame = first_or_default(s, f);
if (!frame) throw error("Frame of requested stream type was not found!");
return frame;
auto frm = first_or_default(s, f);
if (!frm) throw error("Frame of requested stream type was not found!");
return frm;
}

/**
Expand Down Expand Up @@ -928,9 +926,9 @@ namespace rs2
}
else
{
foreach([&f, index](const frame& frame) {
if (frame.get_profile().stream_type() == RS2_STREAM_INFRARED && frame.get_profile().stream_index() == index)
f = frame;
foreach([&f, index](const frame& frm) {
if (frm.get_profile().stream_type() == RS2_STREAM_INFRARED &&
frm.get_profile().stream_index() == index) f = frm;
});
}
return f;
Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/hpp/rs_pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace rs2
return _config;
}

config(std::shared_ptr<rs2_config> config) : _config(config) {}
config(std::shared_ptr<rs2_config> cfg) : _config(cfg) {}
private:
std::shared_ptr<rs2_config> _config;
};
Expand Down
8 changes: 4 additions & 4 deletions include/librealsense2/hpp/rs_record_playback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ namespace rs2
* \param[in] file The desired path to which the recorder should save the data
* \param[in] device The device to record
*/
recorder(const std::string& file, rs2::device device)
recorder(const std::string& file, rs2::device dev)
{
rs2_error* e = nullptr;
_dev = std::shared_ptr<rs2_device>(
rs2_create_record_device(device.get().get(), file.c_str(), &e),
rs2_create_record_device(dev.get().get(), file.c_str(), &e),
rs2_delete_device);
rs2::error::handle(e);
}
Expand All @@ -225,11 +225,11 @@ namespace rs2
* \param[in] device The device to record
* \param[in] compression_enabled Indicates if compression is enabled
*/
recorder(const std::string& file, rs2::device device, bool compression_enabled)
recorder(const std::string& file, rs2::device dev, bool compression_enabled)
{
rs2_error* e = nullptr;
_dev = std::shared_ptr<rs2_device>(
rs2_create_record_device_ex(device.get().get(), file.c_str(), compression_enabled, &e),
rs2_create_record_device_ex(dev.get().get(), file.c_str(), compression_enabled, &e),
rs2_delete_device);
rs2::error::handle(e);
}
Expand Down
12 changes: 6 additions & 6 deletions include/librealsense2/hpp/rs_sensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ namespace rs2
class notification
{
public:
notification(rs2_notification* notification)
notification(rs2_notification* nt)
{
rs2_error* e = nullptr;
_description = rs2_get_notification_description(notification, &e);
_description = rs2_get_notification_description(nt, &e);
error::handle(e);
_timestamp = rs2_get_notification_timestamp(notification, &e);
_timestamp = rs2_get_notification_timestamp(nt, &e);
error::handle(e);
_severity = rs2_get_notification_severity(notification, &e);
_severity = rs2_get_notification_severity(nt, &e);
error::handle(e);
_category = rs2_get_notification_category(notification, &e);
_category = rs2_get_notification_category(nt, &e);
error::handle(e);
_serialized_data = rs2_get_notification_serialized_data(notification, &e);
_serialized_data = rs2_get_notification_serialized_data(nt, &e);
error::handle(e);
}

Expand Down

0 comments on commit 6d16dfc

Please sign in to comment.