mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 21:36:42 +00:00
Do not assign negative values to unsigned variables
This commit is contained in:
parent
651ad11ad8
commit
7d5c5f8a24
3 changed files with 3 additions and 4 deletions
|
@ -860,8 +860,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
RenderingManager::RayResult result;
|
RenderingManager::RayResult result;
|
||||||
result.mHit = false;
|
result.mHit = false;
|
||||||
result.mHitRefnum.mContentFile = -1;
|
result.mHitRefnum.unset();
|
||||||
result.mHitRefnum.mIndex = -1;
|
|
||||||
result.mRatio = 0;
|
result.mRatio = 0;
|
||||||
if (intersector->containsIntersections())
|
if (intersector->containsIntersections())
|
||||||
{
|
{
|
||||||
|
|
|
@ -238,7 +238,7 @@ namespace NifOsg
|
||||||
std::string mFilename;
|
std::string mFilename;
|
||||||
unsigned int mVersion, mUserVersion, mBethVersion;
|
unsigned int mVersion, mUserVersion, mBethVersion;
|
||||||
|
|
||||||
size_t mFirstRootTextureIndex = -1;
|
size_t mFirstRootTextureIndex{~0u};
|
||||||
bool mFoundFirstRootTexturingProperty = false;
|
bool mFoundFirstRootTexturingProperty = false;
|
||||||
|
|
||||||
bool mHasNightDayLabel = false;
|
bool mHasNightDayLabel = false;
|
||||||
|
|
|
@ -132,7 +132,7 @@ namespace SceneUtil
|
||||||
if (value[0] < 0)
|
if (value[0] < 0)
|
||||||
{
|
{
|
||||||
positiveColor *= -1.0;
|
positiveColor *= -1.0;
|
||||||
signBit = -1;
|
signBit = ~0u;
|
||||||
}
|
}
|
||||||
unsigned int packedColor = asRGBA(positiveColor);
|
unsigned int packedColor = asRGBA(positiveColor);
|
||||||
std::memcpy(&(*mData)[getOffset(index, Diffuse)], &packedColor, sizeof(unsigned int));
|
std::memcpy(&(*mData)[getOffset(index, Diffuse)], &packedColor, sizeof(unsigned int));
|
||||||
|
|
Loading…
Reference in a new issue