COMMON: Remove superfluous Common:: qualifiers.

This commit is contained in:
Christoph Mallon 2011-08-06 09:47:19 +02:00
parent b3997f0562
commit 84220d2ca0
32 changed files with 131 additions and 132 deletions

View File

@ -28,12 +28,12 @@ EventDispatcher::EventDispatcher() : _mapper(0) {
}
EventDispatcher::~EventDispatcher() {
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
if (i->autoFree)
delete i->source;
}
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->autoFree)
delete i->observer;
}
@ -43,9 +43,9 @@ EventDispatcher::~EventDispatcher() {
}
void EventDispatcher::dispatch() {
Common::Event event;
Event event;
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
const bool allowMapping = i->source->allowMapping();
while (i->source->pollEvent(event)) {
@ -83,7 +83,7 @@ void EventDispatcher::registerSource(EventSource *source, bool autoFree) {
}
void EventDispatcher::unregisterSource(EventSource *source) {
for (Common::List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) {
if (i->source == source) {
if (i->autoFree)
delete source;
@ -101,7 +101,7 @@ void EventDispatcher::registerObserver(EventObserver *obs, uint priority, bool a
newEntry.priority = priority;
newEntry.autoFree = autoFree;
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->priority < priority) {
_observers.insert(i, newEntry);
return;
@ -112,7 +112,7 @@ void EventDispatcher::registerObserver(EventObserver *obs, uint priority, bool a
}
void EventDispatcher::unregisterObserver(EventObserver *obs) {
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->observer == obs) {
if (i->autoFree)
delete obs;
@ -124,7 +124,7 @@ void EventDispatcher::unregisterObserver(EventObserver *obs) {
}
void EventDispatcher::dispatchEvent(const Event &event) {
for (Common::List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
for (List<ObserverEntry>::iterator i = _observers.begin(); i != _observers.end(); ++i) {
if (i->observer->notifyEvent(event))
break;
}

View File

@ -226,12 +226,12 @@ void sort(T first, T last, StrictWeakOrdering comp) {
*/
template<typename T>
void sort(T *first, T *last) {
sort(first, last, Common::Less<T>());
sort(first, last, Less<T>());
}
template<class T>
void sort(T first, T last) {
sort(first, last, Common::Less<typename T::ValueType>());
sort(first, last, Less<typename T::ValueType>());
}
// MSVC is complaining about the minus operator being applied to an unsigned type

View File

@ -147,7 +147,7 @@ void SearchSet::addSubDirectoriesMatching(const FSNode &directory, String origPa
for (FSList::const_iterator i = subDirs.begin(); i != subDirs.end(); ++i) {
String name = i->getName();
if (Common::matchString(name.c_str(), pattern.c_str(), ignoreCase)) {
if (matchString(name.c_str(), pattern.c_str(), ignoreCase)) {
matchIter = multipleMatches.find(name);
if (matchIter == multipleMatches.end()) {
multipleMatches[name] = true;

View File

@ -254,7 +254,7 @@ public:
virtual void clear();
private:
friend class Common::Singleton<SingletonBaseType>;
friend class Singleton<SingletonBaseType>;
SearchManager();
};

View File

@ -42,7 +42,7 @@ namespace Common {
* management scheme. There, only elements that 'live' are actually constructed
* (i.e., have their constructor called), and objects that are removed are
* immediately destructed (have their destructor called).
* With Common::Array, this is not the case; instead, it simply uses new[] and
* With Array, this is not the case; instead, it simply uses new[] and
* delete[] to allocate whole blocks of objects, possibly more than are
* currently 'alive'. This simplifies memory management, but may have
* undesirable side effects when one wants to use an Array of complex

View File

@ -36,7 +36,7 @@ namespace Common {
* underscores. In particular, white space and "#", "=", "[", "]"
* are not valid!
*/
bool ConfigFile::isValidName(const Common::String &name) {
bool ConfigFile::isValidName(const String &name) {
const char *p = name.c_str();
while (*p && (isalnum(static_cast<unsigned char>(*p)) || *p == '-' || *p == '_' || *p == '.'))
p++;

View File

@ -93,7 +93,7 @@ public:
* underscores. In particular, white space and "#", "=", "[", "]"
* are not valid!
*/
static bool isValidName(const Common::String &name);
static bool isValidName(const String &name);
/** Reset everything stored in this config file. */
void clear();

View File

@ -112,7 +112,7 @@ void ConfigManager::loadConfigFile(const String &filename) {
* Add a ready-made domain based on its name and contents
* The domain name should not already exist in the ConfigManager.
**/
void ConfigManager::addDomain(const Common::String &domainName, const ConfigManager::Domain &domain) {
void ConfigManager::addDomain(const String &domainName, const ConfigManager::Domain &domain) {
if (domainName.empty())
return;
if (domainName == kApplicationDomain) {
@ -492,7 +492,7 @@ int ConfigManager::getInt(const String &key, const String &domName) const {
bool ConfigManager::getBool(const String &key, const String &domName) const {
String value(get(key, domName));
bool val;
if (Common::parseBool(value, val))
if (parseBool(value, val))
return val;
error("ConfigManager::getBool(%s,%s): '%s' is not a valid bool",

View File

@ -153,7 +153,7 @@ private:
ConfigManager();
void loadFromStream(SeekableReadStream &stream);
void addDomain(const Common::String &domainName, const Domain &domain);
void addDomain(const String &domainName, const Domain &domain);
void writeDomain(WriteStream &stream, const String &name, const Domain &domain);
void renameDomain(const String &oldName, const String &newName, DomainMap &map);

View File

@ -30,7 +30,7 @@ namespace Common {
class DecompressorDCL {
public:
bool unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
bool unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
protected:
/**
@ -41,7 +41,7 @@ protected:
* @param nUnpacket size of unpacked data
* @return 0 on success, non-zero on error
*/
void init(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
void init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
/**
* Get a number of bits from _src stream, starting with the least
@ -73,12 +73,11 @@ protected:
uint32 _szUnpacked; ///< size of the decompressed data
uint32 _dwRead; ///< number of bytes read from _src
uint32 _dwWrote; ///< number of bytes written to _dest
Common::ReadStream *_src;
ReadStream *_src;
byte *_dest;
};
void DecompressorDCL::init(Common::ReadStream *src, byte *dest, uint32 nPacked,
uint32 nUnpacked) {
void DecompressorDCL::init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
_src = src;
_dest = dest;
_szPacked = nPacked;
@ -333,7 +332,7 @@ int DecompressorDCL::huffman_lookup(const int *tree) {
#define DCL_BINARY_MODE 0
#define DCL_ASCII_MODE 1
bool DecompressorDCL::unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
bool DecompressorDCL::unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
init(src, dest, nPacked, nUnpacked);
int value;

View File

@ -97,7 +97,7 @@ struct Event {
* Virtual screen coordinates means: the coordinate system of the
* screen area as defined by the most recent call to initSize().
*/
Common::Point mouse;
Point mouse;
Event() : type(EVENT_INVALID), synthetic(false) {}
};
@ -139,13 +139,13 @@ public:
*/
class ArtificialEventSource : public EventSource {
protected:
Common::Queue<Common::Event> _artificialEventQueue;
Queue<Event> _artificialEventQueue;
public:
void addEvent(const Common::Event &ev) {
void addEvent(const Event &ev) {
_artificialEventQueue.push(ev);
}
bool pollEvent(Common::Event &ev) {
bool pollEvent(Event &ev) {
if (!_artificialEventQueue.empty()) {
ev = _artificialEventQueue.pop();
return true;
@ -275,14 +275,14 @@ private:
EventSource *source;
};
Common::List<SourceEntry> _sources;
List<SourceEntry> _sources;
struct ObserverEntry : public Entry {
uint priority;
EventObserver *observer;
};
Common::List<ObserverEntry> _observers;
List<ObserverEntry> _observers;
void dispatchEvent(const Event &event);
};
@ -315,15 +315,15 @@ public:
* @param event point to an Event struct, which will be filled with the event data.
* @return true if an event was retrieved.
*/
virtual bool pollEvent(Common::Event &event) = 0;
virtual bool pollEvent(Event &event) = 0;
/**
* Pushes a "fake" event into the event queue
*/
virtual void pushEvent(const Common::Event &event) = 0;
virtual void pushEvent(const Event &event) = 0;
/** Return the current mouse position */
virtual Common::Point getMousePos() const = 0;
virtual Point getMousePos() const = 0;
/**
* Return a bitmask with the button states:
@ -362,7 +362,7 @@ public:
// TODO: Consider removing OSystem::getScreenChangeID and
// replacing it by a generic getScreenChangeID method here
#ifdef ENABLE_KEYMAPPER
virtual Common::Keymapper *getKeymapper() = 0;
virtual Keymapper *getKeymapper() = 0;
#endif
enum {

View File

@ -72,7 +72,7 @@ bool File::open(const FSNode &node) {
return open(stream, node.getPath());
}
bool File::open(SeekableReadStream *stream, const Common::String &name) {
bool File::open(SeekableReadStream *stream, const String &name) {
assert(!_handle);
if (stream) {

View File

@ -97,7 +97,7 @@ public:
* @param name a string describing the 'file' corresponding to stream
* @return true if stream was non-zero, false otherwise
*/
virtual bool open(SeekableReadStream *stream, const Common::String &name);
virtual bool open(SeekableReadStream *stream, const String &name);
/**
* Close the file, if open.

View File

@ -33,7 +33,7 @@ FSNode::FSNode(AbstractFSNode *realNode)
: _realNode(realNode) {
}
FSNode::FSNode(const Common::String &p) {
FSNode::FSNode(const String &p) {
assert(g_system);
FilesystemFactory *factory = g_system->getFilesystemFactory();
AbstractFSNode *tmp = 0;
@ -42,7 +42,7 @@ FSNode::FSNode(const Common::String &p) {
tmp = factory->makeCurrentDirectoryFileNode();
else
tmp = factory->makeFileNodePath(p);
_realNode = Common::SharedPtr<AbstractFSNode>(tmp);
_realNode = SharedPtr<AbstractFSNode>(tmp);
}
bool FSNode::operator<(const FSNode& node) const {
@ -59,7 +59,7 @@ bool FSNode::exists() const {
return _realNode && _realNode->exists();
}
FSNode FSNode::getChild(const Common::String &n) const {
FSNode FSNode::getChild(const String &n) const {
// If this node is invalid or not a directory, return an invalid node
if (_realNode == 0 || !_realNode->isDirectory())
return FSNode();
@ -85,12 +85,12 @@ bool FSNode::getChildren(FSList &fslist, ListMode mode, bool hidden) const {
return true;
}
Common::String FSNode::getDisplayName() const {
String FSNode::getDisplayName() const {
assert(_realNode);
return _realNode->getDisplayName();
}
Common::String FSNode::getName() const {
String FSNode::getName() const {
assert(_realNode);
return _realNode->getName();
}
@ -107,7 +107,7 @@ FSNode FSNode::getParent() const {
}
}
Common::String FSNode::getPath() const {
String FSNode::getPath() const {
assert(_realNode);
return _realNode->getPath();
}
@ -124,7 +124,7 @@ bool FSNode::isWritable() const {
return _realNode && _realNode->isWritable();
}
Common::SeekableReadStream *FSNode::createReadStream() const {
SeekableReadStream *FSNode::createReadStream() const {
if (_realNode == 0)
return 0;
@ -139,7 +139,7 @@ Common::SeekableReadStream *FSNode::createReadStream() const {
return _realNode->createReadStream();
}
Common::WriteStream *FSNode::createWriteStream() const {
WriteStream *FSNode::createWriteStream() const {
if (_realNode == 0)
return 0;

View File

@ -424,7 +424,7 @@ private:
* are interesting for that matter.
*/
template<class Arg, class Res>
struct Functor1 : public Common::UnaryFunction<Arg, Res> {
struct Functor1 : public UnaryFunction<Arg, Res> {
virtual ~Functor1() {}
virtual bool isValid() const = 0;
@ -460,7 +460,7 @@ private:
* @see Functor1
*/
template<class Arg1, class Arg2, class Res>
struct Functor2 : public Common::BinaryFunction<Arg1, Arg2, Res> {
struct Functor2 : public BinaryFunction<Arg1, Arg2, Res> {
virtual ~Functor2() {}
virtual bool isValid() const = 0;

View File

@ -66,9 +66,9 @@ private:
Symbol(uint32 c, uint32 s);
};
typedef Common::List<Symbol> CodeList;
typedef Common::Array<CodeList> CodeLists;
typedef Common::Array<Symbol *> SymbolList;
typedef List<Symbol> CodeList;
typedef Array<CodeList> CodeLists;
typedef Array<Symbol*> SymbolList;
/** Lists of codes and their symbols, sorted by code length. */
CodeLists _codes;

View File

@ -25,7 +25,7 @@
namespace Common {
IFFParser::IFFParser(Common::ReadStream *stream, bool disposeStream) : _stream(stream), _disposeStream(disposeStream) {
IFFParser::IFFParser(ReadStream *stream, bool disposeStream) : _stream(stream), _disposeStream(disposeStream) {
setInputStream(stream);
}
@ -36,7 +36,7 @@ IFFParser::~IFFParser() {
_stream = 0;
}
void IFFParser::setInputStream(Common::ReadStream *stream) {
void IFFParser::setInputStream(ReadStream *stream) {
assert(stream);
_formChunk.setInputStream(stream);
_chunk.setInputStream(stream);
@ -63,7 +63,7 @@ void IFFParser::parse(IFFCallback &callback) {
_chunk.readHeader();
// invoke the callback
Common::SubReadStream stream(&_chunk, _chunk.size);
SubReadStream stream(&_chunk, _chunk.size);
IFFChunk chunk(_chunk.id, _chunk.size, &stream);
stop = callback(chunk);

View File

@ -146,11 +146,11 @@ page 376) */
* Client code must *not* deallocate _stream when done.
*/
struct IFFChunk {
Common::IFF_ID _type;
uint32 _size;
Common::ReadStream *_stream;
IFF_ID _type;
uint32 _size;
ReadStream *_stream;
IFFChunk(Common::IFF_ID type, uint32 size, Common::ReadStream *stream) : _type(type), _size(size), _stream(stream) {
IFFChunk(IFF_ID type, uint32 size, ReadStream *stream) : _type(type), _size(size), _stream(stream) {
assert(_stream);
}
};
@ -163,17 +163,17 @@ class IFFParser {
/**
* This private class implements IFF chunk navigation.
*/
class IFFChunkNav : public Common::ReadStream {
class IFFChunkNav : public ReadStream {
protected:
Common::ReadStream *_input;
ReadStream *_input;
uint32 _bytesRead;
public:
Common::IFF_ID id;
IFF_ID id;
uint32 size;
IFFChunkNav() : _input(0) {
}
void setInputStream(Common::ReadStream *input) {
void setInputStream(ReadStream *input) {
_input = input;
size = _bytesRead = 0;
}
@ -199,7 +199,7 @@ class IFFParser {
readByte();
}
}
// Common::ReadStream implementation
// ReadStream implementation
bool eos() const { return _input->eos(); }
bool err() const { return _input->err(); }
void clearErr() { _input->clearErr(); }
@ -215,21 +215,21 @@ protected:
IFFChunkNav _chunk; ///< The current chunk.
uint32 _formSize;
Common::IFF_ID _formType;
IFF_ID _formType;
Common::ReadStream *_stream;
ReadStream *_stream;
bool _disposeStream;
void setInputStream(Common::ReadStream *stream);
void setInputStream(ReadStream *stream);
public:
IFFParser(Common::ReadStream *stream, bool disposeStream = false);
IFFParser(ReadStream *stream, bool disposeStream = false);
~IFFParser();
/**
* Callback type for the parser.
*/
typedef Common::Functor1< IFFChunk&, bool > IFFCallback;
typedef Functor1< IFFChunk&, bool > IFFCallback;
/**
* Parse the IFF container, invoking the callback on each chunk encountered.

View File

@ -185,12 +185,12 @@ public:
}
template<class T2>
bool operator==(const Common::SharedPtr<T2> &r) const {
bool operator==(const SharedPtr<T2> &r) const {
return _pointer == r.get();
}
template<class T2>
bool operator!=(const Common::SharedPtr<T2> &r) const {
bool operator!=(const SharedPtr<T2> &r) const {
return _pointer != r.get();
}

View File

@ -48,7 +48,7 @@ QuickTimeParser::QuickTimeParser() {
_fd = 0;
_scaleFactorX = 1;
_scaleFactorY = 1;
_resFork = new Common::MacResManager();
_resFork = new MacResManager();
_disposeFileHandle = DisposeAfterUse::YES;
initParseTable();
@ -59,7 +59,7 @@ QuickTimeParser::~QuickTimeParser() {
delete _resFork;
}
bool QuickTimeParser::parseFile(const Common::String &filename) {
bool QuickTimeParser::parseFile(const String &filename) {
if (!_resFork->open(filename) || !_resFork->hasDataFork())
return false;
@ -70,7 +70,7 @@ bool QuickTimeParser::parseFile(const Common::String &filename) {
if (_resFork->hasResFork()) {
// Search for a 'moov' resource
Common::MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m', 'o', 'o', 'v'));
MacResIDArray idArray = _resFork->getResIDArray(MKTAG('m', 'o', 'o', 'v'));
if (!idArray.empty())
_fd = _resFork->getResource(MKTAG('m', 'o', 'o', 'v'), idArray[0]);
@ -96,7 +96,7 @@ bool QuickTimeParser::parseFile(const Common::String &filename) {
return true;
}
bool QuickTimeParser::parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) {
bool QuickTimeParser::parseStream(SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle) {
_fd = stream;
_foundMOOV = false;
_disposeFileHandle = disposeFileHandle;
@ -274,7 +274,7 @@ int QuickTimeParser::readCMOV(Atom atom) {
// Uncompress the data
unsigned long dstLen = uncompressedSize;
if (!Common::uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) {
if (!uncompress(uncompressedData, &dstLen, compressedData, compressedSize)) {
warning ("Could not uncompress cmov chunk");
free(compressedData);
free(uncompressedData);
@ -282,8 +282,8 @@ int QuickTimeParser::readCMOV(Atom atom) {
}
// Load data into a new MemoryReadStream and assign _fd to be that
Common::SeekableReadStream *oldStream = _fd;
_fd = new Common::MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES);
SeekableReadStream *oldStream = _fd;
_fd = new MemoryReadStream(uncompressedData, uncompressedSize, DisposeAfterUse::YES);
// Read the contents of the uncompressed data
Atom a = { MKTAG('m', 'o', 'o', 'v'), 0, uncompressedSize };
@ -333,8 +333,8 @@ int QuickTimeParser::readMVHD(Atom atom) {
uint32 yMod = _fd->readUint32BE();
_fd->skip(16);
_scaleFactorX = Common::Rational(0x10000, xMod);
_scaleFactorY = Common::Rational(0x10000, yMod);
_scaleFactorX = Rational(0x10000, xMod);
_scaleFactorY = Rational(0x10000, yMod);
_scaleFactorX.debugPrint(1, "readMVHD(): scaleFactorX =");
_scaleFactorY.debugPrint(1, "readMVHD(): scaleFactorY =");
@ -403,8 +403,8 @@ int QuickTimeParser::readTKHD(Atom atom) {
uint32 yMod = _fd->readUint32BE();
_fd->skip(16);
track->scaleFactorX = Common::Rational(0x10000, xMod);
track->scaleFactorY = Common::Rational(0x10000, yMod);
track->scaleFactorX = Rational(0x10000, xMod);
track->scaleFactorY = Rational(0x10000, yMod);
track->scaleFactorX.debugPrint(1, "readTKHD(): scaleFactorX =");
track->scaleFactorY.debugPrint(1, "readTKHD(): scaleFactorY =");
@ -431,7 +431,7 @@ int QuickTimeParser::readELST(Atom atom) {
for (uint32 i = 0; i < track->editCount; i++){
track->editList[i].trackDuration = _fd->readUint32BE();
track->editList[i].mediaTime = _fd->readSint32BE();
track->editList[i].mediaRate = Common::Rational(_fd->readUint32BE(), 0x10000);
track->editList[i].mediaRate = Rational(_fd->readUint32BE(), 0x10000);
debugN(3, "\tDuration = %d, Media Time = %d, ", track->editList[i].trackDuration, track->editList[i].mediaTime);
track->editList[i].mediaRate.debugPrint(3, "Media Rate =");
}
@ -695,7 +695,7 @@ enum {
kMP4DecSpecificDescTag = 5
};
static int readMP4DescLength(Common::SeekableReadStream *stream) {
static int readMP4DescLength(SeekableReadStream *stream) {
int length = 0;
int count = 4;
@ -710,7 +710,7 @@ static int readMP4DescLength(Common::SeekableReadStream *stream) {
return length;
}
static void readMP4Desc(Common::SeekableReadStream *stream, byte &tag, int &length) {
static void readMP4Desc(SeekableReadStream *stream, byte &tag, int &length) {
tag = stream->readByte();
length = readMP4DescLength(stream);
}

View File

@ -56,14 +56,14 @@ public:
* Load a QuickTime file
* @param filename the filename to load
*/
bool parseFile(const Common::String &filename);
bool parseFile(const String &filename);
/**
* Load a QuickTime file from a SeekableReadStream
* @param stream the stream to load
* @param disposeFileHandle whether to delete the stream after use
*/
bool parseStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle = DisposeAfterUse::YES);
bool parseStream(SeekableReadStream *stream, DisposeAfterUse::Flag disposeFileHandle = DisposeAfterUse::YES);
/**
* Close a QuickTime file
@ -81,7 +81,7 @@ public:
protected:
// This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream.
Common::SeekableReadStream *_fd;
SeekableReadStream *_fd;
DisposeAfterUse::Flag _disposeFileHandle;
@ -110,7 +110,7 @@ protected:
struct EditListEntry {
uint32 trackDuration;
int32 mediaTime;
Common::Rational mediaRate;
Rational mediaRate;
};
struct Track;
@ -154,18 +154,18 @@ protected:
uint16 height;
CodecType codecType;
Common::Array<SampleDesc *> sampleDescs;
Array<SampleDesc*> sampleDescs;
uint32 editCount;
EditListEntry *editList;
Common::SeekableReadStream *extraData;
SeekableReadStream *extraData;
uint32 frameCount;
uint32 duration;
uint32 startTime;
Common::Rational scaleFactorX;
Common::Rational scaleFactorY;
Rational scaleFactorX;
Rational scaleFactorY;
byte objectTypeMP4;
};
@ -176,11 +176,11 @@ protected:
bool _foundMOOV;
uint32 _timeScale;
uint32 _duration;
Common::Rational _scaleFactorX;
Common::Rational _scaleFactorY;
Common::Array<Track *> _tracks;
Rational _scaleFactorX;
Rational _scaleFactorY;
Array<Track*> _tracks;
uint32 _beginOffset;
Common::MacResManager *_resFork;
MacResManager *_resFork;
void initParseTable();
void init();

View File

@ -107,8 +107,8 @@ Rational &Rational::operator-=(const Rational &right) {
Rational &Rational::operator*=(const Rational &right) {
// Cross-cancel to avoid unnecessary overflow;
// the result then is automatically normalized
const int gcd1 = Common::gcd(_num, right._denom);
const int gcd2 = Common::gcd(right._num, _denom);
const int gcd1 = gcd(_num, right._denom);
const int gcd2 = gcd(right._num, _denom);
_num = (_num / gcd1) * (right._num / gcd2);
_denom = (_denom / gcd2) * (right._denom / gcd1);

View File

@ -68,15 +68,15 @@ public:
static const Version kLastVersion = 0xFFFFFFFF;
protected:
Common::SeekableReadStream *_loadStream;
Common::WriteStream *_saveStream;
SeekableReadStream *_loadStream;
WriteStream *_saveStream;
uint _bytesSynced;
Version _version;
public:
Serializer(Common::SeekableReadStream *in, Common::WriteStream *out)
Serializer(SeekableReadStream *in, WriteStream *out)
: _loadStream(in), _saveStream(out), _bytesSynced(0), _version(0) {
assert(in || out);
}
@ -214,7 +214,7 @@ public:
* Sync a C-string, by treating it as a zero-terminated byte sequence.
* @todo Replace this method with a special Syncer class for Common::String
*/
void syncString(Common::String &str, Version minVersion = 0, Version maxVersion = kLastVersion) {
void syncString(String &str, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
return; // Ignore anything which is not supposed to be present in this save game version

View File

@ -219,14 +219,14 @@ public:
* except that it stores the result in (variably sized) String
* instead of a fixed size buffer.
*/
static Common::String format(const char *fmt, ...) GCC_PRINTF(1,2);
static String format(const char *fmt, ...) GCC_PRINTF(1,2);
/**
* Print formatted data into a String object. Similar to vsprintf,
* except that it stores the result in (variably sized) String
* instead of a fixed size buffer.
*/
static Common::String vformat(const char *fmt, va_list args);
static String vformat(const char *fmt, va_list args);
public:
typedef char * iterator;
@ -293,7 +293,7 @@ extern char *trim(char *t);
* @param sep character used to separate path components
* @return The last component of the path.
*/
Common::String lastPathComponent(const Common::String &path, const char sep);
String lastPathComponent(const String &path, const char sep);
/**
* Normalize a given path to a canonical form. In particular:
@ -307,7 +307,7 @@ Common::String lastPathComponent(const Common::String &path, const char sep);
* @param sep the separator token (usually '/' on Unix-style systems, or '\\' on Windows based stuff)
* @return the normalized path
*/
Common::String normalizePath(const Common::String &path, const char sep);
String normalizePath(const String &path, const char sep);
/**

View File

@ -293,8 +293,8 @@ ArjHeader *readHeader(SeekableReadStream &stream) {
return NULL;
}
Common::strlcpy(header.filename, (const char *)&headData[header.firstHdrSize], ARJ_FILENAME_MAX);
Common::strlcpy(header.comment, (const char *)&headData[header.firstHdrSize + strlen(header.filename) + 1], ARJ_COMMENT_MAX);
strlcpy(header.filename, (const char *)&headData[header.firstHdrSize], ARJ_FILENAME_MAX);
strlcpy(header.comment, (const char *)&headData[header.firstHdrSize + strlen(header.filename) + 1], ARJ_COMMENT_MAX);
// Process extended headers, if any
uint16 extHeaderSize;
@ -692,15 +692,15 @@ void ArjDecoder::decode_f(int32 origsize) {
typedef HashMap<String, ArjHeader*, IgnoreCase_Hash, IgnoreCase_EqualTo> ArjHeadersMap;
class ArjArchive : public Common::Archive {
class ArjArchive : public Archive {
ArjHeadersMap _headers;
Common::String _arjFilename;
String _arjFilename;
public:
ArjArchive(const String &name);
virtual ~ArjArchive();
// Common::Archive implementation
// Archive implementation
virtual bool hasFile(const String &name);
virtual int listMembers(ArchiveMemberList &list);
virtual ArchiveMemberPtr getMember(const String &name);
@ -708,7 +708,7 @@ public:
};
ArjArchive::ArjArchive(const String &filename) : _arjFilename(filename) {
Common::File arjFile;
File arjFile;
if (!arjFile.open(_arjFilename)) {
warning("ArjArchive::ArjArchive(): Could not find the archive file");
@ -775,7 +775,7 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
ArjHeader *hdr = _headers[name];
Common::File archiveFile;
File archiveFile;
archiveFile.open(_arjFilename);
archiveFile.seek(hdr->pos, SEEK_SET);
@ -794,8 +794,8 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
// If reading from archiveFile directly is too slow to be usable,
// maybe the filesystem code should instead wrap its files
// in a BufferedReadStream.
decoder->_compressed = Common::wrapBufferedReadStream(&archiveFile, 4096, DisposeAfterUse::NO);
decoder->_outstream = new Common::MemoryWriteStream(uncompressedData, hdr->origSize);
decoder->_compressed = wrapBufferedReadStream(&archiveFile, 4096, DisposeAfterUse::NO);
decoder->_outstream = new MemoryWriteStream(uncompressedData, hdr->origSize);
if (hdr->method == 1 || hdr->method == 2 || hdr->method == 3)
decoder->decode(hdr->origSize);
@ -805,7 +805,7 @@ SeekableReadStream *ArjArchive::createReadStreamForMember(const String &name) co
delete decoder;
}
return new Common::MemoryReadStream(uncompressedData, hdr->origSize, DisposeAfterUse::YES);
return new MemoryReadStream(uncompressedData, hdr->origSize, DisposeAfterUse::YES);
}
Archive *makeArjArchive(const String &name) {

View File

@ -1458,11 +1458,11 @@ ZipArchive::~ZipArchive() {
unzClose(_zipFile);
}
bool ZipArchive::hasFile(const Common::String &name) {
bool ZipArchive::hasFile(const String &name) {
return (unzLocateFile(_zipFile, name.c_str(), 2) == UNZ_OK);
}
int ZipArchive::listMembers(Common::ArchiveMemberList &list) {
int ZipArchive::listMembers(ArchiveMemberList &list) {
int matches = 0;
int err = unzGoToFirstFile(_zipFile);
@ -1488,7 +1488,7 @@ ArchiveMemberPtr ZipArchive::getMember(const String &name) {
return ArchiveMemberPtr(new GenericArchiveMember(name, this));
}
Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::String &name) const {
SeekableReadStream *ZipArchive::createReadStreamForMember(const String &name) const {
if (unzLocateFile(_zipFile, name.c_str(), 2) != UNZ_OK)
return 0;
@ -1512,7 +1512,7 @@ Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::
return 0;
}
return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size, DisposeAfterUse::YES);
return new MemoryReadStream(buffer, fileInfo.uncompressed_size, DisposeAfterUse::YES);
// FIXME: instead of reading all into a memory stream, we could
// instead create a new ZipStream class. But then we have to be

View File

@ -82,7 +82,7 @@ void hexdump(const byte *data, int len, int bytesPerLine, int startOffset) {
#pragma mark -
bool parseBool(const Common::String &val, bool &valAsBool) {
bool parseBool(const String &val, bool &valAsBool) {
if (val.equalsIgnoreCase("true") ||
val.equalsIgnoreCase("yes") ||
val.equals("1")) {

View File

@ -96,7 +96,7 @@ extern void hexdump(const byte * data, int len, int bytesPerLine = 16, int start
* @param[out] valAsBool the parsing result
* @return true if the string parsed correctly, false if an error occurred.
*/
bool parseBool(const Common::String &val, bool &valAsBool);
bool parseBool(const String &val, bool &valAsBool);
/**
* List of game language.
@ -131,7 +131,7 @@ struct LanguageDescription {
const char *code;
//const char *unixLocale;
const char *description;
Common::Language id;
Language id;
};
extern const LanguageDescription g_languages[];
@ -182,7 +182,7 @@ struct PlatformDescription {
const char *code2;
const char *abbrev;
const char *description;
Common::Platform id;
Platform id;
};
extern const PlatformDescription g_platforms[];
@ -211,7 +211,7 @@ enum RenderMode {
struct RenderModeDescription {
const char *code;
const char *description;
Common::RenderMode id;
RenderMode id;
};
extern const RenderModeDescription g_renderModes[];

View File

@ -133,7 +133,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
_exe->seek(section.offset + (value & 0x7fffffff));
// Read in the name, truncating from unicode to ascii
Common::String name;
String name;
uint16 nameLength = _exe->readUint16LE();
while (nameLength--)
name += (char)(_exe->readUint16LE() & 0xff);

View File

@ -81,7 +81,7 @@ void XMLParser::close() {
_stream = 0;
}
bool XMLParser::parserError(const Common::String &errStr) {
bool XMLParser::parserError(const String &errStr) {
_state = kParserError;
const int startPosition = _stream->pos();

View File

@ -275,7 +275,7 @@ protected:
* Parser error always returns "false" so we can pass the return value
* directly and break down the parsing.
*/
bool parserError(const Common::String &errStr);
bool parserError(const String &errStr);
/**
* Skips spaces/whitelines etc.

View File

@ -54,7 +54,7 @@ bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long
* other SeekableReadStream and will then provide on-the-fly decompression support.
* Assumes the compressed data to be in gzip format.
*/
class GZipReadStream : public Common::SeekableReadStream {
class GZipReadStream : public SeekableReadStream {
protected:
enum {
BUFSIZE = 16384 // 1 << MAX_WBITS
@ -71,7 +71,7 @@ protected:
public:
GZipReadStream(Common::SeekableReadStream *w) : _wrapped(w), _stream() {
GZipReadStream(SeekableReadStream *w) : _wrapped(w), _stream() {
assert(w != 0);
// Verify file header is correct
@ -197,7 +197,7 @@ public:
* other WriteStream and will then provide on-the-fly compression support.
* The compressed data is written in the gzip format.
*/
class GZipWriteStream : public Common::WriteStream {
class GZipWriteStream : public WriteStream {
protected:
enum {
BUFSIZE = 16384 // 1 << MAX_WBITS
@ -224,7 +224,7 @@ protected:
}
public:
GZipWriteStream(Common::WriteStream *w) : _wrapped(w), _stream() {
GZipWriteStream(WriteStream *w) : _wrapped(w), _stream() {
assert(w != 0);
// Adding 16 to windowBits indicates to zlib that it is supposed to
@ -300,7 +300,7 @@ public:
#endif // USE_ZLIB
Common::SeekableReadStream *wrapCompressedReadStream(Common::SeekableReadStream *toBeWrapped) {
SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped) {
#if defined(USE_ZLIB)
if (toBeWrapped) {
uint16 header = toBeWrapped->readUint16BE();
@ -315,7 +315,7 @@ Common::SeekableReadStream *wrapCompressedReadStream(Common::SeekableReadStream
return toBeWrapped;
}
Common::WriteStream *wrapCompressedWriteStream(Common::WriteStream *toBeWrapped) {
WriteStream *wrapCompressedWriteStream(WriteStream *toBeWrapped) {
#if defined(USE_ZLIB)
if (toBeWrapped)
return new GZipWriteStream(toBeWrapped);