aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-04-18 21:06:54 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-04-20 15:44:15 +0000
commitdf66e9264debda2ec6838e69e620a54847c71b0a (patch)
tree3693dc93d507b9ea9b5dac497b55fed82988168b /src
parent749a7212e903d8e8c6f256edb1836b9449cc7fe1 (diff)
Silence GCC 7 warnings about implicit fallthrough in Qt code
This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/particles/qquickimageparticle.cpp7
-rw-r--r--src/qml/compiler/qv4ssa.cpp2
-rw-r--r--src/qml/jit/qv4isel_masm.cpp1
-rw-r--r--src/qml/jit/qv4regalloc.cpp2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
-rw-r--r--src/qml/jsruntime/qv4value.cpp3
-rw-r--r--src/quick/items/qquicktextinput.cpp1
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp2
-rw-r--r--src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp1
-rw-r--r--src/quick/scenegraph/util/qsgshadersourcebuilder.cpp4
10 files changed, 23 insertions, 2 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index ccfebddb0e..1919e2ff20 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -1323,6 +1323,7 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node)
getState<ImageMaterialData>(m_material)->animSheetSize = QSizeF(image.size());
if (m_spriteEngine)
m_spriteEngine->setCount(m_count);
+ Q_FALLTHROUGH();
case Tabled:
if (!m_material)
m_material = TabledMaterial::createMaterial();
@@ -1355,12 +1356,15 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node)
getState<ImageMaterialData>(m_material)->colorTable = QSGPlainTexture::fromImage(colortable);
fillUniformArrayFromImage(getState<ImageMaterialData>(m_material)->sizeTable, sizetable, UNIFORM_ARRAY_SIZE);
fillUniformArrayFromImage(getState<ImageMaterialData>(m_material)->opacityTable, opacitytable, UNIFORM_ARRAY_SIZE);
+ Q_FALLTHROUGH();
case Deformable:
if (!m_material)
m_material = DeformableMaterial::createMaterial();
+ Q_FALLTHROUGH();
case Colored:
if (!m_material)
m_material = ColoredMaterial::createMaterial();
+ Q_FALLTHROUGH();
default://Also Simple
if (!m_material)
m_material = SimpleMaterial::createMaterial();
@@ -1530,6 +1534,7 @@ void QQuickImageParticle::prepareNextFrame(QSGNode **node)
if (m_spriteEngine)
m_spriteEngine->updateSprites(timeStamp);//fires signals if anim changed
spritesUpdate(time);
+ Q_FALLTHROUGH();
case Tabled:
case Deformable:
case Colored:
@@ -1691,6 +1696,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx)
writeTo->animWidth = getState<ImageMaterialData>(m_material)->animSheetSize.width();
writeTo->animHeight = getState<ImageMaterialData>(m_material)->animSheetSize.height();
}
+ Q_FALLTHROUGH();
case Tabled:
case Deformable:
//Initial Rotation
@@ -1737,6 +1743,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx)
getShadowDatum(datum)->autoRotate = autoRotate;
}
}
+ Q_FALLTHROUGH();
case Colored:
//Color initialization
// Particle color
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index cc542e94e7..62e2833089 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -2345,6 +2345,7 @@ private:
case OpIncrement:
case OpDecrement:
Q_ASSERT(!"Inplace operators should have been removed!");
+ Q_UNREACHABLE();
default:
Q_UNIMPLEMENTED();
Q_UNREACHABLE();
@@ -2645,6 +2646,7 @@ private:
case OpMul:
if (!targetTemp || !knownOk.contains(*targetTemp))
return false;
+ Q_FALLTHROUGH();
case OpBitAnd:
case OpBitOr:
case OpBitXor:
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 7797f8c8db..4afcd1517f 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -994,6 +994,7 @@ void InstructionSelection<JITAssembler>::convertTypeToBool(IR::Expr *source, IR:
generateRuntimeCall(_as, JITTargetPlatform::ReturnValueRegister, toBoolean,
PointerToValue(source));
_as->storeBool(JITTargetPlatform::ReturnValueRegister, target);
+ Q_FALLTHROUGH();
case IR::VarType:
default:
Pointer addr = _as->loadAddress(JITTargetPlatform::ScratchRegister, source);
diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp
index 8eafaaaa8a..d418b050c4 100644
--- a/src/qml/jit/qv4regalloc.cpp
+++ b/src/qml/jit/qv4regalloc.cpp
@@ -125,6 +125,7 @@ protected:
*out << ri->prettyName();
break;
}
+ Q_FALLTHROUGH();
}
default:
IRPrinterWithPositions::visitTemp(e);
@@ -662,6 +663,7 @@ protected: // IRDecoder
addUses(rightSource->asTemp(), Use::MustHaveRegister);
break;
}
+ Q_FALLTHROUGH();
#endif
case OpBitAnd:
case OpBitOr:
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 43e99cf768..42bf24d7f3 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -472,6 +472,7 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val
switch (value.type()) {
case Value::Empty_Type:
Q_ASSERT(!"empty Value encountered");
+ Q_UNREACHABLE();
case Value::Undefined_Type:
return engine->id_undefined()->d();
case Value::Null_Type:
@@ -504,6 +505,7 @@ static Heap::String *convert_to_string_add(ExecutionEngine *engine, const Value
switch (value.type()) {
case Value::Empty_Type:
Q_ASSERT(!"empty Value encountered");
+ Q_UNREACHABLE();
case Value::Undefined_Type:
return engine->id_undefined()->d();
case Value::Null_Type:
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp
index e34ac9c764..f41442df7a 100644
--- a/src/qml/jsruntime/qv4value.cpp
+++ b/src/qml/jsruntime/qv4value.cpp
@@ -113,6 +113,7 @@ double Value::toNumberImpl() const
case QV4::Value::Managed_Type:
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
+ Q_FALLTHROUGH();
#else
if (String *s = stringValue())
return RuntimeHelpers::stringToNumber(s->toQString());
@@ -140,6 +141,7 @@ QString Value::toQStringNoThrow() const
switch (type()) {
case Value::Empty_Type:
Q_ASSERT(!"empty Value encountered");
+ Q_UNREACHABLE();
case Value::Undefined_Type:
return QStringLiteral("undefined");
case Value::Null_Type:
@@ -193,6 +195,7 @@ QString Value::toQString() const
switch (type()) {
case Value::Empty_Type:
Q_ASSERT(!"empty Value encountered");
+ Q_UNREACHABLE();
case Value::Undefined_Type:
return QStringLiteral("undefined");
case Value::Null_Type:
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 1edff3ff83..f4a88a1c45 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -3885,6 +3885,7 @@ void QQuickTextInputPrivate::parseInputMask(const QString &maskFields)
break;
case '\\':
escape = true;
+ Q_FALLTHROUGH();
default:
s = true;
break;
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index d4324bc489..14f8514289 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -338,7 +338,7 @@ void Updater::visitNode(Node *n)
case QSGNode::RenderNodeType:
if (m_added)
n->renderNodeElement()->root = m_roots.last();
- // Fall through to visit children.
+ Q_FALLTHROUGH(); // to visit children
default:
SHADOWNODE_TRAVERSE(n) visitNode(child);
break;
diff --git a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp
index 48ab1aa52f..2b70139b37 100644
--- a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp
+++ b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp
@@ -133,6 +133,7 @@ Tokenizer::Token Tokenizer::next()
pos += 3;
return Token_Void;
}
+ Q_FALLTHROUGH();
}
case ';': return Token_SemiColon;
diff --git a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp
index d8f92919cb..e134a5d4d3 100644
--- a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp
+++ b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp
@@ -122,6 +122,7 @@ Tokenizer::Token Tokenizer::next()
case '*':
if (*pos == '/')
return Token_MultiLineCommentEnd;
+ Q_FALLTHROUGH();
case '\n':
return Token_NewLine;
@@ -129,6 +130,7 @@ Tokenizer::Token Tokenizer::next()
case '\r':
if (*pos == '\n')
return Token_NewLine;
+ Q_FALLTHROUGH();
case '#': {
if (*pos == 'v' && pos[1] == 'e' && pos[2] == 'r' && pos[3] == 's'
@@ -177,7 +179,7 @@ Tokenizer::Token Tokenizer::next()
pos += 3;
return Token_Void;
}
- // Fall-thru
+ Q_FALLTHROUGH();
}
default:
// Identifier...