[Project64] Log Class.cpp to use standard types
This commit is contained in:
parent
4b150ded03
commit
53aa2faf3b
|
@ -120,7 +120,7 @@ void CLog::LogArgs(const char * Message, va_list & args )
|
|||
void CLog::Log( const char * Message )
|
||||
{
|
||||
if (!m_hLogFile.IsOpen()) { return; }
|
||||
m_hLogFile.Write(Message, strlen(Message)*sizeof(TCHAR));
|
||||
m_hLogFile.Write(Message,(uint32_t)strlen(Message)*sizeof(TCHAR));
|
||||
if (m_FlushOnWrite)
|
||||
{
|
||||
m_hLogFile.Flush();
|
||||
|
@ -145,11 +145,11 @@ void CLog::Log( const char * Message )
|
|||
m_hLogFile.Seek((end - m_MaxFileSize) + m_FileChangeSize,CFile::begin);
|
||||
|
||||
// Find next end of line
|
||||
size_t NextEnter = 0, dwRead = 0;
|
||||
uint32_t NextEnter = 0, dwRead = 0;
|
||||
do
|
||||
{
|
||||
BYTE Data[300];
|
||||
size_t dwRead;
|
||||
uint32_t dwRead;
|
||||
|
||||
dwRead = m_hLogFile.Read(Data,sizeof(Data));
|
||||
if (dwRead == 0)
|
||||
|
@ -170,9 +170,8 @@ void CLog::Log( const char * Message )
|
|||
} while(dwRead != 0);
|
||||
|
||||
// copy content of log to the new file
|
||||
size_t ReadPos = (end - m_MaxFileSize) + m_FileChangeSize + NextEnter;
|
||||
uint32_t WritePos = 0;
|
||||
size_t SizeToRead;
|
||||
uint32_t ReadPos = (end - m_MaxFileSize) + m_FileChangeSize + NextEnter;
|
||||
uint32_t SizeToRead, WritePos = 0;
|
||||
do
|
||||
{
|
||||
enum { fIS_MvSize = 0x5000 };
|
||||
|
@ -183,7 +182,7 @@ void CLog::Log( const char * Message )
|
|||
|
||||
m_hLogFile.Seek(ReadPos,CFile::begin);
|
||||
|
||||
size_t dwRead;
|
||||
uint32_t dwRead;
|
||||
dwRead = m_hLogFile.Read(Data,SizeToRead);
|
||||
|
||||
m_hLogFile.Seek(WritePos,CFile::begin);
|
||||
|
|
|
@ -15,8 +15,8 @@ class CLog
|
|||
bool m_FlushOnWrite;
|
||||
stdstr m_FileName;
|
||||
bool m_TruncateFileLog;
|
||||
size_t m_MaxFileSize;
|
||||
size_t m_FileChangeSize;
|
||||
uint32_t m_MaxFileSize;
|
||||
uint32_t m_FileChangeSize;
|
||||
|
||||
public:
|
||||
CLog ( void );
|
||||
|
@ -29,10 +29,10 @@ public:
|
|||
bool Empty ( void );
|
||||
void Close ( void );
|
||||
|
||||
inline void SetMaxFileSize(size_t Size)
|
||||
inline void SetMaxFileSize ( uint32_t Size )
|
||||
{
|
||||
m_MaxFileSize = Size;
|
||||
m_FileChangeSize = (size_t)(Size * 0.1);
|
||||
m_FileChangeSize = (uint32_t)(Size * 0.1);
|
||||
}
|
||||
inline void SetTruncateFile( bool Truncate ) { m_TruncateFileLog = Truncate; }
|
||||
inline void SetFlush ( bool Always ) { m_FlushOnWrite = Always; }
|
||||
|
|
Loading…
Reference in New Issue