std::size_t -> size_t

Removing std prefix from all size_t.
This commit is contained in:
sukibaby
2024-10-01 01:46:26 -07:00
committed by teejusb
parent 8d125f3951
commit e0b254968d
161 changed files with 755 additions and 755 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ bool CrashHandler::IsDebuggerPresent()
int ret;
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
struct kinfo_proc info;
std::size_t size;
size_t size;
// Initialize the flags so that, if sysctl fails for some bizarre
// reason, we get a predictable result.
+1 -1
View File
@@ -52,7 +52,7 @@ namespace __gnu_cxx
template<>
struct hash<IOHIDElementCookie> : private hash<std::uintptr_t>
{
std::size_t operator()( const IOHIDElementCookie& cookie ) const
size_t operator()( const IOHIDElementCookie& cookie ) const
{
return hash<unsigned long>::operator()( std::uintptr_t(cookie) );
}
+1 -1
View File
@@ -481,7 +481,7 @@ bool KeyboardDevice::DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iM
for( int iUsbKey = 0; iUsbKey < 256; ++iUsbKey )
{
DeviceButton button2;
if( UsbKeyToDeviceButton(iUsbKey, button2) && std::size_t(button2) < sizeof(g_iDeviceButtonToMacVirtualKey) )
if( UsbKeyToDeviceButton(iUsbKey, button2) && size_t(button2) < sizeof(g_iDeviceButtonToMacVirtualKey) )
g_iDeviceButtonToMacVirtualKey[button2] = g_iUsbKeyToMacVirtualKey[iUsbKey];
}
bInited = true;
+7 -7
View File
@@ -310,7 +310,7 @@ bool IsValidFrame( const StackFrame *frame )
/* This x86 backtracer attempts to walk the stack frames. If we come to a
* place that doesn't look like a valid frame, we'll look forward and try
* to find one again. */
static void do_backtrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
static void do_backtrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
/* Read /proc/pid/maps to find the address range of the stack. */
get_readable_ranges( g_ReadableBegin, g_ReadableEnd, 1024 );
@@ -410,7 +410,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
#error
#endif
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
InitializeBacktrace();
@@ -543,7 +543,7 @@ static bool PointsToValidCall( vm_address_t start, const void *ptr )
}
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
InitializeBacktrace();
@@ -569,7 +569,7 @@ void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *c
vm_prot_t protection = 0;
vm_address_t start = 0;
std::size_t i = 0;
size_t i = 0;
if( i < size-1 && ctx->ip )
buf[i++] = ctx->ip;
@@ -668,7 +668,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
void InitializeBacktrace() { }
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
BacktraceContext CurrentCtx;
if( ctx == nullptr )
@@ -716,7 +716,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
void InitializeBacktrace() { }
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
BacktraceContext CurrentCtx;
@@ -753,7 +753,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
// NYI
}
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx )
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx )
{
buf[0] = BACKTRACE_METHOD_NOT_AVAILABLE;
buf[1] = nullptr;
+1 -1
View File
@@ -37,7 +37,7 @@ void InitializeBacktrace();
* null-terminated. If ctx is nullptr, retrieve the current backtrace; otherwise
* retrieve a backtrace for the given context. (Not all backtracers may
* support contexts.) */
void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx = nullptr );
void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx = nullptr );
/* Set up a BacktraceContext to get a backtrace for a thread. ThreadID may
* not be the current thread. True is returned on success, false on failure. */
+2 -2
View File
@@ -81,7 +81,7 @@ RString BacktraceNames::Format() const
if( ShortenedPath != "" )
{
/* Abbreviate the module name. */
std::size_t slash = ShortenedPath.rfind('/');
size_t slash = ShortenedPath.rfind('/');
if( slash != ShortenedPath.npos )
ShortenedPath = ShortenedPath.substr(slash+1);
ShortenedPath = RString("(") + ShortenedPath + ")";
@@ -326,7 +326,7 @@ void BacktraceNames::FromString( RString s )
if( MangledAndOffset != "" )
{
std::size_t plus = MangledAndOffset.rfind('+');
size_t plus = MangledAndOffset.rfind('+');
if(plus == MangledAndOffset.npos)
{
+4 -4
View File
@@ -40,7 +40,7 @@ static void safe_print( int fd, ... )
{
break;
}
std::size_t len = strlen( p );
size_t len = strlen( p );
while( len )
{
ssize_t result = write( fd, p, strlen(p) );
@@ -102,7 +102,7 @@ static void spawn_child_process( int from_parent )
}
/* write(), but retry a couple times on EINTR. */
static int retried_write( int fd, const void *buf, std::size_t count )
static int retried_write( int fd, const void *buf, size_t count )
{
int tries = 3, ret;
do
@@ -114,7 +114,7 @@ static int retried_write( int fd, const void *buf, std::size_t count )
return ret;
}
static bool parent_write( int to_child, const void *p, std::size_t size )
static bool parent_write( int to_child, const void *p, size_t size )
{
int ret = retried_write( to_child, p, size );
if( ret == -1 )
@@ -123,7 +123,7 @@ static bool parent_write( int to_child, const void *p, std::size_t size )
return false;
}
if( std::size_t(ret) != size )
if( size_t(ret) != size )
{
safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", nullptr );
return false;
+2 -2
View File
@@ -82,7 +82,7 @@ void CrashHandler::SetForegroundWindow( HWND hWnd )
g_hForegroundWnd = hWnd;
}
void WriteToChild( HANDLE hPipe, const void *pData, std::size_t iSize )
void WriteToChild( HANDLE hPipe, const void *pData, size_t iSize )
{
while( iSize )
{
@@ -472,7 +472,7 @@ static bool PointsToValidCall( ULONG_PTR ptr )
return IsValidCall(buf+7, len);
}
void CrashHandler::do_backtrace( const void **buf, std::size_t size,
void CrashHandler::do_backtrace( const void **buf, size_t size,
HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext )
{
const void **pLast = buf + size - 1;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CrashHandler
{
extern long __stdcall ExceptionHandler(struct _EXCEPTION_POINTERS *ExceptionInfo);
void do_backtrace( const void **buf, std::size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext );
void do_backtrace( const void **buf, size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext );
void SymLookup( const void *ptr, char *buf );
void ForceCrash( const char *reason );
void ForceDeadlock( RString reason, std::uint64_t iID );
+10 -10
View File
@@ -107,10 +107,10 @@ namespace VDDebugInfo
src += 64;
const int* pVer = reinterpret_cast<const int*>(src);
const std::size_t* pRVASize = reinterpret_cast<const std::size_t*>(src + sizeof(int));
const std::size_t* pFNamSize = reinterpret_cast<const std::size_t*>(src + sizeof(int) + sizeof(std::size_t));
const int* pSegCnt = reinterpret_cast<const int*>(src + sizeof(int) + 2 * sizeof(std::size_t));
src += 2 * (sizeof(int) + sizeof(std::size_t));
const size_t* pRVASize = reinterpret_cast<const size_t*>(src + sizeof(int));
const size_t* pFNamSize = reinterpret_cast<const size_t*>(src + sizeof(int) + sizeof(size_t));
const int* pSegCnt = reinterpret_cast<const int*>(src + sizeof(int) + 2 * sizeof(size_t));
src += 2 * (sizeof(int) + sizeof(size_t));
pctx->nBuildNumber = *pVer;
pctx->pRVAHeap = reinterpret_cast<const unsigned char*>(src + sizeof(std::uintptr_t));
@@ -150,7 +150,7 @@ namespace VDDebugInfo
if( dwFileSize == INVALID_FILE_SIZE )
break;
char *buffer = new char[static_cast<std::size_t>(dwFileSize) + 1];
char *buffer = new char[static_cast<size_t>(dwFileSize) + 1];
std::fill(buffer, buffer + dwFileSize + 1, '\0' );
DWORD dwActual;
@@ -181,7 +181,7 @@ namespace VDDebugInfo
return false;
}
static const char *GetNameFromHeap(const char *heap, std::size_t idx)
static const char *GetNameFromHeap(const char *heap, size_t idx)
{
while(idx--)
while(*heap++);
@@ -196,7 +196,7 @@ namespace VDDebugInfo
const unsigned char *pr = pctx->pRVAHeap;
const unsigned char *pr_limit = (const unsigned char *)pctx->pFuncNameHeap;
std::size_t idx = 0;
size_t idx = 0;
// Linearly unpack RVA deltas and find lower_bound
rva -= pctx->nFirstRVA;
@@ -344,7 +344,7 @@ namespace SymbolLookup
return "???";
}
RString sName;
char *buffer = new char[static_cast<std::size_t>(iSize) + 1];
char *buffer = new char[static_cast<size_t>(iSize) + 1];
std::fill(buffer, buffer + iSize + 1, '\0');
if (!ReadFromParent(iFD, buffer, iSize))
{
@@ -491,7 +491,7 @@ static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut )
sOut += ssprintf( "\n" );
sOut += ssprintf( "Partial log:\n" );
for( std::size_t i = 0; i < Data.m_asRecent.size(); ++i )
for( size_t i = 0; i < Data.m_asRecent.size(); ++i )
sOut += ssprintf( "%s\n", Data.m_asRecent[i].c_str() );
sOut += ssprintf( "\n" );
@@ -531,7 +531,7 @@ bool ReadCrashDataFromParent( int iFD, CompleteCrashData &Data )
if( !ReadFromParent(iFD, &iSize, sizeof(iSize)) )
return false;
char *buffer = new char[static_cast<std::size_t>(iSize) + 1];
char *buffer = new char[static_cast<size_t>(iSize) + 1];
std::fill(buffer, buffer + iSize + 1, '\0');
bool wasReadSuccessful = ReadFromParent(iFD, buffer, iSize);
RString tmp = buffer;
@@ -73,14 +73,14 @@ public:
/* Read data. Block until any data is received, then return all data
* available. Return the number of bytes read. The return value will always
* be >= 0, unless an error or cancellation occured. */
virtual int Read( void *pBuffer, std::size_t iSize ) = 0;
virtual int Read( void *pBuffer, size_t iSize ) = 0;
/* Write data to the socket. (Design note: we always write all of the data
* unless an error or cancellation occurs, and those states are checked
* with GetState(). If that happens, the number of bytes written is
* meaningless, since it may have simply been buffered and never sent.
* So, this function returns no value.) */
virtual void Write( const void *pBuffer, std::size_t iSize ) = 0;
virtual void Write( const void *pBuffer, size_t iSize ) = 0;
/* Cancel the connection. This operation can clear an error state, aborts
* any blocking calls, never fails, and will always result in the socket
@@ -128,8 +128,8 @@ public:
void Open( const RString &sHost, int iPort, ConnectionType ct = CONN_TCP );
void Shutdown();
void Close();
int Read( void *pBuffer, std::size_t iSize );
void Write( const void *pBuffer, std::size_t iSize );
int Read( void *pBuffer, size_t iSize );
void Write( const void *pBuffer, size_t iSize );
void Cancel();
@@ -492,7 +492,7 @@ void NetworkStream_Win32::Cancel()
m_Mutex.Unlock();
}
int NetworkStream_Win32::Read( void *pBuffer, std::size_t iSize )
int NetworkStream_Win32::Read( void *pBuffer, size_t iSize )
{
if( m_State != STATE_CONNECTED )
return 0;
@@ -541,7 +541,7 @@ int NetworkStream_Win32::Read( void *pBuffer, std::size_t iSize )
return iRead;
}
void NetworkStream_Win32::Write( const void *pBuffer, std::size_t iSize )
void NetworkStream_Win32::Write( const void *pBuffer, size_t iSize )
{
if( m_State != STATE_CONNECTED )
return;
+1 -1
View File
@@ -13,7 +13,7 @@
* the HKEY_LOCAL_MACHINE constant in key. */
static bool GetRegKeyType( const RString &sIn, RString &sOut, HKEY &key )
{
std::size_t iBackslash = sIn.find( '\\' );
size_t iBackslash = sIn.find( '\\' );
if( iBackslash == sIn.npos )
{
LOG->Warn( "Invalid registry key: \"%s\" ", sIn.c_str() );
+3 -3
View File
@@ -224,7 +224,7 @@ int main(int argc, char **argv) {
// printf("Processing RVA entries...\n");
for (std::size_t i = 0; i < rvabuf.size(); ++i) {
for (size_t i = 0; i < rvabuf.size(); ++i) {
std::uint16_t grp;
std::uint32_t start;
std::uintptr_t rva;
@@ -240,7 +240,7 @@ int main(int argc, char **argv) {
// printf("Processing segment entries...\n");
for (std::size_t i = 0; i < segcnt; i++) {
for (size_t i = 0; i < segcnt; i++) {
segbuf[i][0] += grpstart[seggrp[i]];
// printf("\t#%-2zu %p-%p\n", i + 1, reinterpret_cast<void*>(segbuf[i][0]), reinterpret_cast<void*>(segbuf[i][0] + segbuf[i][1] - 1));
}
@@ -288,7 +288,7 @@ int main(int argc, char **argv) {
fwrite(header, 64, 1, fo);
std::size_t t;
size_t t;
fwrite(&ver, sizeof ver, 1, fo);