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