Corrected some virtual overrides, re-activated corresponding warning.

Plus some other warning corrections
This commit is contained in:
turley 2015-12-26 17:39:58 +01:00
parent 56e8fb4faf
commit 0293599380
15 changed files with 54 additions and 55 deletions

View file

@ -38,8 +38,8 @@ IF(LINUX)
-DTIXML_USE_STL
-W
-Wall
-Wno-overloaded-virtual
-Wno-switch
# -Wno-overloaded-virtual
# -Wno-switch
-Wno-unused
-Wno-long-long
-Wno-deprecated-declarations

View file

@ -45,7 +45,7 @@ namespace Pol {
virtual bool isEqual( const BObjectImp& objimp ) const POL_OVERRIDE;
virtual bool isTrue() const POL_OVERRIDE;
ContIterator* createIterator( BObject* pIterVal );
virtual ContIterator* createIterator( BObject* pIterVal ) POL_OVERRIDE;
private:
static unsigned int creations_;

View file

@ -828,11 +828,11 @@ namespace Pol {
const BApplicObjType* object_type() const;
public: // Class Machinery
virtual BObjectImp* copy() const = 0;
virtual BObjectImp* copy() const POL_OVERRIDE = 0;
virtual std::string getStringRep() const POL_OVERRIDE;
virtual void printOn( std::ostream& ) const POL_OVERRIDE;
virtual size_t sizeEstimate() const = 0;
virtual size_t sizeEstimate() const POL_OVERRIDE = 0;
private:
const BApplicObjType* object_type_;
@ -860,9 +860,9 @@ namespace Pol {
const T& value() const;
T* operator->( );
virtual const char* typeOf() const = 0;
virtual int typeOfInt() const = 0;
virtual BObjectImp* copy() const = 0;
virtual const char* typeOf() const POL_OVERRIDE = 0;
virtual int typeOfInt() const POL_OVERRIDE = 0;
virtual BObjectImp* copy() const POL_OVERRIDE = 0;
virtual size_t sizeEstimate() const POL_OVERRIDE;
protected:

View file

@ -199,7 +199,7 @@ namespace Pol {
void patchoffset( unsigned instruc, unsigned newoffset );
void addToken( Token& tok );
int isLegal( Token& tok );
virtual int isLegal( Token& tok ) POL_OVERRIDE;
virtual int getUserArgs( Expression& ex, CompilerContext& ctx, bool inject_jsr ) POL_OVERRIDE;
virtual int getArrayElements( Expression& expr, CompilerContext& ctx ) POL_OVERRIDE;

View file

@ -124,7 +124,7 @@ namespace Pol {
virtual std::string getStringRep() const POL_OVERRIDE { return value_; }
virtual std::string getFormattedStringRep() const POL_OVERRIDE { return "\"" + value_ + "\""; }
void printOn( std::ostream& ) const;
virtual void printOn( std::ostream& ) const POL_OVERRIDE;
protected:

View file

@ -160,7 +160,7 @@ namespace Pol {
virtual int isUserFunc(Token& tok, UserFunction **userfunc);
virtual int parseToken( CompilerContext& ctx, Expression& expr, Token * ) POL_OVERRIDE;
int getToken( CompilerContext& ctx, Token& token, Expression* expr = NULL );
virtual int getToken( CompilerContext& ctx, Token& token, Expression* expr = NULL ) POL_OVERRIDE;
bool callingMethod( CompilerContext& ctx );

View file

@ -23,7 +23,7 @@ namespace Pol {
virtual ~InMemoryMapServer();
virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const POL_OVERRIDE;
size_t sizeEstimate() const;
virtual size_t sizeEstimate() const POL_OVERRIDE;
private:
std::vector<MAPBLOCK> _mapblocks;

View file

@ -100,7 +100,7 @@ namespace Pol {
virtual void SetMasterKeys( unsigned int masterKey1, unsigned int masterKey2 ) POL_OVERRIDE;
protected:
virtual void Decrypt( void *pvIn, void *pvOut, int len );
virtual void Decrypt( void *pvIn, void *pvOut, int len ) POL_OVERRIDE;
};
// TWOFISH

View file

@ -96,7 +96,7 @@ namespace Pol {
virtual void setfacing( u8 newfacing ) POL_OVERRIDE;
virtual void on_facing_changed() POL_OVERRIDE;
std::string description() const;
virtual std::string description() const POL_OVERRIDE;
std::string merchant_description() const;

View file

@ -44,11 +44,11 @@ namespace Pol {
using namespace Bscript;
#ifdef HAVE_MYSQL
BObjectImp* SQLExecutorModule::background_connect( Core::UOExecutor& uoexec, const std::string host, const std::string username, const std::string password )
BObjectImp* SQLExecutorModule::background_connect( Core::UOExecutor* uoexec, const std::string host, const std::string username, const std::string password )
{
auto msg = [&uoexec, host, username, password]()
{
if ( &uoexec == nullptr )
if ( uoexec == nullptr )
{
INFO_PRINT << "uoexec is null\n";
return;
@ -61,33 +61,33 @@ namespace Pol {
if ( sql->getLastErrNo() )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( "Insufficient memory" ) ));
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( "Insufficient memory" ) ));
uoexec->os_module->revive( );
}
else if ( !sql->connect( host.data(), username.data(), password.data() ) )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec->os_module->revive( );
}
else
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( sql.release( ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( sql.release( ) ) );
uoexec->os_module->revive( );
}
};
Core::networkManager.sql_service->push( std::move(msg) );
uoexec.os_module->suspend();
uoexec->os_module->suspend();
return new BLong( 0 );
}
BObjectImp* SQLExecutorModule::background_select( Core::UOExecutor& uoexec, Core::BSQLConnection *sql, const std::string db )
BObjectImp* SQLExecutorModule::background_select( Core::UOExecutor* uoexec, Core::BSQLConnection *sql, const std::string db )
{
auto msg = [&uoexec, sql, db]()
{
if ( &uoexec == nullptr )
if ( uoexec == nullptr )
{
INFO_PRINT << "uoexec is null\n";
return;
@ -95,32 +95,32 @@ namespace Pol {
if ( sql == nullptr )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( "Invalid parameters" ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( "Invalid parameters" ) ) );
uoexec->os_module->revive( );
}
else if ( !sql->select_db( db.c_str() ) )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec->os_module->revive( );
}
else
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BLong( 1 ) ) );
uoexec.os_module->revive();
uoexec->ValueStack.back( ).set( new BObject( new BLong( 1 ) ) );
uoexec->os_module->revive();
}
};
Core::networkManager.sql_service->push( std::move( msg ) );
uoexec.os_module->suspend();
uoexec->os_module->suspend();
return new BLong( 0 );
}
BObjectImp* SQLExecutorModule::background_query( Core::UOExecutor& uoexec, Core::BSQLConnection *sql, const std::string query )
BObjectImp* SQLExecutorModule::background_query( Core::UOExecutor* uoexec, Core::BSQLConnection *sql, const std::string query )
{
auto msg = [&uoexec, sql, query]()
{
if ( &uoexec == nullptr )
if ( uoexec == nullptr )
{
INFO_PRINT << "uoexec is null\n";
return;
@ -129,24 +129,24 @@ namespace Pol {
if ( sql == nullptr )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( "Invalid parameters" ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( "Invalid parameters" ) ) );
uoexec->os_module->revive( );
}
else if ( !sql->query( query.c_str() ) )
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( new BError( sql->getLastError( ) ) ) );
uoexec->os_module->revive( );
}
else
{
Core::PolLock lck;
uoexec.ValueStack.back( ).set( new BObject( sql->getResultSet( ) ) );
uoexec.os_module->revive( );
uoexec->ValueStack.back( ).set( new BObject( sql->getResultSet( ) ) );
uoexec->os_module->revive( );
}
};
Core::networkManager.sql_service->push( std::move( msg ) );
uoexec.os_module->suspend();
uoexec->os_module->suspend();
return new BLong( 0 );
}
@ -159,7 +159,7 @@ namespace Pol {
{
return new BError( "Invalid parameters" );
}
return background_connect( uoexec, host->getStringRep(), username->getStringRep(), password->getStringRep() );
return background_connect( &uoexec, host->getStringRep(), username->getStringRep(), password->getStringRep() );
}
Bscript::BObjectImp* SQLExecutorModule::mf_SelectDb()
{
@ -169,7 +169,7 @@ namespace Pol {
{
return new BError( "Invalid parameters" );
}
return background_select( uoexec, sql, db->getStringRep() );
return background_select( &uoexec, sql, db->getStringRep() );
}
Bscript::BObjectImp* SQLExecutorModule::mf_Query()
@ -180,7 +180,7 @@ namespace Pol {
{
return new BError( "Invalid parameters" );
}
return background_query( uoexec, sql, query->getStringRep() );
return background_query( &uoexec, sql, query->getStringRep() );
}
Bscript::BObjectImp* SQLExecutorModule::mf_NumFields()

View file

@ -37,9 +37,9 @@ namespace Pol {
Bscript::BObjectImp* mf_SelectDb();
Bscript::BObjectImp* mf_FieldName();
static Bscript::BObjectImp* background_connect( Core::UOExecutor& uoexec, const std::string host, const std::string username, const std::string password );
static Bscript::BObjectImp* background_select( Core::UOExecutor& uoexec, Core::BSQLConnection *sql, const std::string db );
static Bscript::BObjectImp* background_query( Core::UOExecutor& uoexec, Core::BSQLConnection *sql, const std::string query );
static Bscript::BObjectImp* background_connect( Core::UOExecutor* uoexec, const std::string host, const std::string username, const std::string password );
static Bscript::BObjectImp* background_select( Core::UOExecutor* uoexec, Core::BSQLConnection *sql, const std::string db );
static Bscript::BObjectImp* background_query( Core::UOExecutor* uoexec, Core::BSQLConnection *sql, const std::string query );
private:
Core::UOExecutor& uoexec;
};

View file

@ -1090,7 +1090,7 @@ namespace Pol {
auto critical_promise = std::make_shared<std::promise<bool>>();
auto critical_future = critical_promise->get_future();
SaveContext::finished =
std::move( std::async( std::launch::async, [&, critical_promise]()->bool
std::async( std::launch::async, [&, critical_promise]()->bool
{
// limit the used thread
#ifndef __clang__
@ -1283,7 +1283,7 @@ namespace Pol {
commit( "datastore" );
commit( "parties" );
return true;
} ) );
} );
critical_future.wait(); // wait for end of critical part
if ( Plib::systemstate.accounts_txt_dirty ) // write accounts extra, since it uses extra thread for io operations would be to many threads working

View file

@ -63,7 +63,7 @@ namespace Pol {
virtual int typeOfInt() const POL_OVERRIDE { return OTXMLFile; }
virtual bool isTrue() const POL_OVERRIDE;
virtual Bscript::BObjectRef OperSubscript( const Bscript::BObject& obj ) POL_OVERRIDE;
Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal )
virtual Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal ) POL_OVERRIDE
{
return new BXMLNodeIterator( &file, pIterVal );
}
@ -94,7 +94,7 @@ namespace Pol {
{
return sizeof( *this ) + sizeof( TiXmlNode );
}
Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal )
virtual Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal ) POL_OVERRIDE
{
return new BXMLNodeIterator( node, pIterVal );
}
@ -129,7 +129,7 @@ namespace Pol {
virtual int typeOfInt() const POL_OVERRIDE { return OTXMLAttributes; }
virtual size_t sizeEstimate() const POL_OVERRIDE { return sizeof( *this ); }
Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal )
virtual Bscript::ContIterator* createIterator( Bscript::BObject* pIterVal ) POL_OVERRIDE
{
return new BXMLAttributeIterator( node, pIterVal );
}

