diff options
author | Nicola Mettifogo | 2007-09-19 08:40:12 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-09-19 08:40:12 +0000 |
commit | 258901bab96f0050385a9912c8ea0fe2a41b2d6f (patch) | |
tree | a3ae8675b679c9f3b58ac8d97c79369502ea23c1 /common | |
parent | a89694c0d61a75a960f5bec6c498659c988401cc (diff) | |
download | scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.tar.gz scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.tar.bz2 scummvm-rg350-258901bab96f0050385a9912c8ea0fe2a41b2d6f.zip |
Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
svn-id: r28966
Diffstat (limited to 'common')
-rw-r--r-- | common/advancedDetector.cpp | 6 | ||||
-rw-r--r-- | common/array.h | 1 | ||||
-rw-r--r-- | common/config-file.cpp | 4 | ||||
-rw-r--r-- | common/config-manager.cpp | 2 | ||||
-rw-r--r-- | common/file.h | 3 | ||||
-rw-r--r-- | common/fs.cpp | 37 | ||||
-rw-r--r-- | common/hashmap.h | 71 | ||||
-rw-r--r-- | common/iff_container.h | 1 | ||||
-rw-r--r-- | common/mutex.cpp | 1 | ||||
-rw-r--r-- | common/savefile.h | 21 | ||||
-rw-r--r-- | common/scummsys.h | 117 | ||||
-rw-r--r-- | common/stdafx.h | 122 | ||||
-rw-r--r-- | common/str.cpp | 18 | ||||
-rw-r--r-- | common/stream.cpp | 1 | ||||
-rw-r--r-- | common/stream.h | 3 | ||||
-rw-r--r-- | common/system.cpp | 4 | ||||
-rw-r--r-- | common/unzip.cpp | 1 | ||||
-rw-r--r-- | common/unzip.h | 1 | ||||
-rw-r--r-- | common/util.cpp | 3 |
19 files changed, 182 insertions, 235 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index f3e8671025..1a3ae13a9e 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -23,8 +23,6 @@ * */ -#include "common/stdafx.h" - #include "base/plugins.h" #include "common/util.h" @@ -316,7 +314,7 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p File testFile; String tstr; - + uint i; char md5str[32+1]; @@ -458,7 +456,7 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p } } - // We've found a match + // We've found a match if (!matched.empty()) return matched; diff --git a/common/array.h b/common/array.h index 6f16663e67..af9ec811da 100644 --- a/common/array.h +++ b/common/array.h @@ -25,7 +25,6 @@ #ifndef COMMON_ARRAY_H #define COMMON_ARRAY_H -#include "common/stdafx.h" #include "common/scummsys.h" #include "common/algorithm.h" diff --git a/common/config-file.cpp b/common/config-file.cpp index c89c169b44..fe827e32dc 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -23,8 +23,6 @@ * */ -#include "common/stdafx.h" - #include "common/config-file.h" #include "common/file.h" #include "common/savefile.h" @@ -106,7 +104,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { // It would be nice if this hack could be restricted to that game, // but the current design of this class doesn't allow to do that // in a nice fashion (a "isMustard" parameter is *not* a nice - // solution). + // solution). comment += buf; comment += "\n"; } else if (buf[0] == '[') { diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 5c0cd7c40f..da31161919 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -29,8 +29,6 @@ #undef ARRAYSIZE #endif -#include "common/stdafx.h" - #include "common/config-manager.h" #include "common/file.h" #include "common/util.h" diff --git a/common/file.h b/common/file.h index 416ca75ec7..4bec6605e7 100644 --- a/common/file.h +++ b/common/file.h @@ -26,7 +26,6 @@ #ifndef COMMON_FILE_H #define COMMON_FILE_H -#include "common/stdafx.h" #include "common/scummsys.h" #include "common/str.h" #include "common/stream.h" @@ -88,7 +87,7 @@ public: virtual bool remove(const String &filename); virtual bool remove(const FilesystemNode &node); - + /** * Checks if the object opened a file successfully. * diff --git a/common/fs.cpp b/common/fs.cpp index d395686be3..7d7aa363fc 100644 --- a/common/fs.cpp +++ b/common/fs.cpp @@ -22,7 +22,6 @@ * $Id$ */ -#include "common/stdafx.h" #include "common/util.h" #include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs-factory.h" @@ -34,7 +33,7 @@ static bool matchString(const char *str, const char *pat) { const char *p = 0; const char *q = 0; - + for (;;) { switch (*pat) { case '*': @@ -83,7 +82,7 @@ FilesystemNode::FilesystemNode(const FilesystemNode &node) { FilesystemNode::FilesystemNode(const Common::String &p) { AbstractFilesystemFactory *factory = AbstractFilesystemFactory::makeFSFactory(); - + if (p.empty() || p == ".") _realNode = factory->makeCurrentDirectoryFileNode(); else @@ -113,7 +112,7 @@ bool FilesystemNode::operator<(const FilesystemNode& node) const return true; if (!isDirectory() && node.isDirectory()) return false; - + return scumm_stricmp(getDisplayName().c_str(), node.getDisplayName().c_str()) < 0; } @@ -131,7 +130,7 @@ void FilesystemNode::decRefCount() { bool FilesystemNode::exists() const { if (_realNode == 0) return false; - + return _realNode->exists(); } @@ -149,15 +148,15 @@ bool FilesystemNode::getChildren(FSList &fslist, ListMode mode, bool hidden) con return false; AbstractFSList tmp; - + if (!_realNode->getChildren(tmp, mode, hidden)) return false; - + fslist.clear(); for (AbstractFSList::iterator i = tmp.begin(); i != tmp.end(); ++i) { fslist.push_back(FilesystemNode(*i)); } - + return true; } @@ -191,28 +190,28 @@ Common::String FilesystemNode::getPath() const { bool FilesystemNode::isDirectory() const { if (_realNode == 0) return false; - + return _realNode->isDirectory(); } bool FilesystemNode::isReadable() const { if (_realNode == 0) return false; - + return _realNode->isReadable(); } bool FilesystemNode::isWritable() const { if (_realNode == 0) return false; - + return _realNode->isWritable(); } bool FilesystemNode::lookupFile(FSList &results, FSList &fslist, Common::String &filename, bool hidden, bool exhaustive) const { int matches = 0; - + for (FSList::iterator entry = fslist.begin(); entry != fslist.end(); ++entry) { if (entry->isDirectory()) { matches += lookupFileRec(results, *entry, filename, hidden, exhaustive); @@ -225,12 +224,12 @@ bool FilesystemNode::lookupFile(FSList &results, FSList &fslist, Common::String bool FilesystemNode::lookupFile(FSList &results, FilesystemNode &dir, Common::String &filename, bool hidden, bool exhaustive) const { int matches; - + if (!dir.isDirectory()) return false; - + matches = lookupFileRec(results, dir, filename, hidden, exhaustive); - + return ((matches > 0) ? true : false); } @@ -243,7 +242,7 @@ int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common:: FSList children; int matches = 0; dir.getChildren(entries, FilesystemNode::kListAll, hidden); - + //Breadth search (entries in the same level) for (FSList::iterator entry = entries.begin(); entry != entries.end(); ++entry) { if (entry->isDirectory()) { @@ -255,17 +254,17 @@ int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common:: if (matchString(lastPathComponent(entry->getPath()), filename.c_str())) { results.push_back(*entry); matches++; - + if (!exhaustive) break; } } } - + //Depth search (entries in lower levels) for (FSList::iterator child = children.begin(); child != children.end(); ++child) { matches += lookupFileRec(results, *child, filename, hidden, exhaustive); } - + return matches; } diff --git a/common/hashmap.h b/common/hashmap.h index 28ba022e70..a4e7d6ab60 100644 --- a/common/hashmap.h +++ b/common/hashmap.h @@ -26,40 +26,39 @@ // The hash map (associative array) implementation in this file is // based on code by Andrew Y. Ng, 1996: -/* - * Copyright (c) 1998-2003 Massachusetts Institute of Technology. - * This code was developed as part of the Haystack research project - * (http://haystack.lcs.mit.edu/). Permission is hereby granted, - * free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. +/* + * Copyright (c) 1998-2003 Massachusetts Institute of Technology. + * This code was developed as part of the Haystack research project + * (http://haystack.lcs.mit.edu/). Permission is hereby granted, + * free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef COMMON_HASHMAP_H #define COMMON_HASHMAP_H -#include "common/stdafx.h" #include "common/func.h" #include "common/str.h" #include "common/util.h" -namespace Common { +namespace Common { // The table sizes ideally are primes. We use a helper function to find // suitable table sizes. @@ -83,7 +82,7 @@ uint nextTableSize(uint x); * referenced, for a new key. If the object is const, then an assertion is * triggered instead. Hence if you are not sure whether a key is contained in * the map, use contains() first to check for its presence. - */ + */ template <class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> > class HashMap { friend class const_iterator; @@ -102,13 +101,13 @@ public: Node **_arr; // hashtable of size arrsize. uint _arrsize, _nele; - + HashFunc _hash; EqualFunc _equal; - + // Default value, returned by the const getVal. const Val _defaultVal; - + #ifdef DEBUG_HASH_COLLISIONS mutable int _collisions, _lookups; #endif @@ -148,11 +147,11 @@ public: } while (_idx < _hashmap->_arrsize && _hashmap->_arr[_idx] == 0); if (_idx >= _hashmap->_arrsize) _idx = (uint)-1; - + return *this; } }; - + HashMap(); HashMap(const HM_t& map); ~HashMap(); @@ -195,14 +194,14 @@ public: const_iterator end() const { return const_iterator((uint)-1, this); } - + const_iterator find(const Key &key) const { uint ctr = lookup(key); if (_arr[ctr]) return const_iterator(ctr, this); return end(); } - + // TODO: insert() method? bool empty() const { @@ -225,7 +224,7 @@ HashMap<Key, Val, HashFunc, EqualFunc>::HashMap() memset(_arr, 0, _arrsize * sizeof(Node *)); _nele = 0; - + #ifdef DEBUG_HASH_COLLISIONS _collisions = 0; _lookups = 0; @@ -312,7 +311,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::expand_array(uint newsize) { const uint old_arrsize = _arrsize; Node **old_arr = _arr; - // allocate a new array + // allocate a new array _nele = 0; _arrsize = newsize; _arr = new Node *[_arrsize]; @@ -357,7 +356,7 @@ int HashMap<Key, Val, HashFunc, EqualFunc>::lookup(const Key &key) const { _collisions++; #endif } - + #ifdef DEBUG_HASH_COLLISIONS _lookups++; fprintf(stderr, "collisions %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d\n", diff --git a/common/iff_container.h b/common/iff_container.h index cc55970591..10175d42e9 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -25,7 +25,6 @@ #ifndef COMMON_IFF_CONTAINER_H #define COMMON_IFF_CONTAINER_H -#include "common/stdafx.h" #include "common/scummsys.h" #include "common/endian.h" #include "common/stream.h" diff --git a/common/mutex.cpp b/common/mutex.cpp index 693b14db2f..7a2601477d 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -23,7 +23,6 @@ * */ -#include "common/stdafx.h" #include "common/mutex.h" #include "common/system.h" diff --git a/common/savefile.h b/common/savefile.h index 9fdd76ae15..31a9d98a19 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -26,7 +26,6 @@ #ifndef COMMON_SAVEFILE_H #define COMMON_SAVEFILE_H -#include "common/stdafx.h" #include "common/noncopyable.h" #include "common/scummsys.h" #include "common/stream.h" @@ -77,40 +76,40 @@ public: * returning the single SaveFileManager instances to be used. */ class SaveFileManager : NonCopyable { - + protected: SFMError _error; String _errorDesc; - + public: virtual ~SaveFileManager() {} - + /** * Clears the last set error code and string. */ virtual void clearError() { _error = SFM_NO_ERROR; _errorDesc = ""; } - + /** * Returns the last ocurred error code. If none ocurred, returns SFM_NO_ERROR. - * + * * @return A SFMError indicating the type of the last error. */ virtual SFMError getError() { return _error; } - + /** * Returns the last ocurred error description. If none ocurred, returns 0. - * + * * @return A string describing the last error. */ virtual String getErrorDesc() { return _errorDesc; } - + /** * Sets the last ocurred error. * @param error Code identifying the last error. * @param errorDesc String describing the last error. */ virtual void setError(SFMError error, String errorDesc) { _error = error; _errorDesc = errorDesc; } - + /** * Open the file with name filename in the given directory for saving. * @param filename the filename @@ -131,7 +130,7 @@ public: * @return true if no error ocurred. false otherwise. */ virtual bool removeSavefile(const char *filename) = 0; - + /** * Request a list of available savegames with a given regex. * @param regex Regular expression to match. Wildcards like * or ? are available. diff --git a/common/scummsys.h b/common/scummsys.h index 25c5c166e3..46ead5f29a 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -26,10 +26,101 @@ #ifndef COMMON_SCUMMSYS_H #define COMMON_SCUMMSYS_H -#if !defined(COMMON_STDAFX_H) && !defined(__PLAYSTATION2__) -#error Included scummsys.h without including stdafx.h first! +#if defined(_WIN32_WCE) && _WIN32_WCE < 300 + #define NONSTANDARD_PORT #endif +#if defined(NONSTANDARD_PORT) + + // Ports which need to perform #includes and #defines visible in + // virtually all the source of ScummVM should do so by providing a + // "portdefs.h" header file (and not by directly modifying this + // header file). + #include <portdefs.h> + +#else // defined(NONSTANDARD_PORT) + + #if defined(WIN32) + + #ifdef _MSC_VER + #pragma once + #pragma warning( disable : 4068 ) // turn off "unknown pragma" warning + #pragma warning( disable : 4100 ) // turn off "unreferenced formal parameter" warning + #pragma warning( disable : 4127 ) // turn off "conditional expression is constant" warning + #pragma warning( disable : 4201 ) // turn off "nonstandard extension used : nameless struct/union" warning + #pragma warning( disable : 4244 ) // turn off "conversion type" warning + #pragma warning( disable : 4310 ) // turn off "cast truncates constant value" warning + #pragma warning( disable : 4355 ) // turn off "base member init" warning + #pragma warning( disable : 4390 ) // turn off "empty statement" warning for BS2 code + #pragma warning( disable : 4250 ) // turn off "inherits via dominance" warning + #pragma warning( disable : 4103 ) // turn off "alignement changed after including header" warning. We use pack-start.h file + #pragma warning( disable : 4121 ) // turn off "alignment of a member was sensitive to packing" warning + #pragma warning( disable : 4511 ) // turn off "copy constructor could not be generated" warning + #pragma warning( disable : 4512 ) // turn off "assignment operator could not be generated" warning + #pragma warning( disable : 4351 ) // turn off "new behavior ... will be default initialized" warning + #pragma warning( disable : 4505 ) // turn off "unreferenced local function has been removed" + #pragma warning( disable : 4510 ) // turn off "default constructor could not be generated" + #pragma warning( disable : 4610 ) // turn off "struct can never be instantiated - user defined constructor required" + + // FIXME: 4702 & 4706 - may be enabled + #pragma warning( disable : 4702 ) // turn off "unreachable code" warning + #pragma warning( disable : 4706 ) // turn off "assignment within conditional expression" warning + + #define vsnprintf _vsnprintf + #endif + + #if !defined(_WIN32_WCE) + + #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + #define NOGDICAPMASKS + #define OEMRESOURCE + #define NONLS + #define NOICONS + #define NOMCX + #define NOPROFILER + #define NOKANJI + #define NOSERVICE + #define NOMETAFILE + #define NOCOMM + #define NOCRYPT + #define NOIME + #define NOATOM + #define NOCTLMGR + #define NOCLIPBOARD + #define NOMEMMGR + #define NOSYSMETRICS + #define NOMENUS + #define NOOPENFILE + #define NOWH + #define NOSOUND + #define NODRAWTEXT + + #endif + + #if defined(ARRAYSIZE) + // VS2005beta2 introduces new stuff in winnt.h + #undef ARRAYSIZE + #endif + + #endif + + #if defined(__QNXNTO__) + #include <strings.h> /* For strcasecmp */ + #endif + + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <stdarg.h> + #include <assert.h> + #include <ctype.h> + #include <time.h> + #include <math.h> + +#endif + + + // Use config.h, generated by configure #if defined(HAVE_CONFIG_H) #include "config.h" @@ -71,7 +162,7 @@ // // By default we try to use pragma push/pop to ensure various structs we use -// are "packed". If your compiler doesn't support this pragma, you are in for +// are "packed". If your compiler doesn't support this pragma, you are in for // a problem. If you are lucky, there is a compiler switch, or another pragma, // doing the same thing -- in that case, try to modify common/pack-begin.h and // common/pack-end.h accordingly. Or maybe your port simply *always* packs @@ -88,7 +179,7 @@ #define scumm_stricmp strcasecmp #define scumm_strnicmp strncasecmp - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define SCUMM_NEED_ALIGNMENT #define SMALL_SCREEN_DEVICE @@ -172,14 +263,14 @@ #ifndef CONFIG_H #ifdef X11_BACKEND - + // You need to set this manually if necessary // #define SCUMM_LITTLE_ENDIAN - + #else /* need this for the SDL_BYTEORDER define */ #include <SDL_byteorder.h> - + #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define SCUMM_LITTLE_ENDIAN #elif SDL_BYTEORDER == SDL_BIG_ENDIAN @@ -208,7 +299,7 @@ #define SCUMM_NEED_ALIGNMENT #define STRINGBUFLEN 256 - + extern const char *SCUMMVM_SAVEPATH; #if !defined(COMPILE_ZODIAC) && !defined(COMPILE_OS5) @@ -238,7 +329,7 @@ #define scumm_stricmp stricmp #define scumm_strnicmp strnicmp - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define SCUMM_NEED_ALIGNMENT // Override typenames. uint is already defined by system header files. @@ -259,7 +350,7 @@ #define scumm_stricmp strcasecmp #define scumm_strnicmp strncasecmp - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define SCUMM_NEED_ALIGNMENT #elif defined(__PSP__) @@ -284,7 +375,7 @@ #define scumm_strnicmp strnicmp #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #include "nds/jtypes.h" @@ -302,8 +393,8 @@ // GCC specific stuff // #if defined(__GNUC__) - #define NORETURN __attribute__((__noreturn__)) - #define PACKED_STRUCT __attribute__((packed)) + #define NORETURN __attribute__((__noreturn__)) + #define PACKED_STRUCT __attribute__((packed)) #define GCC_PRINTF(x,y) __attribute__((format(printf, x, y))) #else #define PACKED_STRUCT diff --git a/common/stdafx.h b/common/stdafx.h deleted file mode 100644 index 19f2bc8aef..0000000000 --- a/common/stdafx.h +++ /dev/null @@ -1,122 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef COMMON_STDAFX_H -#define COMMON_STDAFX_H - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 - #define NONSTANDARD_PORT -#endif - -#if defined(NONSTANDARD_PORT) - - // Ports which need to perform #includes and #defines visible in - // virtually all the source of ScummVM should do so by providing a - // "portdefs.h" header file (and not by directly modifying this - // header file). - #include <portdefs.h> - -#else // defined(NONSTANDARD_PORT) - - #if defined(WIN32) - - #ifdef _MSC_VER - #pragma once - #pragma warning( disable : 4068 ) // turn off "unknown pragma" warning - #pragma warning( disable : 4100 ) // turn off "unreferenced formal parameter" warning - #pragma warning( disable : 4127 ) // turn off "conditional expression is constant" warning - #pragma warning( disable : 4201 ) // turn off "nonstandard extension used : nameless struct/union" warning - #pragma warning( disable : 4244 ) // turn off "conversion type" warning - #pragma warning( disable : 4310 ) // turn off "cast truncates constant value" warning - #pragma warning( disable : 4355 ) // turn off "base member init" warning - #pragma warning( disable : 4390 ) // turn off "empty statement" warning for BS2 code - #pragma warning( disable : 4250 ) // turn off "inherits via dominance" warning - #pragma warning( disable : 4103 ) // turn off "alignement changed after including header" warning. We use pack-start.h file - #pragma warning( disable : 4121 ) // turn off "alignment of a member was sensitive to packing" warning - #pragma warning( disable : 4511 ) // turn off "copy constructor could not be generated" warning - #pragma warning( disable : 4512 ) // turn off "assignment operator could not be generated" warning - #pragma warning( disable : 4351 ) // turn off "new behavior ... will be default initialized" warning - #pragma warning( disable : 4505 ) // turn off "unreferenced local function has been removed" - #pragma warning( disable : 4510 ) // turn off "default constructor could not be generated" - #pragma warning( disable : 4610 ) // turn off "struct can never be instantiated - user defined constructor required" - - // FIXME: 4702 & 4706 - may be enabled - #pragma warning( disable : 4702 ) // turn off "unreachable code" warning - #pragma warning( disable : 4706 ) // turn off "assignment within conditional expression" warning - - #define vsnprintf _vsnprintf - #endif - - #if !defined(_WIN32_WCE) - - #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - #define NOGDICAPMASKS - #define OEMRESOURCE - #define NONLS - #define NOICONS - #define NOMCX - #define NOPROFILER - #define NOKANJI - #define NOSERVICE - #define NOMETAFILE - #define NOCOMM - #define NOCRYPT - #define NOIME - #define NOATOM - #define NOCTLMGR - #define NOCLIPBOARD - #define NOMEMMGR - #define NOSYSMETRICS - #define NOMENUS - #define NOOPENFILE - #define NOWH - #define NOSOUND - #define NODRAWTEXT - - #endif - - #if defined(ARRAYSIZE) - // VS2005beta2 introduces new stuff in winnt.h - #undef ARRAYSIZE - #endif - - #endif - - #if defined(__QNXNTO__) - #include <strings.h> /* For strcasecmp */ - #endif - - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <stdarg.h> - #include <assert.h> - #include <ctype.h> - #include <time.h> - #include <math.h> - -#endif - -#endif diff --git a/common/str.cpp b/common/str.cpp index 88aca87bb4..9d40fe8902 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -22,8 +22,6 @@ * $Id$ */ -#include "common/stdafx.h" - #include "common/str.h" #include "common/hash-str.h" #include "common/util.h" @@ -58,7 +56,7 @@ String::String(const char *str, uint32 len) if (len <= 0) len = tmp; _len = len; - + if (len >= _builtinCapacity) { // Not enough internal storage, so allocate more _extern._capacity = computeCapacity(len); @@ -66,7 +64,7 @@ String::String(const char *str, uint32 len) _str = (char *)malloc(_extern._capacity+1); assert(_str != 0); } - + // Copy the string into the storage area memcpy(_str, str, len); _str[len] = 0; @@ -89,10 +87,10 @@ String::String(const String &str) String::String(char c) : _len(0), _str(_storage) { - + _storage[0] = c; _storage[1] = 0; - + _len = (c == 0) ? 0 : 1; } @@ -145,7 +143,7 @@ String &String::operator =(const String &str) { } else { str.incRefCount(); decRefCount(_extern._refCount); - + _extern._refCount = str._extern._refCount; _extern._capacity = str._extern._capacity; _len = str._len; @@ -285,7 +283,7 @@ void String::ensureCapacity(uint32 new_len, bool keep_old) { uint32 curCapacity, newCapacity; char *newStorage; int *oldRefCount = _extern._refCount; - + if (isStorageIntern()) { isShared = false; curCapacity = _builtinCapacity - 1; @@ -293,7 +291,7 @@ void String::ensureCapacity(uint32 new_len, bool keep_old) { isShared = (oldRefCount && *oldRefCount > 1); curCapacity = _extern._capacity; } - + // Special case: If there is enough space, and we do not share // the storage, then there is nothing to do. if (!isShared && new_len <= curCapacity) @@ -341,7 +339,7 @@ void String::ensureCapacity(uint32 new_len, bool keep_old) { uint String::hash() const { return hashit(c_str()); } - + #pragma mark - bool String::operator ==(const String &x) const { diff --git a/common/stream.cpp b/common/stream.cpp index c94faf7ec0..ab9804d7b6 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -23,7 +23,6 @@ * */ -#include "common/stdafx.h" #include "common/stream.h" #include "common/str.h" #include "common/util.h" diff --git a/common/stream.h b/common/stream.h index 9b3ac5a501..d7d96f3605 100644 --- a/common/stream.h +++ b/common/stream.h @@ -26,7 +26,6 @@ #ifndef COMMON_STREAM_H #define COMMON_STREAM_H -#include "common/stdafx.h" #include "common/scummsys.h" namespace Common { @@ -273,7 +272,7 @@ public: int32 readSint32BE() { return (int32)readUint32BE(); } - + /** * Read the specified amount of data into a malloc'ed buffer * which then is wrapped into a MemoryReadStream. diff --git a/common/system.cpp b/common/system.cpp index a1bdb4cdcc..9444c692d6 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -23,8 +23,6 @@ * */ -#include "common/stdafx.h" - #include "backends/intern.h" #include "backends/events/default/default-events.h" @@ -111,7 +109,7 @@ static Common::EventManager *s_eventManager = 0; Common::EventManager *OSystem::getEventManager() { // FIXME/TODO: Eventually this method should be turned into an abstract one, - // to force backends to implement this conciously (even if they + // to force backends to implement this conciously (even if they // end up returning the default event manager anyway). if (!s_eventManager) s_eventManager = new DefaultEventManager(this); diff --git a/common/unzip.cpp b/common/unzip.cpp index 379c20dc02..6af4653c5d 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -28,7 +28,6 @@ Read unzip.h for more info */ -#include "common/stdafx.h" #include "common/scummsys.h" #ifdef USE_ZLIB diff --git a/common/unzip.h b/common/unzip.h index 0152690516..af9f738880 100644 --- a/common/unzip.h +++ b/common/unzip.h @@ -65,7 +65,6 @@ #ifndef _unz_H #define _unz_H -#include "common/stdafx.h" #include "common/scummsys.h" #ifdef USE_ZLIB diff --git a/common/util.cpp b/common/util.cpp index 389e229a78..8bf704456a 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -22,7 +22,6 @@ * $Id$ */ -#include "common/stdafx.h" #include "engines/engine.h" #include "common/util.h" #include "common/system.h" @@ -51,7 +50,7 @@ extern bool isSmartphone(void); #define stdout ((DS::fileHandle*) -1) #define stderr ((DS::fileHandle*) -2) #define stdin ((DS::fileHandle*) -3) - + void std_fprintf(FILE* handle, const char* fmt, ...); void std_fflush(FILE* handle); |