Skip to content

Commit

Permalink
x64: Save work
Browse files Browse the repository at this point in the history
  • Loading branch information
dimhotepus committed Jun 16, 2024
1 parent 31a69e1 commit 07e25ac
Show file tree
Hide file tree
Showing 293 changed files with 3,631 additions and 3,353 deletions.
2 changes: 1 addition & 1 deletion common/GameUI/IGameConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract_class IGameConsole : public IBaseInterface
// return true if the console has focus
virtual bool IsConsoleVisible() = 0;

virtual void SetParent( int parent ) = 0;
virtual void SetParent( uintp parent ) = 0;
};

#define GAMECONSOLE_INTERFACE_VERSION "GameConsole004"
Expand Down
8 changes: 4 additions & 4 deletions common/ServerBrowser/blacklisted_server_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa
//-----------------------------------------------------------------------------
// Purpose: Remove server with matching 'server id' from list
//-----------------------------------------------------------------------------
void CBlacklistedServerManager::RemoveServer( int iServerID )
void CBlacklistedServerManager::RemoveServer( intp iServerID )
{
for ( int i = 0; i < m_Blacklist.Count(); i++ )
for ( intp i = 0; i < m_Blacklist.Count(); i++ )
{
if ( m_Blacklist[i].m_nServerID == iServerID )
{
Expand All @@ -195,9 +195,9 @@ void CBlacklistedServerManager::RemoveServer( int iServerID )
//-----------------------------------------------------------------------------
// Purpose: Given a serverID, return its blacklist entry
//-----------------------------------------------------------------------------
blacklisted_server_t *CBlacklistedServerManager::GetServer( int iServerID )
blacklisted_server_t *CBlacklistedServerManager::GetServer( intp iServerID )
{
for ( int i = 0; i < m_Blacklist.Count(); i++ )
for ( intp i = 0; i < m_Blacklist.Count(); i++ )
{
if ( m_Blacklist[i].m_nServerID == iServerID )
return &m_Blacklist[i];
Expand Down
4 changes: 2 additions & 2 deletions common/ServerBrowser/blacklisted_server_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class CBlacklistedServerManager
blacklisted_server_t *AddServer( const char *serverName, uint32 serverIP, int serverPort );
blacklisted_server_t *AddServer( const char *serverName, const char *netAddressString, uint32 timestamp );

void RemoveServer( int iServerID ); // remove server with matching 'server id' from list
void RemoveServer( intp iServerID ); // remove server with matching 'server id' from list

void SaveToFile( const char *filename );
int LoadServersFromFile( const char *pszFilename, bool bResetTimes ); // returns count of appended servers, zero for failure

blacklisted_server_t *GetServer( int iServerID ); // return server with matching 'server id'
blacklisted_server_t *GetServer( intp iServerID ); // return server with matching 'server id'
int GetServerCount( void ) const;

const CUtlVector< blacklisted_server_t > &GetServerVector( void ) const;
Expand Down
36 changes: 18 additions & 18 deletions common/bugreporter/bugreporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,38 @@ abstract_class IBugReporter : public IBaseInterface
virtual char const *GetUserName() = 0;
virtual char const *GetUserName_Display() = 0;

virtual int GetNameCount() = 0;
virtual char const *GetName( int index ) = 0;
virtual ptrdiff_t GetNameCount() = 0;
virtual char const *GetName( ptrdiff_t index ) = 0;

virtual int GetDisplayNameCount() = 0;
virtual char const *GetDisplayName( int index ) = 0;
virtual ptrdiff_t GetDisplayNameCount() = 0;
virtual char const *GetDisplayName( ptrdiff_t index ) = 0;

virtual char const *GetDisplayNameForUserName( char const *username ) = 0;
virtual char const *GetUserNameForDisplayName( char const *display ) = 0;

virtual int GetSeverityCount() = 0;
virtual char const *GetSeverity( int index ) = 0;
virtual ptrdiff_t GetSeverityCount() = 0;
virtual char const *GetSeverity( ptrdiff_t index ) = 0;

virtual int GetPriorityCount() = 0;
virtual char const *GetPriority( int index ) = 0;
virtual ptrdiff_t GetPriorityCount() = 0;
virtual char const *GetPriority( ptrdiff_t index ) = 0;

virtual int GetAreaCount() = 0;
virtual char const *GetArea( int index ) = 0;
virtual ptrdiff_t GetAreaCount() = 0;
virtual char const *GetArea( ptrdiff_t index ) = 0;

virtual int GetAreaMapCount() = 0;
virtual char const *GetAreaMap( int index ) = 0;
virtual ptrdiff_t GetAreaMapCount() = 0;
virtual char const *GetAreaMap( ptrdiff_t index ) = 0;

virtual int GetMapNumberCount() = 0;
virtual char const *GetMapNumber( int index ) = 0;
virtual ptrdiff_t GetMapNumberCount() = 0;
virtual char const *GetMapNumber( ptrdiff_t index ) = 0;

virtual int GetReportTypeCount() = 0;
virtual char const *GetReportType( int index ) = 0;
virtual ptrdiff_t GetReportTypeCount() = 0;
virtual char const *GetReportType( ptrdiff_t index ) = 0;

virtual char const *GetRepositoryURL( void ) = 0;
virtual char const *GetSubmissionURL( void ) = 0;

virtual int GetLevelCount(int area) = 0;
virtual char const *GetLevel(int area, int index ) = 0;
virtual ptrdiff_t GetLevelCount(ptrdiff_t area) = 0;
virtual char const *GetLevel(ptrdiff_t area, ptrdiff_t index ) = 0;

// Submission API
virtual void StartNewBugReport() = 0;
Expand Down
26 changes: 13 additions & 13 deletions common/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ bool CCrypto::GenerateSaltedSHA1Digest( const char *pchInput, const Salt_t *pSal
Assert( pSalt );
Assert( pOutDigest );

int iInputLen = Q_strlen( pchInput );
ptrdiff_t iInputLen = Q_strlen( pchInput );
uint8 *pubSaltedInput = new uint8[ iInputLen + sizeof( Salt_t ) ];

// Insert half the salt before the input string and half at the end.
Expand Down Expand Up @@ -1770,7 +1770,7 @@ CCustomHexEncoder::CCustomHexEncoder( const char *pchEncodingTable )
// pchEncodedData - Pointer to string buffer to store output in
// cchEncodedData - Size of pchEncodedData buffer
//-----------------------------------------------------------------------------
bool CCustomHexEncoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData )
bool CCustomHexEncoder::Encode( const uint8 *pubData, const size_t cubData, char *pchEncodedData, size_t cchEncodedData )
{
VPROF_BUDGET( "CCrypto::CustomHexEncode", VPROF_BUDGETGROUP_ENCRYPTION );
Assert( pubData );
Expand All @@ -1788,7 +1788,7 @@ bool CCustomHexEncoder::Encode( const uint8 *pubData, const uint32 cubData, char
hexEncoder.Put( pubData, cubData );
hexEncoder.MessageEnd();

uint32 len = pArraySinkOutput->TotalPutLength();
size_t len = pArraySinkOutput->TotalPutLength();
pchEncodedData[len] = 0; // NULL-terminate
if ( len >= cchEncodedData )
{
Expand All @@ -1810,7 +1810,7 @@ bool CCustomHexEncoder::Encode( const uint8 *pubData, const uint32 cubData, char
// output buffer. At exit, is filled in with actual size
// of decoded data.
//-----------------------------------------------------------------------------
bool CCustomHexEncoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData )
bool CCustomHexEncoder::Decode( const char *pchData, uint8 *pubDecodedData, size_t *pcubDecodedData )
{
VPROF_BUDGET( "CCrypto::CustomHexDecode", VPROF_BUDGETGROUP_ENCRYPTION );
Assert( pchData );
Expand All @@ -1827,7 +1827,7 @@ bool CCustomHexEncoder::Decode( const char *pchData, uint8 *pubDecodedData, uint
hexDecoder.Put( (byte *) pchData, Q_strlen( pchData ) );
hexDecoder.MessageEnd();

uint32 len = pArraySinkOutput->TotalPutLength();
size_t len = pArraySinkOutput->TotalPutLength();
if ( len > *pcubDecodedData )
{
AssertMsg2( false, "CCrypto::CustomHexDecode: insufficient output buffer for decoding, needed %d got %d\n",
Expand Down Expand Up @@ -1872,7 +1872,7 @@ CCustomBase32Encoder::CCustomBase32Encoder( const char *pchEncodingTable )
// pchEncodedData - Pointer to string buffer to store output in
// cchEncodedData - Size of pchEncodedData buffer
//-----------------------------------------------------------------------------
bool CCustomBase32Encoder::Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData )
bool CCustomBase32Encoder::Encode( const uint8 *pubData, const size_t cubData, char *pchEncodedData, size_t cchEncodedData )
{
VPROF_BUDGET( "CCrypto::CustomBase32Encode", VPROF_BUDGETGROUP_ENCRYPTION );
Assert( pubData );
Expand All @@ -1890,7 +1890,7 @@ bool CCustomBase32Encoder::Encode( const uint8 *pubData, const uint32 cubData, c
base32Encoder.Put( pubData, cubData );
base32Encoder.MessageEnd();

uint32 len = pArraySinkOutput->TotalPutLength();
size_t len = pArraySinkOutput->TotalPutLength();
pchEncodedData[len] = 0; // NULL-terminate
if ( len >= cchEncodedData )
{
Expand All @@ -1912,7 +1912,7 @@ bool CCustomBase32Encoder::Encode( const uint8 *pubData, const uint32 cubData, c
// output buffer. At exit, is filled in with actual size
// of decoded data.
//-----------------------------------------------------------------------------
bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData )
bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, size_t *pcubDecodedData )
{
VPROF_BUDGET( "CCrypto::CustomBase32Decode", VPROF_BUDGETGROUP_ENCRYPTION );
Assert( pchData );
Expand All @@ -1929,7 +1929,7 @@ bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, u
base32Decoder.Put( (byte *) pchData, Q_strlen( pchData ) );
base32Decoder.MessageEnd();

uint32 len = pArraySinkOutput->TotalPutLength();
size_t len = pArraySinkOutput->TotalPutLength();
if ( len > *pcubDecodedData )
{
AssertMsg2( false, "CCrypto::CustomBase32Decode: insufficient output buffer for decoding, needed %d got %d\n",
Expand All @@ -1951,7 +1951,7 @@ bool CCustomBase32Encoder::Decode( const char *pchData, uint8 *pubDecodedData, u
// pchEncodedData - Pointer to string buffer to store output in
// cchEncodedData - Size of pchEncodedData buffer
//-----------------------------------------------------------------------------
bool CCustomBase32Encoder::Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData )
bool CCustomBase32Encoder::Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, size_t cchEncodedData )
{
// This is useful if you have, say, 125 bits of information and
// want to encode them into 25 base32-encoded characters.
Expand Down Expand Up @@ -2104,7 +2104,7 @@ bool CCrypto::BGeneratePBKDF2Hash( const char* pchInput, const Salt_t &Salt, uns
{
PKCS5_PBKDF2_HMAC<SHA256> pbkdf;

unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)pchInput, Q_strlen(pchInput), (const byte *)&Salt, sizeof(Salt), rounds );
size_t iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)pchInput, Q_strlen(pchInput), (const byte *)&Salt, sizeof(Salt), rounds );

return ( iterations == rounds );
}
Expand All @@ -2122,7 +2122,7 @@ bool CCrypto::BGenerateWrappedSHA1PasswordHash( const char *pchInput, const Salt
if ( bResult )
{
PKCS5_PBKDF2_HMAC<SHA256> pbkdf;
unsigned int iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)&OutPasswordHash.sha, sizeof(OutPasswordHash.sha), (const byte *)&Salt, sizeof(Salt), rounds );
size_t iterations = pbkdf.DeriveKey( (byte *)&OutPasswordHash.pbkdf2, sizeof(OutPasswordHash.pbkdf2), 0, (const byte *)&OutPasswordHash.sha, sizeof(OutPasswordHash.sha), (const byte *)&Salt, sizeof(Salt), rounds );

bResult = ( iterations == rounds );
}
Expand Down Expand Up @@ -2171,7 +2171,7 @@ bool CCrypto::BUpgradeOrWrapPasswordHash( PasswordHash_t &InPasswordHash, EPassw

PKCS5_PBKDF2_HMAC<SHA256> pbkdf;
PasswordHash_t passOut;
unsigned int iterations = pbkdf.DeriveKey( (byte *)passOut.pbkdf2, sizeof(passOut.pbkdf2), 0, pbHash, k_HashLengths[k_EHashSHA1], (const byte *)&Salt, sizeof(Salt), 10000 );
size_t iterations = pbkdf.DeriveKey( (byte *)passOut.pbkdf2, sizeof(passOut.pbkdf2), 0, pbHash, k_HashLengths[k_EHashSHA1], (const byte *)&Salt, sizeof(Salt), 10000 );

bResult = ( iterations == 10000 );
if ( bResult )
Expand Down
10 changes: 5 additions & 5 deletions common/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ class CCustomHexEncoder
CCustomHexEncoder( const char *pchEncodingTable );
~CCustomHexEncoder() = default;

bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData );
bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData );
bool Encode( const uint8 *pubData, const size_t cubData, char *pchEncodedData, size_t cchEncodedData );
bool Decode( const char *pchData, uint8 *pubDecodedData, size_t *pcubDecodedData );

private:
bool m_bValidEncoding;
Expand All @@ -263,10 +263,10 @@ class CCustomBase32Encoder
CCustomBase32Encoder( const char *pchEncodingTable );
~CCustomBase32Encoder() = default;

bool Encode( const uint8 *pubData, const uint32 cubData, char *pchEncodedData, uint32 cchEncodedData );
bool Decode( const char *pchData, uint8 *pubDecodedData, uint32 *pcubDecodedData );
bool Encode( const uint8 *pubData, const size_t cubData, char *pchEncodedData, size_t cchEncodedData );
bool Decode( const char *pchData, uint8 *pubDecodedData, size_t *pcubDecodedData );

bool Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, uint32 cchEncodedData );
bool Encode( CSimpleBitString *pBitStringData, char *pchEncodedData, size_t cchEncodedData );
bool Decode( const char *pchData, CSimpleBitString *pBitStringDecodedData );

private:
Expand Down
4 changes: 2 additions & 2 deletions common/imageutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ unsigned char *ImgUtl_ReadVTFAsRGBA( const char *vtfPath, int &width, int &heigh
height = pVTFTexture->Height();
pVTFTexture->ConvertImageFormat( IMAGE_FORMAT_RGBA8888, false );

int nMemSize = ImageLoader::GetMemRequired( width, height, 1, IMAGE_FORMAT_RGBA8888, false );
intp nMemSize = ImageLoader::GetMemRequired( width, height, 1, IMAGE_FORMAT_RGBA8888, false );
unsigned char *pMemImage = (unsigned char *)malloc(nMemSize);
if ( pMemImage == NULL )
{
Expand Down Expand Up @@ -1463,7 +1463,7 @@ ConversionErrorType ImgUtl_ConvertTGAToVTF(const char *tgaPath, int nMaxWidth/*=

int imageMemoryFootprint = header.width * header.height * header.bits / 8;

CUtlBuffer inbuf(0, imageMemoryFootprint);
CUtlBuffer inbuf((intp)0, imageMemoryFootprint);

// read in the image
int nBytesRead = fread(inbuf.Base(), imageMemoryFootprint, 1, infile);
Expand Down
2 changes: 1 addition & 1 deletion common/netmessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ bool SVC_Menu::ReadFromBuffer( bf_read &buffer )
m_Type = (DIALOG_TYPE)buffer.ReadShort();
m_iLength = buffer.ReadWord();

CUtlBuffer buf( 0, m_iLength );
CUtlBuffer buf( (intp)0, m_iLength );
buffer.ReadBytes( buf.Base(), m_iLength );
buf.SeekPut( CUtlBuffer::SEEK_HEAD, m_iLength );

Expand Down
Loading

0 comments on commit 07e25ac

Please sign in to comment.