View file

@ -2,7 +2,6 @@
#include "../clib/clib.h"
#include "../clib/logfacility.h"
#include "../clib/cmdargs.h"
#include "../clib/cfgelem.h"
#include "../clib/timer.h"
@ -215,6 +214,7 @@ int RunEclMain::main()
m_quiet = programArgsFind("q") != "";
m_debug = programArgsFind("d") != "";
m_profile = programArgsFind("p") != "";
Clib::passert_disabled = !programArgsFind("a").empty() ? false : true;
/**********************************************
* show copyright

View file

@ -21,7 +21,6 @@
#include "../clib/stlutil.h"
#include "../clib/cfgelem.h"
#include "../clib/cfgfile.h"
#include "../clib/cmdargs.h"
#include "../clib/fileutil.h"
#include "../clib/logfacility.h"
#include "../clib/passert.h"
@ -1221,7 +1220,7 @@ int UoConvertMain::main()
int x = programArgsFindEquals( "x=", -1, false );
int y = programArgsFindEquals( "y=", -1, false );
// brittania: realm=main mapid=0 width=6144 height=4096
// britannia: realm=main mapid=0 width=6144 height=4096
// ilshenar: realm=ilshenar mapid=2 width=2304 height=1600
// malas: realm=malas mapid=3 width=2560 height=2048
// tokuno: realm=tokuno mapid=4 width=1448 height=1448