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() { AssetMeta() {
} }
BakeVersion bakeVersion; BakeVersion bakeVersion { INITIAL_BAKE_VERSION };
bool failedLastBake { false }; bool failedLastBake { false };
QString lastBakeErrors; QString lastBakeErrors;
}; };

View file

@ -149,6 +149,9 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
lostAudioData(packetsDropped); lostAudioData(packetsDropped);
// fall through to OnTime case // fall through to OnTime case
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
} }
case SequenceNumberStats::OnTime: { case SequenceNumberStats::OnTime: {
// Packet is on time; parse its data to the ringbuffer // 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: case PacketType::EntityAdd:
isAdd = true; // fall through to next case isAdd = true; // fall through to next case
#if defined(__GNUC__)
[[gnu::fallthrough]];
#endif
case PacketType::EntityPhysics: case PacketType::EntityPhysics:
case PacketType::EntityEdit: { case PacketType::EntityEdit: {
quint64 startDecode = 0, endDecode = 0; quint64 startDecode = 0, endDecode = 0;

View file

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

View file

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

View file

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