diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index dc5373b0b..1d149ccbc 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -860,8 +860,7 @@ namespace MWRender { RenderingManager::RayResult result; result.mHit = false; - result.mHitRefnum.mContentFile = -1; - result.mHitRefnum.mIndex = -1; + result.mHitRefnum.unset(); result.mRatio = 0; if (intersector->containsIntersections()) { diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index ae1726f06..a01404595 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -238,7 +238,7 @@ namespace NifOsg std::string mFilename; unsigned int mVersion, mUserVersion, mBethVersion; - size_t mFirstRootTextureIndex = -1; + size_t mFirstRootTextureIndex{~0u}; bool mFoundFirstRootTexturingProperty = false; bool mHasNightDayLabel = false; diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 8f242daee..5c08b22c4 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -132,7 +132,7 @@ namespace SceneUtil if (value[0] < 0) { positiveColor *= -1.0; - signBit = -1; + signBit = ~0u; } unsigned int packedColor = asRGBA(positiveColor); std::memcpy(&(*mData)[getOffset(index, Diffuse)], &packedColor, sizeof(unsigned int));