Silence some gcc 7 warnings.

* Mark switch fallthrough
    (-Wfallthrough);
  * Initialize variables to avoid false positives
    (-Wmaybe-uninitialized);
  * Fudge indentation to avoid false positives
    (-Wmisleading-indentation).
pull/144/head
whitequark 2019-03-28 09:39:03 +00:00
parent 8903e1768c
commit a7b2f28999
6 changed files with 9 additions and 6 deletions

View File

@ -332,7 +332,7 @@ GraphicsWindow::Selection GraphicsWindow::ChooseFromHoverToSelect() {
Group *activeGroup = SK.GetGroup(SS.GW.activeGroup);
int bestOrder = -1;
int bestZIndex;
int bestZIndex = 0;
for(const Hover &hov : hoverList) {
hGroup hg = {};
if(hov.selection.entity.v != 0) {

View File

@ -297,7 +297,7 @@ void Entity::ComputeInterpolatingSpline(SBezierList *sbl, bool periodic) const {
// The wrapping would work, except when n = 1 and everything
// wraps to zero...
if(i > 0) bm.A[i][i - 1] = eq.x;
bm.A[i][i] = eq.y;
/**/ bm.A[i][i] = eq.y;
if(i < (n-1)) bm.A[i][i + 1] = eq.z;
}
}

View File

@ -703,7 +703,8 @@ void GraphicsWindow::MenuView(Command id) {
if(SS.GW.LockedInWorkplane()) {
SS.GW.AnimateOntoWorkplane();
break;
} // if not in 2d mode fall through and use ORTHO logic
} // if not in 2d mode use ORTHO logic
// fallthrough
case Command::NEAREST_ORTHO:
case Command::NEAREST_ISO: {
static const Vector ortho[3] = {

View File

@ -293,6 +293,7 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
} else {
SS.GW.pending.hasSuggestion = false;
}
// fallthrough
case Pending::DRAGGING_NEW_POINT:
UpdateDraggedPoint(pending.point, x, y);
HitTestMakeSelection(mp);

View File

@ -277,7 +277,7 @@ void OpenGl3Renderer::InvalidatePixmap(std::shared_ptr<const Pixmap> pm) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
GLenum format;
GLenum format = 0;
switch(pm->format) {
case Pixmap::Format::RGBA: format = GL_RGBA; break;
case Pixmap::Format::RGB: format = GL_RGB; break;
@ -340,7 +340,7 @@ void OpenGl3Renderer::DoStippledLine(const Vector &a, const Vector &b, hStroke h
return;
}
const char *patternSeq;
const char *patternSeq = NULL;
Stroke s = *stroke;
s.stipplePattern = StipplePattern::CONTINUOUS;
hcs = GetStroke(s);

View File

@ -1068,8 +1068,9 @@ int PluralExpr::Token::Precedence() {
return 3;
case Op::NONE:
ssassert(false, "Unexpected operator");
;
}
ssassert(false, "Unexpected operator");
case Type::QUERY:
case Type::COLON: