aboutsummaryrefslogtreecommitdiff
path: root/src/SBaseCommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SBaseCommon.cpp')
-rw-r--r--src/SBaseCommon.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp
index de6c58f..4fc473a 100644
--- a/src/SBaseCommon.cpp
+++ b/src/SBaseCommon.cpp
@@ -1896,10 +1896,10 @@ void ConvertUInt16Buffer(void * ptr, size_t length)
uint32_t nElements = (uint32_t)(length / sizeof(uint16_t));
while(nElements-- > 0)
- {
- *buffer = SwapUInt16(*buffer);
- buffer++;
- }
+ {
+ *buffer = SwapUInt16(*buffer);
+ buffer++;
+ }
}
// Swaps array of unsigned 32-bit integers
@@ -1908,11 +1908,11 @@ void ConvertUInt32Buffer(void * ptr, size_t length)
uint32_t * buffer = (uint32_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint32_t));
- while(nElements-- > 0)
- {
- *buffer = SwapUInt32(*buffer);
- buffer++;
- }
+ while(nElements-- > 0)
+ {
+ *buffer = SwapUInt32(*buffer);
+ buffer++;
+ }
}
// Swaps array of unsigned 64-bit integers
@@ -1921,37 +1921,37 @@ void ConvertUInt64Buffer(void * ptr, size_t length)
uint64_t * buffer = (uint64_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint64_t));
- while(nElements-- > 0)
- {
- *buffer = SwapUInt64(*buffer);
- buffer++;
- }
+ while(nElements-- > 0)
+ {
+ *buffer = SwapUInt64(*buffer);
+ buffer++;
+ }
}
// Swaps the TMPQHeader structure
void ConvertTMPQHeader(void *header, uint16_t version)
{
- TMPQHeader * theHeader = (TMPQHeader *)header;
+ TMPQHeader * theHeader = (TMPQHeader *)header;
// Swap header part version 1
if(version >= MPQ_FORMAT_VERSION_1)
{
- theHeader->dwID = SwapUInt32(theHeader->dwID);
- theHeader->dwHeaderSize = SwapUInt32(theHeader->dwHeaderSize);
- theHeader->dwArchiveSize = SwapUInt32(theHeader->dwArchiveSize);
- theHeader->wFormatVersion = SwapUInt16(theHeader->wFormatVersion);
- theHeader->wSectorSize = SwapUInt16(theHeader->wSectorSize);
- theHeader->dwHashTablePos = SwapUInt32(theHeader->dwHashTablePos);
- theHeader->dwBlockTablePos = SwapUInt32(theHeader->dwBlockTablePos);
- theHeader->dwHashTableSize = SwapUInt32(theHeader->dwHashTableSize);
- theHeader->dwBlockTableSize = SwapUInt32(theHeader->dwBlockTableSize);
+ theHeader->dwID = SwapUInt32(theHeader->dwID);
+ theHeader->dwHeaderSize = SwapUInt32(theHeader->dwHeaderSize);
+ theHeader->dwArchiveSize = SwapUInt32(theHeader->dwArchiveSize);
+ theHeader->wFormatVersion = SwapUInt16(theHeader->wFormatVersion);
+ theHeader->wSectorSize = SwapUInt16(theHeader->wSectorSize);
+ theHeader->dwHashTablePos = SwapUInt32(theHeader->dwHashTablePos);
+ theHeader->dwBlockTablePos = SwapUInt32(theHeader->dwBlockTablePos);
+ theHeader->dwHashTableSize = SwapUInt32(theHeader->dwHashTableSize);
+ theHeader->dwBlockTableSize = SwapUInt32(theHeader->dwBlockTableSize);
}
- if(version >= MPQ_FORMAT_VERSION_2)
- {
- theHeader->HiBlockTablePos64 = SwapUInt64(theHeader->HiBlockTablePos64);
+ if(version >= MPQ_FORMAT_VERSION_2)
+ {
+ theHeader->HiBlockTablePos64 = SwapUInt64(theHeader->HiBlockTablePos64);
theHeader->wHashTablePosHi = SwapUInt16(theHeader->wHashTablePosHi);
- theHeader->wBlockTablePosHi = SwapUInt16(theHeader->wBlockTablePosHi);
+ theHeader->wBlockTablePosHi = SwapUInt16(theHeader->wBlockTablePosHi);
}
if(version >= MPQ_FORMAT_VERSION_3)
@@ -1962,7 +1962,7 @@ void ConvertTMPQHeader(void *header, uint16_t version)
}
if(version >= MPQ_FORMAT_VERSION_4)
- {
+ {
theHeader->HashTableSize64 = SwapUInt64(theHeader->HashTableSize64);
theHeader->BlockTableSize64 = SwapUInt64(theHeader->BlockTableSize64);
theHeader->HiBlockTableSize64 = SwapUInt64(theHeader->HiBlockTableSize64);