MSVC warning fixes

This was SVN commit r7583.
This commit is contained in:
Ykkrosh 2010-05-25 19:12:00 +00:00
parent 01bec7a454
commit 1e40c8c776
4 changed files with 2 additions and 25 deletions

View File

@ -72,17 +72,7 @@ namespace I18n
bool LookupProperty(const LookupType* data, const Str& property, Str& result);
// Disable the "'this' used in base member initializer list" warning: only the
// pointer (and not the data it points to) is accessed by ScriptObject's
// constructor, so it shouldn't cause any problems.
#if MSC_VERSION
# pragma warning (disable: 4355)
#endif
CLocale(JSContext* context, JSObject* scope) : CacheAge(0), Script(this, context, scope) {}
#if MSC_VERSION
# pragma warning (default: 4355)
#endif
~CLocale();
void AddToCache(StringBuffer*, Str&);

View File

@ -53,6 +53,7 @@
# pragma warning(disable:4996) // function is deprecated
# pragma warning(disable:4786) // identifier truncated to 255 chars
# pragma warning(disable:4351) // yes, default init of array entries is desired
# pragma warning(disable:4355) // 'this' used in base member initializer list
// .. disabled only for the precompiled headers
# pragma warning(disable:4702) // unreachable code (frequent in STL)
// .. VS2005 code analysis (very frequent ones)

View File

@ -50,17 +50,6 @@ extern bool g_GameRestarted;
**/
CGame *g_Game=NULL;
// Disable "warning C4355: 'this' : used in base member initializer list".
// "The base-class constructors and class member constructors are called before
// this constructor. In effect, you've passed a pointer to an unconstructed
// object to another constructor. If those other constructors access any
// members or call member functions on this, the result will be undefined."
// In this case, the pointers are simply stored for later use, so there
// should be no problem.
#if MSC_VERSION
# pragma warning (disable: 4355)
#endif
/**
* Constructor
*
@ -87,10 +76,6 @@ CGame::CGame():
m_Simulation2->InitGame(initData);
}
#if MSC_VERSION
# pragma warning (default: 4355)
#endif
/**
* Destructor
*

View File

@ -22,6 +22,7 @@
class CStdSerializerImpl
{
NONCOPYABLE(CStdSerializerImpl);
public:
CStdSerializerImpl(std::ostream& stream);