mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-24 04:35:43 +01:00
Fix some more compiler warnings. This time some were actually very useful\!
This commit is contained in:
parent
ff1c3658fb
commit
fa5d5e865c
@ -730,7 +730,7 @@ double BC7CompressionMode::CompressCluster(const RGBACluster &cluster, RGBAVecto
|
||||
}
|
||||
|
||||
RGBACluster rgbCluster;
|
||||
float alphaVals[kMaxNumDataPoints];
|
||||
float alphaVals[kMaxNumDataPoints] = {0};
|
||||
|
||||
float alphaMin = FLT_MAX, alphaMax = -FLT_MAX;
|
||||
for(uint32 i = 0; i < cluster.GetNumPoints(); i++) {
|
||||
@ -1013,7 +1013,7 @@ double BC7CompressionMode::CompressCluster(const RGBACluster &cluster, RGBAVecto
|
||||
assert(pts[nBuckets - 1] == p2);
|
||||
|
||||
// Do k-means clustering...
|
||||
uint32 bucketIdx[kMaxNumDataPoints];
|
||||
uint32 bucketIdx[kMaxNumDataPoints] = {0};
|
||||
|
||||
bool fixed = false;
|
||||
while(!fixed) {
|
||||
|
@ -93,10 +93,10 @@ CompressedImage *Image::Compress(const SCompressionSettings &settings) const {
|
||||
// Allocate data based on the compression method
|
||||
int cmpDataSz = 0;
|
||||
switch(settings.format) {
|
||||
default: assert(!"Not implemented!");
|
||||
case eCompressionFormat_DXT1: cmpDataSz = dataSz / 8;
|
||||
case eCompressionFormat_DXT5: cmpDataSz = dataSz / 4;
|
||||
case eCompressionFormat_BPTC: cmpDataSz = dataSz / 4;
|
||||
default: assert(!"Not implemented!"); // Fall Through V
|
||||
case eCompressionFormat_DXT1: cmpDataSz = dataSz / 8; break;
|
||||
case eCompressionFormat_DXT5: cmpDataSz = dataSz / 4; break;
|
||||
case eCompressionFormat_BPTC: cmpDataSz = dataSz / 4; break;
|
||||
}
|
||||
|
||||
unsigned char *cmpData = new unsigned char[cmpDataSz];
|
||||
|
@ -227,7 +227,7 @@ void WorkerQueue::NotifyWorkerFinished() {
|
||||
}
|
||||
|
||||
WorkerThread::EAction WorkerQueue::AcceptThreadData(uint32 threadIdx) {
|
||||
if(threadIdx < 0 || threadIdx >= m_ActiveThreads) {
|
||||
if(threadIdx >= m_ActiveThreads) {
|
||||
return WorkerThread::eAction_Quit;
|
||||
}
|
||||
|
||||
|
@ -206,10 +206,8 @@ EImageFileFormat ImageFile::DetectFileFormat(const CHAR *filename) {
|
||||
|
||||
size_t dotPos = len - 1;
|
||||
|
||||
while(dotPos >= 0 && filename[dotPos--] != '.');
|
||||
|
||||
if(dotPos < 0) {
|
||||
// !FIXME! Report Error.....
|
||||
while((dotPos >= len)? false : filename[dotPos--] != '.');
|
||||
if (dotPos >= len) {
|
||||
return kNumImageFileFormats;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user