From 302aebfd1ac204dc1664fcd90150872d16b65803 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Tue, 31 Jan 2023 22:13:15 -0500 Subject: [PATCH] quiet some compiler warnings --- src/draw.cpp | 2 +- src/mouse.cpp | 2 +- src/resource.cpp | 4 ++-- src/resource.h | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/draw.cpp b/src/draw.cpp index 831602da..f364b28d 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -186,7 +186,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) { if(stog->entity.v != 0 && SK.GetEntity(stog->entity)->IsFace()) { // In the interest of speed for the triangle drawing code, // only MAX_SELECTABLE_FACES faces may be selected at a time. - int c = 0; + unsigned int c = 0; Selection *s; selection.ClearTags(); for(s = selection.First(); s; s = selection.NextAfter(s)) { diff --git a/src/mouse.cpp b/src/mouse.cpp index d183f58a..1ee3d33c 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -824,7 +824,7 @@ Vector GraphicsWindow::SnapToEntityByScreenPoint(Point2d pp, hEntity he) { SEdgeList *edges = e->GetOrGenerateEdges(); double minD = -1.0f; - double k; + double k = 0.0; const SEdge *edge = NULL; for(const auto &e : edges->l) { Point2d p0 = ProjectPoint(e.a); diff --git a/src/resource.cpp b/src/resource.cpp index d3fa4caa..8921d7ab 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -273,8 +273,8 @@ std::shared_ptr Pixmap::ReadPng(const Platform::Path &filename, bool fli } bool Pixmap::WritePng(FILE *f, bool flip) { - int colorType = 0; - bool bgr = false; + colorType = 0; + bgr = false; switch(format) { case Format::RGBA: colorType = PNG_COLOR_TYPE_RGBA; bgr = false; break; case Format::BGRA: colorType = PNG_COLOR_TYPE_RGBA; bgr = true; break; diff --git a/src/resource.h b/src/resource.h index d5c2e3f0..35ed2890 100644 --- a/src/resource.h +++ b/src/resource.h @@ -38,6 +38,8 @@ public: size_t height; size_t stride; std::vector data; + int colorType; + bool bgr; static std::shared_ptr Create(Format format, size_t width, size_t height); static std::shared_ptr FromPng(const uint8_t *data, size_t size, bool flip = false);