Skip to content

Commit 44e81db

Browse files
CalculateDXBCChecksum: use const data pointer
1 parent 7993d2a commit 44e81db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ThirdParty/GPUOpenShaderUtils/DXBCChecksum.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ typedef struct
140140
static void MD5_Transform(UINT4* buf, UINT4* in);
141141

142142
void MD5Init(MD5_CTX* mdContext, unsigned long pseudoRandomNumber = 0);
143-
void MD5Update(MD5_CTX* mdContext, unsigned char* inBuf, unsigned int inLen);
143+
void MD5Update(MD5_CTX* mdContext, const unsigned char* inBuf, unsigned int inLen);
144144
void MD5Final(MD5_CTX* mdContext);
145145

146146
/* Basic MD5 step. MD5_Transform buf based on in */
@@ -238,7 +238,7 @@ void MD5Init(MD5_CTX* mdContext, unsigned long pseudoRandomNumber)
238238
mdContext->buf[3] = (UINT4)0x10325476 + (pseudoRandomNumber * 97);
239239
}
240240

241-
void MD5Update(MD5_CTX* mdContext, unsigned char* inBuf, unsigned int inLen)
241+
void MD5Update(MD5_CTX* mdContext, const unsigned char* inBuf, unsigned int inLen)
242242
{
243243
UINT4 in[16];
244244
int mdi = 0;
@@ -323,7 +323,7 @@ void MD5Final(MD5_CTX* mdContext)
323323

324324
static const DWORD dwHashOffset = 0x14;
325325

326-
BOOL CalculateDXBCChecksum(BYTE* pData, DWORD dwSize, DWORD dwHash[4])
326+
BOOL CalculateDXBCChecksum(const BYTE* pData, DWORD dwSize, DWORD dwHash[4])
327327
{
328328
MD5_CTX md5Ctx;
329329
MD5Init(&md5Ctx, 0);
@@ -340,7 +340,7 @@ BOOL CalculateDXBCChecksum(BYTE* pData, DWORD dwSize, DWORD dwHash[4])
340340

341341
DWORD dwLastChunkSize = dwSize - dwFullChunksSize;
342342
DWORD dwPaddingSize = 64 - dwLastChunkSize;
343-
BYTE* pLastChunkData = pData + dwFullChunksSize;
343+
const BYTE* pLastChunkData = pData + dwFullChunksSize;
344344

345345
if (dwLastChunkSize >= 56)
346346
{

ThirdParty/GPUOpenShaderUtils/DXBCChecksum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373
/// \param[in] dwSize The size of the memory to checksum.
7474
/// \param[out] dwHash A DWORD array to copy the calculated check sum into.
7575
/// \return TRUE if successful, otherwise FALSE.
76-
BOOL CalculateDXBCChecksum(BYTE* pData, DWORD dwSize, DWORD dwHash[4]);
76+
BOOL CalculateDXBCChecksum(const BYTE* pData, DWORD dwSize, DWORD dwHash[4]);
7777

7878
#endif // DXBCCHECKSUM_H

0 commit comments

Comments
 (0)