|
From: <bul...@us...> - 2013-05-17 16:24:28
|
Revision: 22761
http://sourceforge.net/p/bzflag/code/22761
Author: bullet_catcher
Date: 2013-05-17 16:24:26 +0000 (Fri, 17 May 2013)
Log Message:
-----------
Preserve const quality in cache management.
Modified Paths:
--------------
trunk/bzflag/include/CacheManager.h
trunk/bzflag/src/bzflag/Downloads.cxx
trunk/bzflag/src/game/CacheManager.cxx
Modified: trunk/bzflag/include/CacheManager.h
===================================================================
--- trunk/bzflag/include/CacheManager.h 2013-05-17 15:42:40 UTC (rev 22760)
+++ trunk/bzflag/include/CacheManager.h 2013-05-17 16:24:26 UTC (rev 22761)
@@ -38,7 +38,7 @@
bool saveIndex();
bool findURL(const std::string& url, CacheRecord& record);
- bool addFile(CacheRecord& rec, const void* data);
+ bool addFile(CacheRecord& rec, const unsigned char* data);
std::vector<CacheRecord> getCacheList() const;
Modified: trunk/bzflag/src/bzflag/Downloads.cxx
===================================================================
--- trunk/bzflag/src/bzflag/Downloads.cxx 2013-05-17 15:42:40 UTC (rev 22760)
+++ trunk/bzflag/src/bzflag/Downloads.cxx 2013-05-17 16:24:26 UTC (rev 22761)
@@ -72,7 +72,7 @@
public:
CachedTexture(const std::string &texUrl);
- virtual void finalization(char *data, unsigned int length, bool good);
+ virtual void finalization(unsigned char *data, unsigned int length, bool good);
static void setParams(bool check, long timeout);
static int activeTransfer();
@@ -130,7 +130,7 @@
byteTransferred = 0;
}
-void CachedTexture::finalization(char *data, unsigned int length, bool good)
+void CachedTexture::finalization(unsigned char *data, unsigned int length, bool good)
{
time_t filetime;
Modified: trunk/bzflag/src/game/CacheManager.cxx
===================================================================
--- trunk/bzflag/src/game/CacheManager.cxx 2013-05-17 15:42:40 UTC (rev 22760)
+++ trunk/bzflag/src/game/CacheManager.cxx 2013-05-17 16:24:26 UTC (rev 22761)
@@ -108,7 +108,7 @@
}
-bool CacheManager::addFile(CacheRecord& record, const void* data)
+bool CacheManager::addFile(CacheRecord& record, const unsigned char* data)
{
if (((data == NULL) && (record.size != 0)) || (record.url.size() <= 0)) {
return false;
@@ -130,12 +130,12 @@
replacement = true;
}
- out->write((char*)data, rec->size);
+ out->write((const char *)data, rec->size);
rec->usedDate = time(NULL); // update the timestamp
MD5 md5;
- md5.update((unsigned char *)data, rec->size);
+ md5.update(data, rec->size);
md5.finalize();
rec->key = md5.hexdigest();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|