Skip to content

Commit 16c5fa6

Browse files
ruevswhitequark
authored andcommitted
Fix eight trivial "implicit conversion 'double' to 'int'" warnings. NFC.
1 parent 64c0f62 commit 16c5fa6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/render/rendergl1.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,8 @@ void OpenGl1Renderer::UpdateProjection() {
708708
UnSelectPrimitive();
709709

710710
glViewport(0, 0,
711-
camera.width * camera.pixelRatio,
712-
camera.height * camera.pixelRatio);
711+
(GLsizei)(camera.width * camera.pixelRatio),
712+
(GLsizei)(camera.height * camera.pixelRatio));
713713

714714
glMatrixMode(GL_PROJECTION);
715715
glLoadIdentity();
@@ -821,8 +821,8 @@ void OpenGl1Renderer::FinishFrame() {
821821
}
822822

823823
std::shared_ptr<Pixmap> OpenGl1Renderer::ReadFrame() {
824-
int width = camera.width * camera.pixelRatio;
825-
int height = camera.height * camera.pixelRatio;
824+
int width = (int)(camera.width * camera.pixelRatio);
825+
int height = (int)(camera.height * camera.pixelRatio);
826826
std::shared_ptr<Pixmap> pixmap =
827827
Pixmap::Create(Pixmap::Format::RGB, (size_t)width, (size_t)height);
828828
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &pixmap->data[0]);

src/solvespace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) {
361361
}
362362

363363
v /= pow((viewUnits == Unit::INCHES) ? 25.4 : 1000, dim);
364-
int vdeg = floor((log10(fabs(v))) / dim);
364+
int vdeg = (int)((log10(fabs(v))) / dim);
365365
std::string unit;
366366
if(fabs(v) > 0.0) {
367367
int sdeg = 0;
@@ -371,7 +371,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) {
371371
: SelectSIPrefixMm(vdeg);
372372
v /= pow(10.0, sdeg * dim);
373373
}
374-
int pdeg = ceil(log10(fabs(v) + 1e-10));
374+
int pdeg = (int)ceil(log10(fabs(v) + 1e-10));
375375
return ssprintf("%#.*g%s%s%s", pdeg + UnitDigitsAfterDecimal(), v,
376376
compact ? "" : " ", unit.c_str(), DimToString(dim));
377377
}

src/srf/surface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ void SShell::MakeFromHelicalRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector
646646
// for testing - hard code the axial distance, and number of sections.
647647
// distance will need to be parameters in the future.
648648
double dist = distf - dists;
649-
int sections = fabs(anglef - angles) / (PI / 2) + 1;
649+
int sections = (int)(fabs(anglef - angles) / (PI / 2) + 1);
650650
double wedge = (anglef - angles) / sections;
651651

652652
if(CheckNormalAxisRelationship(sbls, pt, axis, anglef-angles, distf-dists)) {

src/toolbar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, UiCanvas *canvas,
219219
{
220220
if(hitCommand) *hitCommand = icon.command;
221221
if(hitX) *hitX = x - boxhw;
222-
if(hitY) *hitY = height - (y + boxhw);
222+
if(hitY) *hitY = (int)height - (y + boxhw);
223223
}
224224
}
225225

0 commit comments

Comments
 (0)