diff options
Diffstat (limited to 'dep/CascLib/src/common')
| -rw-r--r-- | dep/CascLib/src/common/Common.h | 12 | ||||
| -rw-r--r-- | dep/CascLib/src/common/Directory.cpp | 8 | ||||
| -rw-r--r-- | dep/CascLib/src/common/Directory.h | 10 | ||||
| -rw-r--r-- | dep/CascLib/src/common/FileStream.cpp | 2 | ||||
| -rw-r--r-- | dep/CascLib/src/common/ListFile.cpp | 2 | ||||
| -rw-r--r-- | dep/CascLib/src/common/Map.h | 4 |
6 files changed, 13 insertions, 25 deletions
diff --git a/dep/CascLib/src/common/Common.h b/dep/CascLib/src/common/Common.h index d32202413ba..ddf8e136c9b 100644 --- a/dep/CascLib/src/common/Common.h +++ b/dep/CascLib/src/common/Common.h @@ -438,17 +438,11 @@ bool CascVerifyDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE expec //----------------------------------------------------------------------------- // Scanning a directory -typedef bool (*INDEX_FILE_FOUND)(const TCHAR * szFileName, PDWORD IndexArray, PDWORD OldIndexArray, void * pvContext); +typedef bool (*INDEX_FILE_FOUND)(LPCTSTR szFileName, void * pvContext); -bool DirectoryExists(const TCHAR * szDirectory); +bool DirectoryExists(LPCTSTR szDirectory); -int ScanIndexDirectory( - const TCHAR * szIndexPath, - INDEX_FILE_FOUND pfnOnFileFound, - PDWORD IndexArray, - PDWORD OldIndexArray, - void * pvContext - ); +int ScanIndexDirectory(LPCTSTR szIndexPath, INDEX_FILE_FOUND pfnOnFileFound, void * pvContext); //----------------------------------------------------------------------------- // Argument structure versioning diff --git a/dep/CascLib/src/common/Directory.cpp b/dep/CascLib/src/common/Directory.cpp index 463881f3f9c..387ca3a8ea4 100644 --- a/dep/CascLib/src/common/Directory.cpp +++ b/dep/CascLib/src/common/Directory.cpp @@ -53,10 +53,8 @@ bool MakeDirectory(const TCHAR * szDirectory) } int ScanIndexDirectory( - const TCHAR * szIndexPath, + LPCTSTR szIndexPath, INDEX_FILE_FOUND pfnOnFileFound, - PDWORD MainIndexes, - PDWORD OldIndexArray, void * pvContext) { #ifdef PLATFORM_WINDOWS @@ -81,7 +79,7 @@ int ScanIndexDirectory( if(!(wf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { // Let the callback scan the file name - pfnOnFileFound(wf.cFileName, MainIndexes, OldIndexArray, pvContext); + pfnOnFileFound(wf.cFileName, pvContext); } } @@ -103,7 +101,7 @@ int ScanIndexDirectory( { if(dir_entry->d_type != DT_DIR) { - pfnOnFileFound(dir_entry->d_name, MainIndexes, OldIndexArray, pvContext); + pfnOnFileFound(dir_entry->d_name, pvContext); } } diff --git a/dep/CascLib/src/common/Directory.h b/dep/CascLib/src/common/Directory.h index 739f0612e54..30c7e384284 100644 --- a/dep/CascLib/src/common/Directory.h +++ b/dep/CascLib/src/common/Directory.h @@ -14,17 +14,13 @@ //----------------------------------------------------------------------------- // Scanning a directory -typedef bool (*INDEX_FILE_FOUND)(const TCHAR * szFileName, PDWORD IndexArray, PDWORD OldIndexArray, void * pvContext); +bool DirectoryExists(LPCTSTR szDirectory); -bool DirectoryExists(const TCHAR * szDirectory); - -bool MakeDirectory(const TCHAR * szDirectory); +bool MakeDirectory(LPCTSTR szDirectory); int ScanIndexDirectory( - const TCHAR * szIndexPath, + LPCTSTR szIndexPath, INDEX_FILE_FOUND pfnOnFileFound, - PDWORD IndexArray, - PDWORD OldIndexArray, void * pvContext ); diff --git a/dep/CascLib/src/common/FileStream.cpp b/dep/CascLib/src/common/FileStream.cpp index cd3300a46a7..ab591a2e3f1 100644 --- a/dep/CascLib/src/common/FileStream.cpp +++ b/dep/CascLib/src/common/FileStream.cpp @@ -680,7 +680,7 @@ static bool BaseHttp_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD if (HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE, szStatusCode, &dwDataSize, &dwIndex)) dwStatusCode = _tcstoul(szStatusCode, &szEndPtr, 10); - // Copare the statuc code + // Compare the status code if (dwStatusCode == 200) { // Check if the archive has Last Modified field diff --git a/dep/CascLib/src/common/ListFile.cpp b/dep/CascLib/src/common/ListFile.cpp index a2239e18fa3..bcca8b7177a 100644 --- a/dep/CascLib/src/common/ListFile.cpp +++ b/dep/CascLib/src/common/ListFile.cpp @@ -199,7 +199,7 @@ size_t ListFile_GetNextLine(void * pvListFile, const char ** pszLineBegin, const { // If we have found a newline, stop loading // Note: the 0x85 char came from Overwatch build 24919 - if(pCache->pPos[0] == 0x0A || pCache->pPos[0] == 0x0D || pCache->pPos[0] == 0x85) + if(pCache->pPos[0] == '\x0A' || pCache->pPos[0] == '\x0D' || pCache->pPos[0] == '\x85') break; // Blizzard listfiles can also contain information about patch: diff --git a/dep/CascLib/src/common/Map.h b/dep/CascLib/src/common/Map.h index a6eface844d..4b277cb73a8 100644 --- a/dep/CascLib/src/common/Map.h +++ b/dep/CascLib/src/common/Map.h @@ -94,7 +94,7 @@ class CASC_MAP Free(); } - int Create(size_t MaxItems, size_t KeyLength, size_t KeyOffset, KEY_TYPE KeyType = KeyIsHash) + DWORD Create(size_t MaxItems, size_t KeyLength, size_t KeyOffset, KEY_TYPE KeyType = KeyIsHash) { // Set the class variables m_KeyLength = CASCLIB_MAX(KeyLength, 8); @@ -331,7 +331,7 @@ class CASC_MAP size_t PowerOfTwo; // Round the hash table size up to the nearest power of two - for(PowerOfTwo = MIN_HASH_TABLE_SIZE; PowerOfTwo < MAX_HASH_TABLE_SIZE; PowerOfTwo <<= 1) + for(PowerOfTwo = MIN_HASH_TABLE_SIZE; PowerOfTwo <= MAX_HASH_TABLE_SIZE; PowerOfTwo <<= 1) { if(PowerOfTwo > MaxItems) { |
