aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/kernel/outputpersistenceblock.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-10-19 21:03:33 +0000
committerEugene Sandulenko2010-10-19 21:03:33 +0000
commit6629efc676ca48e958dcfa0ee4e66e6aba1c6597 (patch)
tree3e76022f90ca9590c1ec376fc436461eaeee11ef /engines/sword25/kernel/outputpersistenceblock.cpp
parentae78107e2a8732977313e208f1d08e65d50ec8e8 (diff)
downloadscummvm-rg350-6629efc676ca48e958dcfa0ee4e66e6aba1c6597.tar.gz
scummvm-rg350-6629efc676ca48e958dcfa0ee4e66e6aba1c6597.tar.bz2
scummvm-rg350-6629efc676ca48e958dcfa0ee4e66e6aba1c6597.zip
SWORD25: Enforced code formatting rules in rest of the engine
svn-id: r53626
Diffstat (limited to 'engines/sword25/kernel/outputpersistenceblock.cpp')
-rw-r--r--engines/sword25/kernel/outputpersistenceblock.cpp96
1 files changed, 33 insertions, 63 deletions
diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp
index a6e598100e..811ca983dc 100644
--- a/engines/sword25/kernel/outputpersistenceblock.cpp
+++ b/engines/sword25/kernel/outputpersistenceblock.cpp
@@ -34,97 +34,67 @@
#define BS_LOG_PREFIX "OUTPUTPERSISTENCEBLOCK"
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
#include "sword25/kernel/outputpersistenceblock.h"
-// -----------------------------------------------------------------------------
-// Constants
-// -----------------------------------------------------------------------------
-
namespace {
const uint INITIAL_BUFFER_SIZE = 1024 * 64;
}
namespace Sword25 {
-// -----------------------------------------------------------------------------
-// Construction / Destruction
-// -----------------------------------------------------------------------------
-
OutputPersistenceBlock::OutputPersistenceBlock() {
- m_Data.reserve(INITIAL_BUFFER_SIZE);
+ _data.reserve(INITIAL_BUFFER_SIZE);
}
-// -----------------------------------------------------------------------------
-// Writing
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::write(signed int Value) {
- WriteMarker(SINT_MARKER);
- Value = ConvertEndianessFromSystemToStorage(Value);
- RawWrite(&Value, sizeof(Value));
+void OutputPersistenceBlock::write(signed int value) {
+ writeMarker(SINT_MARKER);
+ value = convertEndianessFromSystemToStorage(value);
+ rawWrite(&value, sizeof(value));
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::write(uint Value) {
- WriteMarker(UINT_MARKER);
- Value = ConvertEndianessFromSystemToStorage(Value);
- RawWrite(&Value, sizeof(Value));
+void OutputPersistenceBlock::write(uint value) {
+ writeMarker(UINT_MARKER);
+ value = convertEndianessFromSystemToStorage(value);
+ rawWrite(&value, sizeof(value));
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::write(float Value) {
- WriteMarker(FLOAT_MARKER);
- Value = ConvertEndianessFromSystemToStorage(Value);
- RawWrite(&Value, sizeof(Value));
+void OutputPersistenceBlock::write(float value) {
+ writeMarker(FLOAT_MARKER);
+ value = convertEndianessFromSystemToStorage(value);
+ rawWrite(&value, sizeof(value));
}
-// -----------------------------------------------------------------------------
+void OutputPersistenceBlock::write(bool value) {
+ writeMarker(BOOL_MARKER);
-void OutputPersistenceBlock::write(bool Value) {
- WriteMarker(BOOL_MARKER);
-
- uint UIntBool = Value ? 1 : 0;
- UIntBool = ConvertEndianessFromSystemToStorage(UIntBool);
- RawWrite(&UIntBool, sizeof(UIntBool));
+ uint uintBool = value ? 1 : 0;
+ uintBool = convertEndianessFromSystemToStorage(uintBool);
+ rawWrite(&uintBool, sizeof(uintBool));
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::write(const Common::String &String) {
- WriteMarker(STRING_MARKER);
+void OutputPersistenceBlock::write(const Common::String &string) {
+ writeMarker(STRING_MARKER);
- write(String.size());
- RawWrite(String.c_str(), String.size());
+ write(string.size());
+ rawWrite(string.c_str(), string.size());
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::write(const void *BufferPtr, size_t Size) {
- WriteMarker(BLOCK_MARKER);
+void OutputPersistenceBlock::write(const void *bufferPtr, size_t size) {
+ writeMarker(BLOCK_MARKER);
- write((int) Size);
- RawWrite(BufferPtr, Size);
+ write((int)size);
+ rawWrite(bufferPtr, size);
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::WriteMarker(byte Marker) {
- m_Data.push_back(Marker);
+void OutputPersistenceBlock::writeMarker(byte marker) {
+ _data.push_back(marker);
}
-// -----------------------------------------------------------------------------
-
-void OutputPersistenceBlock::RawWrite(const void *DataPtr, size_t Size) {
- if (Size > 0) {
- uint OldSize = m_Data.size();
- m_Data.resize(OldSize + Size);
- memcpy(&m_Data[OldSize], DataPtr, Size);
+void OutputPersistenceBlock::rawWrite(const void *dataPtr, size_t size) {
+ if (size > 0) {
+ uint oldSize = _data.size();
+ _data.resize(oldSize + size);
+ memcpy(&_data[oldSize], dataPtr, size);
}
}