X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Ffilethread.cpp;h=5d0d5834398a6abf1c04d888c3f0bb5b6772903b;hb=e310c1d53915d306d8aa9a1bed9bac489bd30b03;hp=e3404989f686dd712e1bf478dd3b4d85a5186b07;hpb=437c16a8f1d73b28d7262819654b88b207231154;p=virtualjaguar diff --git a/src/gui/filethread.cpp b/src/gui/filethread.cpp index e340498..5d0d583 100644 --- a/src/gui/filethread.cpp +++ b/src/gui/filethread.cpp @@ -92,10 +92,13 @@ printf("FileThread: Aborting!!!\n"); // void FileThread::HandleFile(QFileInfo fileInfo) { + // Really, need to come up with some kind of cacheing scheme here, so we don't + // fish through these files every time we run VJ :-P +#warning "!!! Need to come up with some kind of cacheing scheme here !!!" bool haveZIPFile = (fileInfo.suffix().compare("zip", Qt::CaseInsensitive) == 0 ? true : false); uint32_t fileSize = 0; - uint8 * buffer = NULL; + uint8_t * buffer = NULL; if (haveZIPFile) { @@ -119,7 +122,7 @@ void FileThread::HandleFile(QFileInfo fileInfo) if (fileSize == 0) return; - buffer = new uint8[fileSize]; + buffer = new uint8_t[fileSize]; file.read((char *)buffer, fileSize); file.close(); } @@ -129,7 +132,7 @@ void FileThread::HandleFile(QFileInfo fileInfo) // Check for Alpine ROM w/Universal Header bool foundUniversalHeader = HasUniversalHeader(buffer, fileSize); - uint32 crc; + uint32_t crc; //printf("FileThread: About to calc checksum on file with size %u... (buffer=%08X)\n", size, buffer); if (foundUniversalHeader) @@ -137,7 +140,7 @@ void FileThread::HandleFile(QFileInfo fileInfo) else crc = crc32_calcCheckSum(buffer, fileSize); - uint32 index = FindCRCIndexInFileList(crc); + uint32_t index = FindCRCIndexInFileList(crc); delete[] buffer; // Here we filter out files that are *not* in the DB and of unknown type, @@ -160,7 +163,7 @@ void FileThread::HandleFile(QFileInfo fileInfo) // See if we can fish out a label. :-) if (haveZIPFile) { - uint32 size = GetFileFromZIP(fileInfo.filePath().toAscii(), FT_LABEL, buffer); + uint32_t size = GetFileFromZIP(fileInfo.filePath().toAscii(), FT_LABEL, buffer); //printf("FT: Label size = %u bytes.\n", size); if (size > 0) @@ -183,7 +186,7 @@ void FileThread::HandleFile(QFileInfo fileInfo) // Find a CRC in the ROM list (simple brute force algorithm). // If it's there, return the index, otherwise return $FFFFFFFF // -uint32 FileThread::FindCRCIndexInFileList(uint32 crc) +uint32_t FileThread::FindCRCIndexInFileList(uint32_t crc) { // Instead of a simple brute-force search, we should probably do a binary // partition search instead, since the CRCs are sorted numerically.