From c060f320530f64055980a4f53e8c95ba728f9c10 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 30 Sep 2024 02:03:16 -0500 Subject: [PATCH] Fix warnings --- CPP/Clipper2Lib/include/clipper2/clipper.core.h | 3 +++ CPP/Clipper2Lib/src/clipper.engine.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index 40124804..624de903 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -88,6 +88,9 @@ namespace Clipper2Lib throw Clipper2Exception(undefined_error); case range_error_i: throw Clipper2Exception(range_error); + // Should never happen, but adding this to stop a compiler warning + default: + throw Clipper2Exception("Unknown error"); } #else ++error_code; // only to stop compiler warning diff --git a/CPP/Clipper2Lib/src/clipper.engine.cpp b/CPP/Clipper2Lib/src/clipper.engine.cpp index d3a146b4..97717322 100644 --- a/CPP/Clipper2Lib/src/clipper.engine.cpp +++ b/CPP/Clipper2Lib/src/clipper.engine.cpp @@ -928,6 +928,9 @@ namespace Clipper2Lib { case FillRule::Negative: if (e.wind_cnt != -1) return false; break; + // Should never happen, but adding this to stop a compiler warning + default: + break; } switch (cliptype_) @@ -978,6 +981,9 @@ namespace Clipper2Lib { break; case ClipType::Xor: return true; break; + // Should never happen, but adding this to stop a compiler warning + default: + break; } return false; // we should never get here }