From 18b2e3e5beca4416679c768a689147769c5eb90f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 May 2020 15:53:18 +0200 Subject: [PATCH] Don't depend on View in Worker. --- server/TracyFilesystem.cpp | 10 ---------- server/TracyFilesystem.hpp | 1 - server/TracyWorker.cpp | 12 +++++++++++- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/server/TracyFilesystem.cpp b/server/TracyFilesystem.cpp index 2570cd30..aa07d67b 100644 --- a/server/TracyFilesystem.cpp +++ b/server/TracyFilesystem.cpp @@ -15,14 +15,4 @@ bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, cons return false; } -bool SourceFileValid( const char* fn, uint64_t olderThan ) -{ - struct stat buf; - if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 ) - { - return (uint64_t)buf.st_mtime < olderThan; - } - return false; -} - } diff --git a/server/TracyFilesystem.hpp b/server/TracyFilesystem.hpp index a03a78bd..55248dde 100644 --- a/server/TracyFilesystem.hpp +++ b/server/TracyFilesystem.hpp @@ -17,7 +17,6 @@ static inline bool FileExists( const char* fn ) } bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, const Worker& worker ); -bool SourceFileValid( const char* fn, uint64_t olderThan ); } diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index c845a154..a3a1a2c1 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -16,13 +16,13 @@ # define __STDC_FORMAT_MACROS #endif #include +#include #include #include "../common/TracyProtocol.hpp" #include "../common/TracySystem.hpp" #include "TracyFileRead.hpp" -#include "TracyFilesystem.hpp" #include "TracyFileWrite.hpp" #include "TracySort.hpp" #include "TracyTaskDispatch.hpp" @@ -44,6 +44,16 @@ static tracy_force_inline uint32_t UnpackFileLine( uint64_t packed, uint32_t& li return packed >> 32; } +static bool SourceFileValid( const char* fn, uint64_t olderThan ) +{ + struct stat buf; + if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 ) + { + return (uint64_t)buf.st_mtime < olderThan; + } + return false; +} + static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', Version::Major, Version::Minor, Version::Patch }; enum { FileHeaderMagic = 5 };