From 284a99fff71270460ba7774e0e18b58d4e069b3f Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Sun, 14 Jun 2015 17:03:19 -0400 Subject: [PATCH] Renamed parameters in Read/WriteUserCmd and ReadRawData --- demboyz/demofile.cpp | 14 +++++++------- demboyz/demofile.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/demboyz/demofile.cpp b/demboyz/demofile.cpp index c052d22..cb16ea3 100644 --- a/demboyz/demofile.cpp +++ b/demboyz/demofile.cpp @@ -10,14 +10,14 @@ DemoFileReader::DemoFileReader(FILE* fp): { } -int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t length) +int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t maxLength) { FILE* fp = m_demoFp; int32_t size; fread(&size, sizeof(int32_t), 1, fp); - if (buffer && (length < size)) + if (buffer && (maxLength < size)) { return -1; } @@ -60,10 +60,10 @@ void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick) } } -int32_t DemoFileReader::ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length) +int32_t DemoFileReader::ReadUserCmd(int32_t& cmdNum, uint8_t* buffer, int32_t maxLength) { - fread(&sequenceNum, sizeof(int32_t), 1, m_demoFp); - return ReadRawData(buffer, length); + fread(&cmdNum, sizeof(int32_t), 1, m_demoFp); + return ReadRawData(buffer, maxLength); } // DemoFileWriter @@ -109,8 +109,8 @@ void DemoFileWriter::WriteCmdHeader(unsigned char cmd, int32_t tick) fwrite(&tick, sizeof(int32_t), 1, fp); } -void DemoFileWriter::WriteUserCmd(int32_t sequenceNum, const uint8_t* buffer, int32_t length) +void DemoFileWriter::WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length) { - fwrite(&sequenceNum, sizeof(int32_t), 1, m_demoFp); + fwrite(&cmdNum, sizeof(int32_t), 1, m_demoFp); WriteRawData(buffer, length); } diff --git a/demboyz/demofile.h b/demboyz/demofile.h index 1e4bd21..8985a07 100644 --- a/demboyz/demofile.h +++ b/demboyz/demofile.h @@ -13,11 +13,11 @@ public: DemoFileReader(FILE* fp); void ReadDemoHeader(demoheader_t& header); - int32_t ReadRawData(uint8_t* buffer, int32_t length); + int32_t ReadRawData(uint8_t* buffer, int32_t maxLength); void ReadSequenceInfo(int32_t& seqNum1, int32_t& seqNum2); void ReadCmdInfo(democmdinfo_t& info); void ReadCmdHeader(unsigned char& cmd, int32_t& tick); - int32_t ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length); + int32_t ReadUserCmd(int32_t& cmdNum, uint8_t* buffer, int32_t maxLength); private: FILE* m_demoFp; @@ -33,7 +33,7 @@ public: void WriteSequenceInfo(int32_t seqNum1, int32_t seqNum2); void WriteCmdInfo(const democmdinfo_t& info); void WriteCmdHeader(unsigned char cmd, int32_t tick); - void WriteUserCmd(int32_t sequenceNum, const uint8_t* buffer, int32_t length); + void WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length); private: FILE* m_demoFp;