Fix some small bugs and compiler warnings

This commit is contained in:
Pavel Krajcevski 2015-02-11 21:26:31 -08:00
parent 325a2ac96d
commit a263907e0f
5 changed files with 5 additions and 6 deletions

View File

@ -1123,8 +1123,6 @@ double CompressionMode::CompressCluster(
assert(pBitCombo == bestPbitCombo); assert(pBitCombo == bestPbitCombo);
#endif #endif
assert(bestPbitCombo >= 0);
return OptimizeEndpointsForCluster( return OptimizeEndpointsForCluster(
cluster, p1, p2, bestIndices, bestPbitCombo cluster, p1, p2, bestIndices, bestPbitCombo
); );

View File

@ -338,7 +338,6 @@ double RGBACluster::QuantizedError(
totalError += minError; totalError += minError;
assert(bestBucket >= 0);
if(indices) indices[i] = bestBucket; if(indices) indices[i] = bestBucket;
} }

View File

@ -86,7 +86,7 @@ class RGBAVector : public FasTC::Vector4<float> {
typedef FasTC::Vector4<float> BaseVector; typedef FasTC::Vector4<float> BaseVector;
public: public:
uint32 GetIdx() const { return m_Idx; } uint32 GetIdx() const { return m_Idx; }
RGBAVector() : BaseVector(-1.0, -1.0, -1.0, -1.0) { } RGBAVector() : BaseVector(-1.0, -1.0, -1.0, -1.0), m_Idx(0) { }
RGBAVector(uint32 idx, uint32 pixel) : RGBAVector(uint32 idx, uint32 pixel) :
BaseVector( BaseVector(
static_cast<float>(pixel & 0xFF), static_cast<float>(pixel & 0xFF),

View File

@ -101,6 +101,10 @@ void ExtractBasename(const char *filename, char *buf, size_t bufSz) {
} }
} }
if (!base) {
base = end;
}
size_t numChars = ext - base + 1; size_t numChars = ext - base + 1;
size_t toCopy = ::std::min(numChars, bufSz); size_t toCopy = ::std::min(numChars, bufSz);
memcpy(buf, base, toCopy); memcpy(buf, base, toCopy);

View File

@ -146,10 +146,8 @@ namespace PVRTCC {
} }
void Block::SetLerpValue(uint32 texelIdx, uint8 lerpVal) { void Block::SetLerpValue(uint32 texelIdx, uint8 lerpVal) {
assert(texelIdx >= 0);
assert(texelIdx <= 15); assert(texelIdx <= 15);
assert(lerpVal >= 0);
assert(lerpVal < 4); assert(lerpVal < 4);
m_LongData &= ~(static_cast<uint64>(0x3) << (texelIdx * 2)); m_LongData &= ~(static_cast<uint64>(0x3) << (texelIdx * 2));