Fixed inconsistency in integer sizes that caused segmentation fault while hashing files also broken message on the GUI

This commit is contained in:
hunbernd 2016-09-23 21:56:41 +02:00
parent 70c8e14d16
commit 8500b5e9f5
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ void HashStorage::data_tick()
std::cerr << "Hashing file " << job.full_path << "..." ; std::cerr.flush(); std::cerr << "Hashing file " << job.full_path << "..." ; std::cerr.flush();
std::string tmpout; std::string tmpout;
rs_sprintf(tmpout, "%lu/%lu (%s - %d%%) : %s", mHashCounter+1, mTotalFilesToHash, friendlyUnit(mTotalHashedSize).c_str(), int(mTotalHashedSize/double(mTotalSizeToHash)*100.0), job.full_path.c_str()) ; rs_sprintf(tmpout, "%lu/%lu (%s - %d%%) : %s", (unsigned long int)mHashCounter+1, (unsigned long int)mTotalFilesToHash, friendlyUnit(mTotalHashedSize).c_str(), int(mTotalHashedSize/double(mTotalSizeToHash)*100.0), job.full_path.c_str()) ;
RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ; RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ;

View File

@ -129,7 +129,7 @@ private:
RsMutex mHashMtx ; RsMutex mHashMtx ;
bool mRunning; bool mRunning;
uint32_t mHashCounter; uint64_t mHashCounter;
uint32_t mInactivitySleepTime ; uint32_t mInactivitySleepTime ;
uint64_t mTotalSizeToHash ; uint64_t mTotalSizeToHash ;
uint64_t mTotalHashedSize ; uint64_t mTotalHashedSize ;