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 Coverity issues #12533

Merged
merged 1 commit into from
Dec 24, 2023
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
24 changes: 0 additions & 24 deletions src/fw-logs/fw-log-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,6 @@ namespace librealsense
{
namespace fw_logs
{
fw_log_data::fw_log_data()
{
_magic_number = 0;
_severity = 0;
_file_id = 0;
_group_id = 0;
_event_id = 0;
_line = 0;
_sequence = 0;
_p1 = 0;
_p2 = 0;
_p3 = 0;
_timestamp = 0;
_delta = 0;
_message = "";
_file_name = "";
}


fw_log_data::~fw_log_data()
{
}


rs2_log_severity fw_log_data::get_severity() const
{
return fw_logs_severity_to_log_severity(_severity);
Expand Down
35 changes: 16 additions & 19 deletions src/fw-logs/fw-log-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,24 @@ namespace librealsense
class fw_log_data
{
public:
fw_log_data();
~fw_log_data();
uint32_t _magic_number = 0;
uint32_t _severity = 0;
uint32_t _file_id = 0;
uint32_t _group_id = 0;
uint32_t _event_id = 0;
uint32_t _line = 0;
uint32_t _sequence = 0;
uint32_t _p1 = 0;
uint32_t _p2 = 0;
uint32_t _p3 = 0;
uint64_t _timestamp = 0;
double _delta = 0.0;

uint32_t _magic_number;
uint32_t _severity;
uint32_t _file_id;
uint32_t _group_id;
uint32_t _event_id;
uint32_t _line;
uint32_t _sequence;
uint32_t _p1;
uint32_t _p2;
uint32_t _p3;
uint64_t _timestamp;
double _delta;
uint32_t _thread_id = 0;

uint32_t _thread_id;

std::string _message;
std::string _file_name;
std::string _thread_name;
std::string _message = "";
std::string _file_name = "";
std::string _thread_name = "";

rs2_log_severity get_severity() const;
const std::string& get_message() const;
Expand Down
2 changes: 1 addition & 1 deletion src/proc/disparity-transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace librealsense
auto in = reinterpret_cast<const Tin*>(in_data);
auto out = reinterpret_cast<Tout*>(out_data);

bool fp = (std::is_floating_point<Tin>::value);
const bool fp = (std::is_floating_point<Tin>::value);
const float round = fp ? 0.5f : 0.f;

float input{};
Expand Down
6 changes: 3 additions & 3 deletions src/proc/spatial-filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace librealsense
void dxf_smooth(void *frame_data, float alpha, float delta, int iterations)
{
static_assert((std::is_arithmetic<T>::value), "Spatial filter assumes numeric types");
bool fp = (std::is_floating_point<T>::value);
const bool fp = (std::is_floating_point<T>::value);

for (int i = 0; i < iterations; i++)
{
Expand Down Expand Up @@ -61,7 +61,7 @@ namespace librealsense
size_t v{}, u{};

// Handle conversions for invalid input data
bool fp = (std::is_floating_point<T>::value);
const bool fp = (std::is_floating_point<T>::value);

// Filtering integer values requires round-up to the nearest discrete value
const float round = fp ? 0.f : 0.5f;
Expand Down Expand Up @@ -156,7 +156,7 @@ namespace librealsense
size_t v{}, u{};

// Handle conversions for invalid input data
bool fp = (std::is_floating_point<T>::value);
const bool fp = (std::is_floating_point<T>::value);

// Filtering integer values requires round-up to the nearest discrete value
const float round = fp ? 0.f : 0.5f;
Expand Down
Loading