ZVISION: Fix code formatting to follow the convention

This commit is contained in:
richiesams 2013-06-24 13:38:40 -05:00
parent 75e513c46c
commit cf7c04a001
13 changed files with 47 additions and 48 deletions

View File

@ -32,6 +32,6 @@ struct Control {
};
} // End namespace ZVision
} // End of namespace ZVision
#endif

View File

@ -34,4 +34,4 @@ void ZVision::updateAnimations(uint32 detaTimeMillis) {
}
} // End namespace ZVision
} // End of namespace ZVision

View File

@ -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

View File

@ -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 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 Object &rhs);
operator bool();
operator byte();
@ -116,6 +115,6 @@ private:
void deleteValue();
};
} // End namespace ZVision
} // End of namespace ZVision
#endif

View File

@ -114,6 +114,6 @@ struct Puzzle {
byte flags;
};
}
} // End of namespace ZVision
#endif

View File

@ -322,4 +322,4 @@ void ScriptManager::parseControl(Control *control, Common::SeekableReadStream &s
}
} // End namespace ZVision
} // End of namespace ZVision

View File

@ -99,6 +99,6 @@ private:
};
} // End namespace ZVision
} // End of namespace ZVision
#endif

View File

@ -28,4 +28,4 @@ namespace ZVision {
} // End namespace ZVision
} // End of namespace ZVision

View File

@ -69,6 +69,6 @@ void trimCommentsAndWhiteSpace(Common::String &string) {
string.trim();
}
} // End namespace ZVision
} // End of namespace ZVision
#endif

View File

@ -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

View File

@ -115,6 +115,6 @@ private:
void unXor(byte *buffer, int length, const byte *xorKey) const;
};
} // End of namespace Common
} // End of namespace ZVision
#endif

View File

@ -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

View File

@ -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