mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:24:24 +02:00
remove unnecessary writes to appease Xcode's static analyzer
This commit is contained in:
parent
5a3350950b
commit
be0899c41d
7 changed files with 3 additions and 18 deletions
|
@ -813,7 +813,7 @@ Menu::Menu() {
|
||||||
});
|
});
|
||||||
essLogAction->setEnabled(nodeList->getThisNodeCanRez());
|
essLogAction->setEnabled(nodeList->getThisNodeCanRez());
|
||||||
|
|
||||||
action = addActionToQMenuAndActionHash(developerMenu, "Script Log (HMD friendly)...", Qt::NoButton,
|
addActionToQMenuAndActionHash(developerMenu, "Script Log (HMD friendly)...", Qt::NoButton,
|
||||||
qApp, SLOT(showScriptLogs()));
|
qApp, SLOT(showScriptLogs()));
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::VerboseLogging, 0, false,
|
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::VerboseLogging, 0, false,
|
||||||
|
|
|
@ -201,13 +201,12 @@ void Circle3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
||||||
float tickMarkAngle = getMajorTickMarksAngle();
|
float tickMarkAngle = getMajorTickMarksAngle();
|
||||||
float angle = _startAt - fmodf(_startAt, tickMarkAngle) + tickMarkAngle;
|
float angle = _startAt - fmodf(_startAt, tickMarkAngle) + tickMarkAngle;
|
||||||
float angleInRadians = glm::radians(angle);
|
|
||||||
float tickMarkLength = getMajorTickMarksLength();
|
float tickMarkLength = getMajorTickMarksLength();
|
||||||
float startRadius = (tickMarkLength > 0.0f) ? _innerRadius : _outerRadius;
|
float startRadius = (tickMarkLength > 0.0f) ? _innerRadius : _outerRadius;
|
||||||
float endRadius = startRadius + tickMarkLength;
|
float endRadius = startRadius + tickMarkLength;
|
||||||
|
|
||||||
while (angle <= _endAt) {
|
while (angle <= _endAt) {
|
||||||
angleInRadians = glm::radians(angle);
|
float angleInRadians = glm::radians(angle);
|
||||||
|
|
||||||
glm::vec2 thisPointA(cosf(angleInRadians) * startRadius, sinf(angleInRadians) * startRadius);
|
glm::vec2 thisPointA(cosf(angleInRadians) * startRadius, sinf(angleInRadians) * startRadius);
|
||||||
glm::vec2 thisPointB(cosf(angleInRadians) * endRadius, sinf(angleInRadians) * endRadius);
|
glm::vec2 thisPointB(cosf(angleInRadians) * endRadius, sinf(angleInRadians) * endRadius);
|
||||||
|
@ -223,13 +222,12 @@ void Circle3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
||||||
float tickMarkAngle = getMinorTickMarksAngle();
|
float tickMarkAngle = getMinorTickMarksAngle();
|
||||||
float angle = _startAt - fmodf(_startAt, tickMarkAngle) + tickMarkAngle;
|
float angle = _startAt - fmodf(_startAt, tickMarkAngle) + tickMarkAngle;
|
||||||
float angleInRadians = glm::radians(angle);
|
|
||||||
float tickMarkLength = getMinorTickMarksLength();
|
float tickMarkLength = getMinorTickMarksLength();
|
||||||
float startRadius = (tickMarkLength > 0.0f) ? _innerRadius : _outerRadius;
|
float startRadius = (tickMarkLength > 0.0f) ? _innerRadius : _outerRadius;
|
||||||
float endRadius = startRadius + tickMarkLength;
|
float endRadius = startRadius + tickMarkLength;
|
||||||
|
|
||||||
while (angle <= _endAt) {
|
while (angle <= _endAt) {
|
||||||
angleInRadians = glm::radians(angle);
|
float angleInRadians = glm::radians(angle);
|
||||||
|
|
||||||
glm::vec2 thisPointA(cosf(angleInRadians) * startRadius, sinf(angleInRadians) * startRadius);
|
glm::vec2 thisPointA(cosf(angleInRadians) * startRadius, sinf(angleInRadians) * startRadius);
|
||||||
glm::vec2 thisPointB(cosf(angleInRadians) * endRadius, sinf(angleInRadians) * endRadius);
|
glm::vec2 thisPointB(cosf(angleInRadians) * endRadius, sinf(angleInRadians) * endRadius);
|
||||||
|
|
|
@ -2423,9 +2423,7 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
|
||||||
if (appendState != OctreeElement::COMPLETED) {
|
if (appendState != OctreeElement::COMPLETED) {
|
||||||
didntFitProperties = propertiesDidntFit;
|
didntFitProperties = propertiesDidntFit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
packetData->endSubTree();
|
packetData->endSubTree();
|
||||||
|
|
||||||
const char* finalizedData = reinterpret_cast<const char*>(packetData->getFinalizedData());
|
const char* finalizedData = reinterpret_cast<const char*>(packetData->getFinalizedData());
|
||||||
|
@ -2436,7 +2434,6 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
|
||||||
buffer.resize(finalizedSize);
|
buffer.resize(finalizedSize);
|
||||||
} else {
|
} else {
|
||||||
qCDebug(entities) << "ERROR - encoded edit message doesn't fit in output buffer.";
|
qCDebug(entities) << "ERROR - encoded edit message doesn't fit in output buffer.";
|
||||||
success = false;
|
|
||||||
appendState = OctreeElement::NONE; // if we got here, then we didn't include the item
|
appendState = OctreeElement::NONE; // if we got here, then we didn't include the item
|
||||||
// maybe we should assert!!!
|
// maybe we should assert!!!
|
||||||
}
|
}
|
||||||
|
@ -2444,7 +2441,6 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
|
||||||
packetData->discardSubTree();
|
packetData->discardSubTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return appendState;
|
return appendState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2834,7 +2830,6 @@ bool EntityItemProperties::encodeEraseEntityMessage(const EntityItemID& entityIt
|
||||||
outputLength = sizeof(numberOfIds);
|
outputLength = sizeof(numberOfIds);
|
||||||
|
|
||||||
memcpy(copyAt, entityItemID.toRfc4122().constData(), NUM_BYTES_RFC4122_UUID);
|
memcpy(copyAt, entityItemID.toRfc4122().constData(), NUM_BYTES_RFC4122_UUID);
|
||||||
copyAt += NUM_BYTES_RFC4122_UUID;
|
|
||||||
outputLength += NUM_BYTES_RFC4122_UUID;
|
outputLength += NUM_BYTES_RFC4122_UUID;
|
||||||
|
|
||||||
buffer.resize(outputLength);
|
buffer.resize(outputLength);
|
||||||
|
@ -2856,7 +2851,6 @@ bool EntityItemProperties::encodeCloneEntityMessage(const EntityItemID& entityID
|
||||||
outputLength += NUM_BYTES_RFC4122_UUID;
|
outputLength += NUM_BYTES_RFC4122_UUID;
|
||||||
|
|
||||||
memcpy(copyAt, newEntityID.toRfc4122().constData(), NUM_BYTES_RFC4122_UUID);
|
memcpy(copyAt, newEntityID.toRfc4122().constData(), NUM_BYTES_RFC4122_UUID);
|
||||||
copyAt += NUM_BYTES_RFC4122_UUID;
|
|
||||||
outputLength += NUM_BYTES_RFC4122_UUID;
|
outputLength += NUM_BYTES_RFC4122_UUID;
|
||||||
|
|
||||||
buffer.resize(outputLength);
|
buffer.resize(outputLength);
|
||||||
|
|
|
@ -140,7 +140,6 @@ struct IrradianceKTXPayload {
|
||||||
data += sizeof(Version);
|
data += sizeof(Version);
|
||||||
|
|
||||||
memcpy(&_irradianceSH, data, sizeof(SphericalHarmonics));
|
memcpy(&_irradianceSH, data, sizeof(SphericalHarmonics));
|
||||||
data += sizeof(SphericalHarmonics);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,8 +267,6 @@ bool PacketSender::nonThreadedProcess() {
|
||||||
// Keep average packets and time for "second half" of check interval
|
// Keep average packets and time for "second half" of check interval
|
||||||
_lastPPSCheck += (elapsedSinceLastCheck / 2);
|
_lastPPSCheck += (elapsedSinceLastCheck / 2);
|
||||||
_packetsOverCheckInterval = (_packetsOverCheckInterval / 2);
|
_packetsOverCheckInterval = (_packetsOverCheckInterval / 2);
|
||||||
|
|
||||||
elapsedSinceLastCheck = now - _lastPPSCheck;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,12 +294,10 @@ bool PacketSender::nonThreadedProcess() {
|
||||||
DependencyManager::get<NodeList>()->sendPacketList(std::move(packetPair.second.second), *packetPair.first);
|
DependencyManager::get<NodeList>()->sendPacketList(std::move(packetPair.second.second), *packetPair.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
packetsSentThisCall += packetCount;
|
packetsSentThisCall += packetCount;
|
||||||
_packetsOverCheckInterval += packetCount;
|
_packetsOverCheckInterval += packetCount;
|
||||||
_totalPacketsSent += packetCount;
|
_totalPacketsSent += packetCount;
|
||||||
|
|
||||||
|
|
||||||
_totalBytesSent += packetSize;
|
_totalBytesSent += packetSize;
|
||||||
emit packetSent(packetSize); // FIXME should include number of packets?
|
emit packetSent(packetSize); // FIXME should include number of packets?
|
||||||
_lastSendTime = now;
|
_lastSendTime = now;
|
||||||
|
|
|
@ -401,7 +401,6 @@ int Octree::readElementData(const OctreeElementPointer& destinationElement, cons
|
||||||
// tell the element to read the subsequent data
|
// tell the element to read the subsequent data
|
||||||
int rootDataSize = _rootElement->readElementDataFromBuffer(nodeData + bytesRead, bytesLeftToRead, args);
|
int rootDataSize = _rootElement->readElementDataFromBuffer(nodeData + bytesRead, bytesLeftToRead, args);
|
||||||
bytesRead += rootDataSize;
|
bytesRead += rootDataSize;
|
||||||
bytesLeftToRead -= rootDataSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytesRead;
|
return bytesRead;
|
||||||
|
|
|
@ -61,7 +61,6 @@ PointerFrameHeaderList parseFrameHeaders(uchar* const start, const size_t& size)
|
||||||
current += sizeof(FrameSize);
|
current += sizeof(FrameSize);
|
||||||
header.fileOffset = current - start;
|
header.fileOffset = current - start;
|
||||||
if (end - current < header.size) {
|
if (end - current < header.size) {
|
||||||
current = end;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
current += header.size;
|
current += header.size;
|
||||||
|
|
Loading…
Reference in a new issue