Eliminated warnings in gcc

Note that the call to encodeNode() in FBXWriter.cpp can never be reached, so it's safe to remove it.
This commit is contained in:
Oren Hurvitz 2018-04-30 15:05:27 +03:00
parent 1e25d48941
commit a226790295
6 changed files with 16 additions and 2 deletions

View file

@ -63,7 +63,7 @@ struct AssetMeta {
AssetMeta() {
}
BakeVersion bakeVersion;
BakeVersion bakeVersion { INITIAL_BAKE_VERSION };
bool failedLastBake { false };
QString lastBakeErrors;
};

View file

@ -149,6 +149,9 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
lostAudioData(packetsDropped);
// fall through to OnTime case
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
}
case SequenceNumberStats::OnTime: {
// Packet is on time; parse its data to the ringbuffer

View file

@ -1402,6 +1402,9 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
case PacketType::EntityAdd:
isAdd = true; // fall through to next case
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
case PacketType::EntityPhysics:
case PacketType::EntityEdit: {
quint64 startDecode = 0, endDecode = 0;

View file

@ -142,7 +142,6 @@ void FBXWriter::encodeFBXProperty(QDataStream& out, const QVariant& prop) {
out << prop.toInt();
break;
encodeNode(out, FBXNode());
case QMetaType::Float:
out.device()->write("F", 1);
out << prop.toFloat();

View file

@ -749,6 +749,9 @@ bool Resource::handleFailedRequest(ResourceRequest::Result result) {
case ResourceRequest::Result::Timeout: {
qCDebug(networking) << "Timed out loading" << _url << "received" << _bytesReceived << "total" << _bytesTotal;
// Fall through to other cases
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
}
case ResourceRequest::Result::ServerUnavailable: {
_attempts++;
@ -767,6 +770,9 @@ bool Resource::handleFailedRequest(ResourceRequest::Result result) {
break;
}
// fall through to final failure
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
}
default: {
_attemptsRemaining = 0;

View file

@ -60,6 +60,9 @@ bool gunzip(QByteArray source, QByteArray &destination) {
switch (status) {
case Z_NEED_DICT:
status = Z_DATA_ERROR;
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
case Z_DATA_ERROR:
case Z_MEM_ERROR:
case Z_STREAM_ERROR: