diff --git a/domain-server/src/DomainGatekeeper.cpp b/domain-server/src/DomainGatekeeper.cpp index f87a993df1..9f55d20df0 100644 --- a/domain-server/src/DomainGatekeeper.cpp +++ b/domain-server/src/DomainGatekeeper.cpp @@ -1196,7 +1196,7 @@ Node::LocalID DomainGatekeeper::findOrCreateLocalID(const QUuid& uuid) { return existingLocalIDIt->second; } - assert(_localIDs.size() < std::numeric_limits::max() - 2); + assert(_localIDs.size() < (size_t)(std::numeric_limits::max() - 2)); Node::LocalID newLocalID; do { diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index ae453d5b00..b6a2ea3ed9 100755 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -168,6 +168,7 @@ const btCollisionShape* OtherAvatar::createCollisionShape(int32_t jointIndex, bo } // Note: MultiSphereLow case really means: "skip fingers and use spheres for hands, // else fall through to MultiSphereHigh case" + /* fall-thru */ case BodyLOD::MultiSphereHigh: computeDetailedShapeInfo(shapeInfo, jointIndex); break; diff --git a/interface/src/ui/OctreeStatsDialog.cpp b/interface/src/ui/OctreeStatsDialog.cpp index ea0f05f47f..43efe98d9d 100644 --- a/interface/src/ui/OctreeStatsDialog.cpp +++ b/interface/src/ui/OctreeStatsDialog.cpp @@ -424,6 +424,7 @@ void OctreeStatsDialog::showOctreeServersOfType(NodeType_t serverType) { extraDetails << "
" << itemInfo.caption << " " << stats.getItemValue(item); } } // fall through... since MOST has all of MORE + /* fall-thru */ case MORE: { QString totalString = locale.toString((uint)stats.getTotalElements()); QString internalString = locale.toString((uint)stats.getTotalInternal()); diff --git a/libraries/entities-renderer/src/RenderableEntityItem.h b/libraries/entities-renderer/src/RenderableEntityItem.h index 39c30e5883..69fb9aca23 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.h +++ b/libraries/entities-renderer/src/RenderableEntityItem.h @@ -154,7 +154,6 @@ protected: std::mutex _materialsLock; quint64 _created; - QUuid _entityID; // The base class relies on comparing the model transform to the entity transform in order // to trigger an update, so the member must not be visible to derived classes as a modifiable @@ -164,6 +163,8 @@ protected: // i.e. to see if the rendering code needs to update because of a change in state of the // entity. This forces all the rendering code itself to be independent of the entity const EntityItemPointer _entity; + + QUuid _entityID; }; template diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index bfa02e6483..8bca6cbe96 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -166,7 +166,7 @@ void ParticleEffectEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEn particleUniforms.rotateWithEntity = _particleProperties.rotateWithEntity ? 1 : 0; }); // Update particle uniforms - memcpy(&_uniformBuffer.edit(), &particleUniforms, sizeof(ParticleUniforms)); + _uniformBuffer.edit() = particleUniforms; } ItemKey ParticleEffectEntityRenderer::getKey() { diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h index 2532de31b0..a13718f5a2 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h @@ -378,10 +378,10 @@ protected: TransformCamera _cams[2]; Cameras(){}; - Cameras(const TransformCamera& cam) { memcpy(_cams, &cam, sizeof(TransformCamera)); }; + Cameras(const TransformCamera& cam) { _cams[0] = cam; }; Cameras(const TransformCamera& camL, const TransformCamera& camR) { - memcpy(_cams, &camL, sizeof(TransformCamera)); - memcpy(_cams + 1, &camR, sizeof(TransformCamera)); + _cams[0] = camL; + _cams[1] = camR; }; }; diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackendState.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackendState.cpp index 0c2c0ae744..c939b734dd 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackendState.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackendState.cpp @@ -331,8 +331,7 @@ void GLBackend::do_setStateBlendFactor(const Batch& batch, size_t paramOffset) { void GLBackend::do_setStateScissorRect(const Batch& batch, size_t paramOffset) { Vec4i rect; - memcpy(&rect, batch.readData(batch._params[paramOffset]._uint), sizeof(Vec4i)); - + memcpy(glm::value_ptr(rect), batch.readData(batch._params[paramOffset]._uint), sizeof(Vec4i)); if (_stereo.isStereo()) { rect.z /= 2; if (_stereo._pass) { diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackendTransform.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackendTransform.cpp index 555a0a1e41..67ab502b6b 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackendTransform.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackendTransform.cpp @@ -24,7 +24,7 @@ void GLBackend::do_setViewTransform(const Batch& batch, size_t paramOffset) { } void GLBackend::do_setProjectionTransform(const Batch& batch, size_t paramOffset) { - memcpy(&_transform._projection, batch.readData(batch._params[paramOffset]._uint), sizeof(Mat4)); + memcpy(glm::value_ptr(_transform._projection), batch.readData(batch._params[paramOffset]._uint), sizeof(Mat4)); _transform._invalidProj = true; } @@ -35,7 +35,7 @@ void GLBackend::do_setProjectionJitter(const Batch& batch, size_t paramOffset) { } void GLBackend::do_setViewportTransform(const Batch& batch, size_t paramOffset) { - memcpy(&_transform._viewport, batch.readData(batch._params[paramOffset]._uint), sizeof(Vec4i)); + memcpy(glm::value_ptr(_transform._viewport), batch.readData(batch._params[paramOffset]._uint), sizeof(Vec4i)); #ifdef GPU_STEREO_DRAWCALL_INSTANCED { diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.cpp b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.cpp index 192071d3af..f14c63b560 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.cpp +++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.cpp @@ -440,6 +440,7 @@ QVector scriptable::ScriptableMeshPart::getFace(glm::uint32 faceInd if (faceIndex < getNumFaces()) { return getIndices().mid(faceIndex * getTopologyLength(), getTopologyLength()); } + /* fall-thru */ default: return QVector(); } } diff --git a/libraries/image/src/image/CubeMap.cpp b/libraries/image/src/image/CubeMap.cpp index 9196377daa..fdb1760b5d 100644 --- a/libraries/image/src/image/CubeMap.cpp +++ b/libraries/image/src/image/CubeMap.cpp @@ -99,10 +99,10 @@ public: const size_t offsetHL = hiCoords.x + loCoords.y * _lineStride; const size_t offsetLH = loCoords.x + hiCoords.y * _lineStride; const size_t offsetHH = hiCoords.x + hiCoords.y * _lineStride; - assert(offsetLL >= 0 && offsetLL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); - assert(offsetHL >= 0 && offsetHL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); - assert(offsetLH >= 0 && offsetLH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); - assert(offsetHH >= 0 && offsetHH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetLL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetHL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetLH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetHH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); glm::vec4 colorLL = pixels[offsetLL]; glm::vec4 colorHL = pixels[offsetHL]; glm::vec4 colorLH = pixels[offsetLH]; diff --git a/libraries/octree/src/OctreePacketData.cpp b/libraries/octree/src/OctreePacketData.cpp index 5e6825c886..3966fcf86f 100755 --- a/libraries/octree/src/OctreePacketData.cpp +++ b/libraries/octree/src/OctreePacketData.cpp @@ -16,6 +16,7 @@ #include "OctreeLogging.h" #include "NumericalConstants.h" +#include bool OctreePacketData::_debug = false; AtomicUIntStat OctreePacketData::_totalBytesOfOctalCodes { 0 }; @@ -702,17 +703,17 @@ void OctreePacketData::debugBytes() { } int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, glm::vec2& result) { - memcpy(&result, dataBytes, sizeof(result)); + memcpy(glm::value_ptr(result), dataBytes, sizeof(result)); return sizeof(result); } int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, glm::vec3& result) { - memcpy(&result, dataBytes, sizeof(result)); + memcpy(glm::value_ptr(result), dataBytes, sizeof(result)); return sizeof(result); } int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, glm::u8vec3& result) { - memcpy(&result, dataBytes, sizeof(result)); + memcpy(glm::value_ptr(result), dataBytes, sizeof(result)); return sizeof(result); } @@ -743,7 +744,12 @@ int OctreePacketData::unpackDataFromBytes(const unsigned char *dataBytes, QVecto memcpy(&length, dataBytes, sizeof(uint16_t)); dataBytes += sizeof(length); result.resize(length); - memcpy(result.data(), dataBytes, length * sizeof(glm::vec3)); + + for(int i=0;isetTexture(gr::Texture::MaterialAlbedo, textureCache->getWhiteTexture()); diff --git a/libraries/shared/src/BufferParser.h b/libraries/shared/src/BufferParser.h index c73356558e..cd1e46b0d6 100644 --- a/libraries/shared/src/BufferParser.h +++ b/libraries/shared/src/BufferParser.h @@ -18,6 +18,7 @@ #include "GLMHelpers.h" #include "ByteCountCoding.h" #include "PropertyFlags.h" +#include class BufferParser { public: @@ -98,7 +99,10 @@ template<> inline void BufferParser::readValue(QVector& result) { uint16_t length; readValue(length); result.resize(length); - memcpy(result.data(), _data + _offset, sizeof(glm::vec3) * length); + for (int i=0; i void ConicalViewFrustum::set(const ViewFrustum& viewFrustum) { // The ConicalViewFrustum has two parts: a central sphere (same as ViewFrustum) and a circular cone that bounds the frustum part. @@ -131,9 +132,9 @@ int ConicalViewFrustum::serialize(unsigned char* destinationBuffer) const { int ConicalViewFrustum::deserialize(const unsigned char* sourceBuffer) { const unsigned char* startPosition = sourceBuffer; - memcpy(&_position, sourceBuffer, sizeof(_position)); + memcpy(glm::value_ptr(_position), sourceBuffer, sizeof(_position)); sourceBuffer += sizeof(_position); - memcpy(&_direction, sourceBuffer, sizeof(_direction)); + memcpy(glm::value_ptr(_direction), sourceBuffer, sizeof(_direction)); sourceBuffer += sizeof(_direction); sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*)sourceBuffer, &_angle); sourceBuffer += unpackClipValueFromTwoByte(sourceBuffer, _farClip); diff --git a/plugins/KasenAPIExample/src/KasenAPIExample.cpp b/plugins/KasenAPIExample/src/KasenAPIExample.cpp index 9f81793037..d446e98e6e 100644 --- a/plugins/KasenAPIExample/src/KasenAPIExample.cpp +++ b/plugins/KasenAPIExample/src/KasenAPIExample.cpp @@ -105,7 +105,7 @@ private: static QVariantMap zipNonZeroValues(const QStringList& keys, const QVector& values) { QVariantMap out; for (int i=1; i < values.size(); i++) { - if (fabs(values[i]) > 1.0e-6) { + if (fabs(values[i]) > 1.0e-6f) { out[keys.value(i)] = values[i]; } }