From cf7c04a001d99081d73e4340acb8065ad593030a Mon Sep 17 00:00:00 2001 From: richiesams Date: Mon, 24 Jun 2013 13:38:40 -0500 Subject: ZVISION: Fix code formatting to follow the convention --- engines/zvision/control.h | 2 +- engines/zvision/graphics.cpp | 2 +- engines/zvision/object.cpp | 26 ++++++++++---------- engines/zvision/object.h | 49 ++++++++++++++++++------------------- engines/zvision/puzzle.h | 2 +- engines/zvision/scrFileHandling.cpp | 2 +- engines/zvision/scriptManager.h | 2 +- engines/zvision/scripts.cpp | 2 +- engines/zvision/utility.h | 2 +- engines/zvision/zfsArchive.cpp | 2 +- engines/zvision/zfsArchive.h | 2 +- engines/zvision/zork_raw.cpp | 2 +- engines/zvision/zork_raw.h | 2 +- 13 files changed, 48 insertions(+), 49 deletions(-) (limited to 'engines') diff --git a/engines/zvision/control.h b/engines/zvision/control.h index 46a7211702..df01544bfc 100644 --- a/engines/zvision/control.h +++ b/engines/zvision/control.h @@ -32,6 +32,6 @@ struct Control { }; -} // End namespace ZVision +} // End of namespace ZVision #endif diff --git a/engines/zvision/graphics.cpp b/engines/zvision/graphics.cpp index 17e7a4f06b..7d1201c4f9 100644 --- a/engines/zvision/graphics.cpp +++ b/engines/zvision/graphics.cpp @@ -34,4 +34,4 @@ void ZVision::updateAnimations(uint32 detaTimeMillis) { } -} // End namespace ZVision +} // End of namespace ZVision diff --git a/engines/zvision/object.cpp b/engines/zvision/object.cpp index 253eaf7ace..6bc8c0f648 100644 --- a/engines/zvision/object.cpp +++ b/engines/zvision/object.cpp @@ -97,7 +97,7 @@ Object::Object(Common::String value) : _objectType(BYTE) { _value.stringVal = new Common::String(value); } -Object::Object(const Object& other) { +Object::Object(const Object &other) { _objectType = other._objectType; switch (_objectType) { @@ -138,7 +138,7 @@ Object::~Object() { void Object::deleteValue() { // Call delete on the correct part of the union. // Even though they all point to the same memory and will all be cast - // to a void *, compiler optimizations could cause undefined behavior. + // to a void *, this can still cause undefined behavior. switch (_objectType) { case BOOL: delete _value.boolVal; @@ -171,7 +171,7 @@ void Object::deleteValue() { } -Object& Object::operator=(const bool& rhs) { +Object &Object::operator=(const bool &rhs) { if (_objectType == BOOL) *_value.boolVal = rhs; else { @@ -183,7 +183,7 @@ Object& Object::operator=(const bool& rhs) { return *this; } -Object& Object::operator=(const byte& rhs) { +Object &Object::operator=(const byte &rhs) { if (_objectType == BYTE) *_value.byteVal = rhs; else { @@ -195,7 +195,7 @@ Object& Object::operator=(const byte& rhs) { return *this; } -Object& Object::operator=(const int16& rhs) { +Object &Object::operator=(const int16 &rhs) { if (_objectType == INT16) *_value.int16Val = rhs; else { @@ -207,7 +207,7 @@ Object& Object::operator=(const int16& rhs) { return *this; } -Object& Object::operator=(const uint16& rhs) { +Object &Object::operator=(const uint16 &rhs) { if (_objectType == UINT16) *_value.uint16Val = rhs; else { @@ -219,7 +219,7 @@ Object& Object::operator=(const uint16& rhs) { return *this; } -Object& Object::operator=(const int32& rhs) { +Object &Object::operator=(const int32 &rhs) { if (_objectType == INT32) *_value.int32Val = rhs; else { @@ -231,7 +231,7 @@ Object& Object::operator=(const int32& rhs) { return *this; } -Object& Object::operator=(const uint32& rhs) { +Object &Object::operator=(const uint32 &rhs) { if (_objectType == UINT32) *_value.uint32Val = rhs; else { @@ -243,7 +243,7 @@ Object& Object::operator=(const uint32& rhs) { return *this; } -Object& Object::operator=(const float& rhs) { +Object &Object::operator=(const float &rhs) { if (_objectType == FLOAT) *_value.floatVal = rhs; else { @@ -255,7 +255,7 @@ Object& Object::operator=(const float& rhs) { return *this; } -Object& Object::operator=(const double& rhs) { +Object &Object::operator=(const double &rhs) { if (_objectType == DOUBLE) *_value.doubleVal = rhs; else { @@ -267,7 +267,7 @@ Object& Object::operator=(const double& rhs) { return *this; } -Object& Object::operator=(const Common::String& rhs) { +Object &Object::operator=(const Common::String &rhs) { if (_objectType == STRING) *_value.stringVal = rhs; else { @@ -279,7 +279,7 @@ Object& Object::operator=(const Common::String& rhs) { return *this; } -Object& Object::operator=(const Object& rhs) { +Object &Object::operator=(const Object &rhs) { switch (_objectType) { case BOOL: return operator=(*rhs._value.boolVal); @@ -368,4 +368,4 @@ Object::operator Common::String() { return *_value.stringVal; } -} // End namespace ZVision +} // End of namespace ZVision diff --git a/engines/zvision/object.h b/engines/zvision/object.h index 02ca962239..b98b3812cd 100644 --- a/engines/zvision/object.h +++ b/engines/zvision/object.h @@ -27,19 +27,6 @@ namespace ZVision { - -enum ObjectType { - BOOL, - BYTE, - INT16, - UINT16, - INT32, - UINT32, - FLOAT, - DOUBLE, - STRING, -}; - /** * A generic single value storage class. It is useful for storing different * value types in a single List, Hashmap, etc. @@ -52,6 +39,18 @@ enum ObjectType { */ class Object { public: + enum ObjectType { + BOOL, + BYTE, + INT16, + UINT16, + INT32, + UINT32, + FLOAT, + DOUBLE, + STRING, + }; + // Constructors Object(ObjectType type); Object(bool value); @@ -86,17 +85,17 @@ private: } _value; public: - Object& operator=(const bool& rhs); - Object& operator=(const byte& rhs); - Object& operator=(const int16& rhs); - Object& operator=(const uint16& rhs); - Object& operator=(const int32& rhs); - Object& operator=(const uint32& rhs); - Object& operator=(const float& rhs); - Object& operator=(const double& rhs); - Object& operator=(const Common::String& rhs); - - Object& operator=(const Object& rhs); + Object &operator=(const bool &rhs); + Object &operator=(const byte &rhs); + Object &operator=(const int16 &rhs); + Object &operator=(const uint16 &rhs); + Object &operator=(const int32 &rhs); + Object &operator=(const uint32 &rhs); + Object &operator=(const float &rhs); + Object &operator=(const double &rhs); + Object &operator=(const Common::String &rhs); + + Object& operator=(const Object &rhs); operator bool(); operator byte(); @@ -116,6 +115,6 @@ private: void deleteValue(); }; -} // End namespace ZVision +} // End of namespace ZVision #endif diff --git a/engines/zvision/puzzle.h b/engines/zvision/puzzle.h index cb44a440e1..6961fde45a 100644 --- a/engines/zvision/puzzle.h +++ b/engines/zvision/puzzle.h @@ -114,6 +114,6 @@ struct Puzzle { byte flags; }; -} +} // End of namespace ZVision #endif diff --git a/engines/zvision/scrFileHandling.cpp b/engines/zvision/scrFileHandling.cpp index f4b5bab6fb..a0d4cebf9a 100644 --- a/engines/zvision/scrFileHandling.cpp +++ b/engines/zvision/scrFileHandling.cpp @@ -322,4 +322,4 @@ void ScriptManager::parseControl(Control *control, Common::SeekableReadStream &s } -} // End namespace ZVision +} // End of namespace ZVision diff --git a/engines/zvision/scriptManager.h b/engines/zvision/scriptManager.h index 7f6cc2547a..0bae91945d 100644 --- a/engines/zvision/scriptManager.h +++ b/engines/zvision/scriptManager.h @@ -99,6 +99,6 @@ private: }; -} // End namespace ZVision +} // End of namespace ZVision #endif diff --git a/engines/zvision/scripts.cpp b/engines/zvision/scripts.cpp index 40bad8f3a1..b6deb1b510 100644 --- a/engines/zvision/scripts.cpp +++ b/engines/zvision/scripts.cpp @@ -28,4 +28,4 @@ namespace ZVision { -} // End namespace ZVision +} // End of namespace ZVision diff --git a/engines/zvision/utility.h b/engines/zvision/utility.h index 0777ba9ebc..f9f99166fc 100644 --- a/engines/zvision/utility.h +++ b/engines/zvision/utility.h @@ -69,6 +69,6 @@ void trimCommentsAndWhiteSpace(Common::String &string) { string.trim(); } -} // End namespace ZVision +} // End of namespace ZVision #endif diff --git a/engines/zvision/zfsArchive.cpp b/engines/zvision/zfsArchive.cpp index 93a026e5b9..e65d0df14e 100644 --- a/engines/zvision/zfsArchive.cpp +++ b/engines/zvision/zfsArchive.cpp @@ -150,6 +150,6 @@ void ZfsArchive::unXor(byte *buffer, int length, const byte *xorKey) const { buffer[i] ^= xorKey[i % 4]; } -} // End namespace ZVision +} // End of namespace ZVision diff --git a/engines/zvision/zfsArchive.h b/engines/zvision/zfsArchive.h index 718b26c836..60292f865e 100644 --- a/engines/zvision/zfsArchive.h +++ b/engines/zvision/zfsArchive.h @@ -115,6 +115,6 @@ private: void unXor(byte *buffer, int length, const byte *xorKey) const; }; -} // End of namespace Common +} // End of namespace ZVision #endif diff --git a/engines/zvision/zork_raw.cpp b/engines/zvision/zork_raw.cpp index 3c37f929b3..e008741e16 100644 --- a/engines/zvision/zork_raw.cpp +++ b/engines/zvision/zork_raw.cpp @@ -185,4 +185,4 @@ Audio::SeekableAudioStream *makeRawZorkStream(const byte *buffer, uint32 size, return makeRawZorkStream(new Common::MemoryReadStream(buffer, size, disposeAfterUse), rate, DisposeAfterUse::YES); } -} // End of namespace Audio +} // End of namespace ZVision diff --git a/engines/zvision/zork_raw.h b/engines/zvision/zork_raw.h index a8f8ce037f..3a938026d9 100644 --- a/engines/zvision/zork_raw.h +++ b/engines/zvision/zork_raw.h @@ -62,6 +62,6 @@ Audio::SeekableAudioStream *makeRawZorkStream(Common::SeekableReadStream *stream int rate, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); -} // End of namespace Audio +} // End of namespace ZVision #endif -- cgit v1.2.3