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);
#endif
assert(bestPbitCombo >= 0);
return OptimizeEndpointsForCluster(
cluster, p1, p2, bestIndices, bestPbitCombo
);

View File

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

View File

@ -86,7 +86,7 @@ class RGBAVector : public FasTC::Vector4<float> {
typedef FasTC::Vector4<float> BaseVector;
public:
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) :
BaseVector(
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 toCopy = ::std::min(numChars, bufSz);
memcpy(buf, base, toCopy);

View File

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