From f4cd7f96e2e01fe3ad3e4a47246abd650ee73c3f Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Thu, 18 Jun 2015 20:38:17 -0400 Subject: [PATCH] Made CommandPacket const reference in writers --- demboyz/io/conlogwriter.cpp | 4 ++-- demboyz/io/demowriter.cpp | 4 ++-- demboyz/io/idemowriter.h | 2 +- demboyz/io/jsonwriter.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demboyz/io/conlogwriter.cpp b/demboyz/io/conlogwriter.cpp index fc0d831..36677ae 100644 --- a/demboyz/io/conlogwriter.cpp +++ b/demboyz/io/conlogwriter.cpp @@ -12,7 +12,7 @@ public: virtual void StartWriting(demoheader_t& header) override final; virtual void EndWriting() override final; - virtual void StartCommandPacket(CommandPacket& packet) override final; + virtual void StartCommandPacket(const CommandPacket& packet) override final; virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; @@ -47,7 +47,7 @@ void ConLogWriter::EndWriting() fflush(stdout); } -void ConLogWriter::StartCommandPacket(CommandPacket& packet) +void ConLogWriter::StartCommandPacket(const CommandPacket& packet) { } diff --git a/demboyz/io/demowriter.cpp b/demboyz/io/demowriter.cpp index 9c8af33..2dcb060 100644 --- a/demboyz/io/demowriter.cpp +++ b/demboyz/io/demowriter.cpp @@ -17,7 +17,7 @@ public: virtual void StartWriting(demoheader_t& header) override final; virtual void EndWriting() override final; - virtual void StartCommandPacket(CommandPacket& packet) override final; + virtual void StartCommandPacket(const CommandPacket& packet) override final; virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; @@ -49,7 +49,7 @@ void DemoWriter::EndWriting() { } -void DemoWriter::StartCommandPacket(CommandPacket& packet) +void DemoWriter::StartCommandPacket(const CommandPacket& packet) { m_writer.WriteCmdHeader(packet.cmd, packet.tick); DemHandlers::DemMsg_FileWrite(packet.cmd, m_writer, packet.data); diff --git a/demboyz/io/idemowriter.h b/demboyz/io/idemowriter.h index 0b8842d..28a03ff 100644 --- a/demboyz/io/idemowriter.h +++ b/demboyz/io/idemowriter.h @@ -37,7 +37,7 @@ public: virtual void StartWriting(demoheader_t& header) = 0; virtual void EndWriting() = 0; - virtual void StartCommandPacket(CommandPacket& packet) = 0; + virtual void StartCommandPacket(const CommandPacket& packet) = 0; virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) = 0; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) = 0; diff --git a/demboyz/io/jsonwriter.cpp b/demboyz/io/jsonwriter.cpp index bb680e1..4ddf4ba 100644 --- a/demboyz/io/jsonwriter.cpp +++ b/demboyz/io/jsonwriter.cpp @@ -10,7 +10,7 @@ public: virtual void StartWriting(demoheader_t& header) override final; virtual void EndWriting() override final; - virtual void StartCommandPacket(CommandPacket& packet) override final; + virtual void StartCommandPacket(const CommandPacket& packet) override final; virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; @@ -33,7 +33,7 @@ void JsonWriter::EndWriting() { } -void JsonWriter::StartCommandPacket(CommandPacket& packet) +void JsonWriter::StartCommandPacket(const CommandPacket& packet) { }