Skip to content

Commit

Permalink
Fix warnings (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop authored Sep 30, 2024
1 parent 80ef1fd commit 304235b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CPP/Clipper2Lib/include/clipper2/clipper.core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CPP/Clipper2Lib/src/clipper.engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 304235b

Please sign in to comment.