1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Merge pull request #12 from ikrima/master

Fit & Finish: Build sanitization & Static analysis warning fixes
This commit is contained in:
Bartosz Taudul 2020-05-03 00:07:28 +02:00 committed by GitHub
commit aa7851d1d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 13 deletions

View File

@ -350,10 +350,10 @@ void SysTraceSendExternalName( uint64_t thread )
{ {
if( (uint64_t)ptr >= (uint64_t)info.lpBaseOfDll && (uint64_t)ptr <= (uint64_t)info.lpBaseOfDll + (uint64_t)info.SizeOfImage ) if( (uint64_t)ptr >= (uint64_t)info.lpBaseOfDll && (uint64_t)ptr <= (uint64_t)info.lpBaseOfDll + (uint64_t)info.SizeOfImage )
{ {
char buf[1024]; char buf2[1024];
if( _GetModuleBaseNameA( phnd, modules[i], buf, 1024 ) != 0 ) if( _GetModuleBaseNameA( phnd, modules[i], buf2, 1024 ) != 0 )
{ {
GetProfiler().SendString( thread, buf, QueueType::ExternalThreadName ); GetProfiler().SendString( thread, buf2, QueueType::ExternalThreadName );
threadSent = true; threadSent = true;
} }
} }
@ -389,13 +389,13 @@ void SysTraceSendExternalName( uint64_t thread )
const auto phnd = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid ); const auto phnd = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid );
if( phnd != INVALID_HANDLE_VALUE ) if( phnd != INVALID_HANDLE_VALUE )
{ {
char buf[1024]; char buf2[1024];
const auto sz = GetProcessImageFileNameA( phnd, buf, 1024 ); const auto sz = GetProcessImageFileNameA( phnd, buf2, 1024 );
CloseHandle( phnd ); CloseHandle( phnd );
if( sz != 0 ) if( sz != 0 )
{ {
auto ptr = buf + sz - 1; auto ptr = buf2 + sz - 1;
while( ptr > buf && *ptr != '\\' ) ptr--; while( ptr > buf2 && *ptr != '\\' ) ptr--;
if( *ptr == '\\' ) ptr++; if( *ptr == '\\' ) ptr++;
GetProfiler().SendString( thread, ptr, QueueType::ExternalName ); GetProfiler().SendString( thread, ptr, QueueType::ExternalName );
return; return;

View File

@ -110,13 +110,17 @@
#define _Static_assert static_assert #define _Static_assert static_assert
/// Platform and arch specifics /// Platform and arch specifics
#if defined(_MSC_VER) && !defined(__clang__) #ifndef FORCEINLINE
# define FORCEINLINE inline __forceinline # if defined(_MSC_VER) && !defined(__clang__)
#else # define FORCEINLINE inline __forceinline
# define FORCEINLINE inline __attribute__((__always_inline__)) # else
# define FORCEINLINE inline __attribute__((__always_inline__))
# endif
#endif #endif
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
# define WIN32_LEAN_AND_MEAN # ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h> # include <windows.h>
# if ENABLE_VALIDATE_ARGS # if ENABLE_VALIDATE_ARGS
# include <Intsafe.h> # include <Intsafe.h>

View File

@ -4,7 +4,7 @@ REM get vcpkg distribution
if not exist vcpkg git clone https://github.com/Microsoft/vcpkg.git if not exist vcpkg git clone https://github.com/Microsoft/vcpkg.git
REM build vcpkg REM build vcpkg
if not exist vcpkg\vcpkg.exe call vcpkg\bootstrap-vcpkg.bat if not exist vcpkg\vcpkg.exe call vcpkg\bootstrap-vcpkg.bat -disableMetrics
REM install required packages REM install required packages
vcpkg\vcpkg.exe install --triplet x64-windows-static freetype glfw3 capstone[arm,arm64,x86] vcpkg\vcpkg.exe install --triplet x64-windows-static freetype glfw3 capstone[arm,arm64,x86]