mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-22 05:09:13 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -67,7 +67,7 @@ plChecksum::plChecksum(unsigned int bufsize, const char* buffer)
|
||||
fSum+= hsToLE32(last);
|
||||
}
|
||||
|
||||
plMD5Checksum::plMD5Checksum( UInt32 size, UInt8 *buffer )
|
||||
plMD5Checksum::plMD5Checksum( uint32_t size, uint8_t *buffer )
|
||||
{
|
||||
fValid = false;
|
||||
Start();
|
||||
@ -116,11 +116,11 @@ void plMD5Checksum::CalcFromFile( const char *fileName )
|
||||
|
||||
void plMD5Checksum::CalcFromStream( hsStream* stream )
|
||||
{
|
||||
UInt32 sPos = stream->GetPosition();
|
||||
uint32_t sPos = stream->GetPosition();
|
||||
unsigned loadLen = 1024 * 1024;
|
||||
Start();
|
||||
|
||||
UInt8 *buf = TRACKED_NEW UInt8[loadLen];
|
||||
uint8_t *buf = TRACKED_NEW uint8_t[loadLen];
|
||||
|
||||
while(int read = stream->Read(loadLen, buf))
|
||||
AddTo( read, buf );
|
||||
@ -136,7 +136,7 @@ void plMD5Checksum::Start( void )
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
void plMD5Checksum::AddTo( UInt32 size, const UInt8 *buffer )
|
||||
void plMD5Checksum::AddTo( uint32_t size, const uint8_t *buffer )
|
||||
{
|
||||
MD5_Update( &fContext, buffer, size );
|
||||
}
|
||||
@ -166,7 +166,7 @@ const char *plMD5Checksum::GetAsHexString( void ) const
|
||||
return tempString;
|
||||
}
|
||||
|
||||
UInt8 plMD5Checksum::IHexCharToInt( char c ) const
|
||||
uint8_t plMD5Checksum::IHexCharToInt( char c ) const
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@ -214,7 +214,7 @@ void plMD5Checksum::SetFromHexString( const char *string )
|
||||
fValid = true;
|
||||
}
|
||||
|
||||
void plMD5Checksum::SetValue(UInt8* checksum)
|
||||
void plMD5Checksum::SetValue(uint8_t* checksum)
|
||||
{
|
||||
fValid = true;
|
||||
memcpy(fChecksum, checksum, sizeof(fChecksum));
|
||||
|
@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class plChecksum
|
||||
{
|
||||
public:
|
||||
typedef UInt32 SumStorage;
|
||||
typedef uint32_t SumStorage;
|
||||
private:
|
||||
SumStorage fSum;
|
||||
public:
|
||||
@ -66,13 +66,13 @@ class plMD5Checksum
|
||||
|
||||
hsBool fValid;
|
||||
MD5_CTX fContext;
|
||||
UInt8 fChecksum[ MD5_DIGEST_LENGTH ];
|
||||
uint8_t fChecksum[ MD5_DIGEST_LENGTH ];
|
||||
|
||||
UInt8 IHexCharToInt( char c ) const;
|
||||
uint8_t IHexCharToInt( char c ) const;
|
||||
|
||||
public:
|
||||
|
||||
plMD5Checksum( UInt32 size, UInt8 *buffer );
|
||||
plMD5Checksum( uint32_t size, uint8_t *buffer );
|
||||
plMD5Checksum();
|
||||
plMD5Checksum( const plMD5Checksum &rhs );
|
||||
plMD5Checksum( const char *fileName );
|
||||
@ -85,14 +85,14 @@ class plMD5Checksum
|
||||
void CalcFromStream( hsStream* stream );
|
||||
|
||||
void Start( void );
|
||||
void AddTo( UInt32 size, const UInt8 *buffer );
|
||||
void AddTo( uint32_t size, const uint8_t *buffer );
|
||||
void Finish( void );
|
||||
|
||||
const UInt8 *GetValue( void ) const { return fChecksum; }
|
||||
UInt32 GetSize( void ) const { return sizeof( fChecksum ); }
|
||||
const uint8_t *GetValue( void ) const { return fChecksum; }
|
||||
uint32_t GetSize( void ) const { return sizeof( fChecksum ); }
|
||||
|
||||
// Backdoor for cached checksums (ie, if you loaded it off disk)
|
||||
void SetValue(UInt8* checksum);
|
||||
void SetValue(uint8_t* checksum);
|
||||
|
||||
// Note: GetAsHexString() returns a pointer to a static string; do not rely on the contents of this string between calls!
|
||||
const char *GetAsHexString( void ) const;
|
||||
|
Reference in New Issue
Block a user