mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 19:01:02 +00:00
build: clear 5 warning categories across 19 sites (#15628)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <limits>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "DevMapping.h"
|
||||
#include "DevFilaSystem.h"
|
||||
@@ -270,7 +272,7 @@ namespace Slic3r
|
||||
std::set<int> picked_tar;
|
||||
for (int k = 0; k < distance_map.size(); k++)
|
||||
{
|
||||
float min_val = INT_MAX;
|
||||
float min_val = std::numeric_limits<float>::max();
|
||||
int picked_src_idx = -1;
|
||||
int picked_tar_idx = -1;
|
||||
for (int i = 0; i < distance_map.size(); i++)
|
||||
|
||||
@@ -297,7 +297,7 @@ void MeshClipper::recalculate_triangles()
|
||||
// it so it lies on our line. This will be the figure to subtract
|
||||
// from the cut. The coordinates must not overflow after the transform,
|
||||
// make the rectangle a bit smaller.
|
||||
const coord_t size = (std::numeric_limits<coord_t>::max()/2 - scale_(std::max(std::abs(e * a), std::abs(e * b)))) / 4;
|
||||
const coord_t size = (double(std::numeric_limits<coord_t>::max()/2) - scale_(std::max(std::abs(e * a), std::abs(e * b)))) / 4;
|
||||
Polygons ep {Polygon({Point(-size, 0), Point(size, 0), Point(size, 2*size), Point(-size, 2*size)})};
|
||||
ep.front().rotate(angle);
|
||||
ep.front().translate(scale_(-e * a), scale_(-e * b));
|
||||
@@ -352,7 +352,7 @@ void MeshClipper::recalculate_triangles()
|
||||
|
||||
// To prevent overflow after scaling, downscale the input if needed:
|
||||
double extra_scale = 1.;
|
||||
coord_t limit = coord_t(std::min(std::numeric_limits<coord_t>::max() / (2. * std::max(1., scale_x)), std::numeric_limits<coord_t>::max() / (2. * std::max(1., scale_y))));
|
||||
coord_t limit = coord_t(std::min(double(std::numeric_limits<coord_t>::max()) / (2. * std::max(1., scale_x)), double(std::numeric_limits<coord_t>::max()) / (2. * std::max(1., scale_y))));
|
||||
coord_t max_coord = 0;
|
||||
for (const Point& pt : exp.contour)
|
||||
max_coord = std::max(max_coord, std::max(std::abs(pt.x()), std::abs(pt.y())));
|
||||
|
||||
@@ -1803,7 +1803,7 @@ static void* get_function(const char* name)
|
||||
return function;
|
||||
|
||||
#if defined(_MSC_VER) || defined(_WIN32)
|
||||
function = GetProcAddress(module, name);
|
||||
function = reinterpret_cast<void*>(GetProcAddress(module, name));
|
||||
#else
|
||||
function = dlsym(module, name);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user