aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascOpenStorage.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-04-03 10:21:30 +0200
committerShauren <shauren.trinity@gmail.com>2016-04-03 10:21:30 +0200
commit77761e819506075b28c1b4eaf3fb295cc544c838 (patch)
tree694123b8a8bf2c70d94b09b44f1dcb576f0127e4 /dep/CascLib/src/CascOpenStorage.cpp
parente320ce27c578b21b8611ecfb01084a205790e2e6 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@d477d30f7c2b3a306fd07c92929950639335fb3f
Diffstat (limited to 'dep/CascLib/src/CascOpenStorage.cpp')
-rw-r--r--dep/CascLib/src/CascOpenStorage.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/dep/CascLib/src/CascOpenStorage.cpp b/dep/CascLib/src/CascOpenStorage.cpp
index c3d623df9f0..d8508da73bf 100644
--- a/dep/CascLib/src/CascOpenStorage.cpp
+++ b/dep/CascLib/src/CascOpenStorage.cpp
@@ -18,7 +18,7 @@
// Local structures
// Size of one segment in the ENCODING table
-// The segment is filled by entries of type
+// The segment is filled by entries of type
#define CASC_ENCODING_SEGMENT_SIZE 0x1000
typedef struct _BLOCK_SIZE_AND_HASH
@@ -116,7 +116,7 @@ static bool IsIndexFileName_V1(const TCHAR * szFileName)
static bool IsIndexFileName_V2(const TCHAR * szFileName)
{
// Check if the name looks like a valid index file
- return (_tcslen(szFileName) == 14 &&
+ return (_tcslen(szFileName) == 14 &&
_tcsspn(szFileName, _T("0123456789aAbBcCdDeEfF")) == 0x0A &&
_tcsicmp(szFileName + 0x0A, _T(".idx")) == 0);
}
@@ -354,7 +354,7 @@ static int VerifyAndParseKeyMapping_V1(PCASC_MAPPING_TABLE pKeyMapping, DWORD Ke
// Verify the format
if(pIndexHeader->field_0 != 0x0005)
return ERROR_NOT_SUPPORTED;
- if(pIndexHeader->KeyIndex != KeyIndex)
+ if(pIndexHeader->KeyIndex != KeyIndex)
return ERROR_NOT_SUPPORTED;
if(pIndexHeader->field_8 == 0)
return ERROR_NOT_SUPPORTED;
@@ -421,7 +421,7 @@ static int VerifyAndParseKeyMapping_V2(PCASC_MAPPING_TABLE pKeyMapping, DWORD Ke
FilePosition = (sizeof(BLOCK_SIZE_AND_HASH) + pSizeAndHash->cbBlockSize + 0x0F) & 0xFFFFFFF0;
if((FilePosition + 0x08) > pKeyMapping->cbFileData)
return ERROR_BAD_FORMAT;
-
+
// Get the pointer to "size+hash" block
pSizeAndHash = (PBLOCK_SIZE_AND_HASH)(pKeyMapping->pbFileData + FilePosition);
FilePosition += 0x08;
@@ -446,11 +446,11 @@ static int VerifyAndParseKeyMapping_V2(PCASC_MAPPING_TABLE pKeyMapping, DWORD Ke
FilePosition = ALIGN_TO_SIZE(FilePosition, 0x1000);
if(FilePosition > pKeyMapping->cbFileData)
return ERROR_BAD_FORMAT;
-
+
LastPartLength = pKeyMapping->cbFileData - FilePosition;
if(LastPartLength < 0x7800)
return ERROR_BAD_FORMAT;
-
+
pbLastPart = pKeyMapping->pbFileData + FilePosition;
pbLastPartEnd = pbLastPart + ((LastPartLength >> 0x09) << 0x09);
@@ -768,7 +768,7 @@ static int LoadEncodingFile(TCascStorage * hs)
QUERY_KEY EncodingKey;
LPBYTE pbStartOfSegment;
LPBYTE pbEncodingFile = NULL;
- HANDLE hFile = NULL;
+ HANDLE hFile = NULL;
DWORD cbEncodingFile = 0;
DWORD dwNumSegments = 0;
DWORD dwSegmentsPos = 0;
@@ -856,7 +856,7 @@ static int LoadEncodingFile(TCascStorage * hs)
static int LoadRootFile(TCascStorage * hs, DWORD dwLocaleMask)
{
PDWORD FileSignature;
- HANDLE hFile = NULL;
+ HANDLE hFile = NULL;
LPBYTE pbRootFile = NULL;
DWORD cbRootFile = 0;
int nError = ERROR_SUCCESS;
@@ -905,7 +905,7 @@ static int LoadRootFile(TCascStorage * hs, DWORD dwLocaleMask)
}
}
- // Insert entry for the
+ // Insert entry for the
if(nError == ERROR_SUCCESS)
{
InsertExtraFile(hs, "ENCODING", &hs->EncodingKey);
@@ -1010,7 +1010,7 @@ static TCascStorage * FreeCascStorage(TCascStorage * hs)
bool WINAPI CascOpenStorage(const TCHAR * szDataPath, DWORD dwLocaleMask, HANDLE * phStorage)
{
- TCascStorage * hs;
+ TCascStorage * hs;
int nError = ERROR_SUCCESS;
// Allocate the storage structure
@@ -1074,7 +1074,7 @@ bool WINAPI CascOpenStorage(const TCHAR * szDataPath, DWORD dwLocaleMask, HANDLE
bool WINAPI CascGetStorageInfo(
HANDLE hStorage,
- CASC_STORAGE_INFO_CLASS InfoClass,
+ CASC_STORAGE_INFO_CLASS InfoClass,
void * pvStorageInfo,
size_t cbStorageInfo,
size_t * pcbLengthNeeded)