Skip to content

Commit

Permalink
Handle nvmake warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-mp committed Apr 8, 2021
1 parent f966da7 commit c75e89b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common/calibration-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void calibration_model::update(ux_window& window, std::string& error_message)
{
dev.as<rs2::auto_calibrated_device>().set_calibration_table(_calibration);
}
catch (const std::exception& ex)
catch (const std::exception&)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5868,7 +5868,7 @@ namespace rs2
model.add_log(to_string() << "Setting " << opt_model.opt << " to "
<< new_val << " (" << labels[selected] << ")");

opt_model.set_option(opt_model.opt, new_val, error_message);
opt_model.set_option(opt_model.opt, static_cast<float>(new_val), error_message);

// Only apply preset to GUI if set_option was succesful
selected_file_preset = "";
Expand Down
4 changes: 2 additions & 2 deletions common/on-chip-calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ namespace rs2

void tare_ground_truth_calculator::calculate_ground_truth(float& ground_truth)
{
// avarage corners
// average corners
point<double> corners_avg[4];
for (int i = 0; i < 4; ++i)
{
Expand Down Expand Up @@ -2194,7 +2194,7 @@ namespace rs2

ground_truth = 0.0;
for (int i = 0; i < 4; ++i)
ground_truth += rec_sides[i];
ground_truth += static_cast<float>(rec_sides[i]);
ground_truth /= 4.0;
}

Expand Down
8 changes: 4 additions & 4 deletions common/output-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void output_model::open(ux_window& win)
{
is_output_open = true;
config_file::instance().set(configurations::viewer::output_open, true);
default_log_h = (win.height() - 100) / 2;
default_log_h = static_cast<int>((win.height() - 100) / 2);
new_log = true;
}

Expand Down Expand Up @@ -218,7 +218,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
}

if (default_log_h.value() != (win.height() - 100) / 2)
default_log_h = (win.height() - 100) / 2;
default_log_h = static_cast<int>((win.height() - 100) / 2);
}

ImGui::SameLine();
Expand Down Expand Up @@ -275,7 +275,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
ImGui::SetCursorPosX(curr_x - 5);


int percent = total_frames ? 100 * ((double)number_of_drops / (total_frames)) : 0;
int percent = total_frames ? int(100 * ((double)number_of_drops / (total_frames))) : 0;

std::stringstream ss;
ss << u8"\uF043";
Expand Down Expand Up @@ -422,7 +422,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
auto margin = ImGui::GetTextLineHeightWithSpacing() - ImGui::GetTextLineHeight();
auto size = ImGui::CalcTextSize(line.c_str());

auto t = single_wave(time_now - log.time_added + 0.3f) * 0.2f;
auto t = single_wave(static_cast<float>(time_now - log.time_added + 0.3f)) * 0.2f;
if (log.selected) t = 0.2f;

auto pos = ImGui::GetCursorScreenPos();
Expand Down
2 changes: 1 addition & 1 deletion common/rendering.h
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ namespace rs2
auto duration_ms = std::chrono::duration_cast<std::chrono::microseconds>(_duration).count();
auto t = (float)ms / duration_ms;
t = std::max(0.f, std::min(rs2::smoothstep(t, 0.f, 1.f), 1.f));
return _old * (1.f - t) + _new * t;
return static_cast<T>(_old * (1.f - t) + _new * t);
}
operator T() const { return get(); }
T value() const { return _new; }
Expand Down
2 changes: 1 addition & 1 deletion common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace rs2
{
path = get_folder_path(special_folder::user_documents);
}
catch (const std::exception& e)
catch (const std::exception&)
{
std::string msg = "Failed to get Documents folder";
rs2::log(RS2_LOG_SEVERITY_INFO, msg.c_str());
Expand Down
4 changes: 2 additions & 2 deletions common/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ namespace rs2

for (auto& option : curr_exporter->second.options)
{
exporter->set_option(option.first, option.second);
exporter->set_option(option.first, static_cast<float>(option.second));
}

export_frame(fname, std::move(exporter), *not_model, data);
Expand Down Expand Up @@ -1623,7 +1623,7 @@ namespace rs2
float inverse = 1.f / distances.size();
for (auto elem : distances)
{
e += pow(elem - mean, 2);
e += static_cast<float>(pow(elem - mean, 2));
}

auto standard_deviation = sqrt(inverse * e);
Expand Down
2 changes: 1 addition & 1 deletion common/viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace rs2
const float panel_width = 340.f;
const float panel_y = 50.f;

float get_output_height() const { return not_model->output.get_output_height(); }
int get_output_height() const { return not_model->output.get_output_height(); }

rs2::frame handle_ready_frames(const rect& viewer_rect, ux_window& window, int devices, std::string& error_message);

Expand Down
2 changes: 2 additions & 0 deletions src/gl/yuy2rgb-gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "yuy2rgb-gl.h"
#include "option.h"

#ifndef NOMINMAX
#define NOMINMAX
#endif // NOMINMAX

#include <glad/glad.h>

Expand Down
4 changes: 2 additions & 2 deletions tools/realsense-viewer/realsense-viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ int main(int argc, const char** argv) try
{
if (auto not_model = notifications.lock())
{
not_model->output.add_log(severity, msg.filename(), msg.line_number(), msg.raw());
not_model->output.add_log(severity, msg.filename(), (int)(msg.line_number()), msg.raw());
}
});
#endif
Expand Down Expand Up @@ -625,7 +625,7 @@ int main(int argc, const char** argv) try

auto output_rect = rect{ viewer_model.panel_width,
window.height() - viewer_model.get_output_height(),
window.width() - viewer_model.panel_width, viewer_model.get_output_height() };
window.width() - viewer_model.panel_width, float(viewer_model.get_output_height()) };

viewer_model.not_model->output.draw(window, output_rect, *device_models);

Expand Down

0 comments on commit c75e89b

Please sign in to comment.