diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 4b7670069..462c67333 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -492,7 +492,7 @@ void ObjectMgr::LoadPointOfInterestLocales() struct SQLCreatureLoader : public SQLStorageLoaderBase { template - void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) + void convert_from_str(uint32 /*field_pos*/, char const *src, D &dst) { dst = D(sObjectMgr.GetScriptId(src)); } @@ -1849,7 +1849,7 @@ void ObjectMgr::LoadItemLocales() struct SQLItemLoader : public SQLStorageLoaderBase { template - void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) + void convert_from_str(uint32 /*field_pos*/, char const *src, D &dst) { dst = D(sObjectMgr.GetScriptId(src)); } @@ -5227,7 +5227,7 @@ void ObjectMgr::LoadPageTextLocales() struct SQLInstanceLoader : public SQLStorageLoaderBase { template - void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) + void convert_from_str(uint32 /*field_pos*/, char const *src, D &dst) { dst = D(sObjectMgr.GetScriptId(src)); } @@ -6516,7 +6516,7 @@ void ObjectMgr::LoadGameObjectLocales() struct SQLGameObjectLoader : public SQLStorageLoaderBase { template - void convert_from_str(uint32 /*field_pos*/, char *src, D &dst) + void convert_from_str(uint32 /*field_pos*/, char const *src, D &dst) { dst = D(sObjectMgr.GetScriptId(src)); } diff --git a/src/shared/Database/Database.cpp b/src/shared/Database/Database.cpp index e414865bd..14535c9c6 100644 --- a/src/shared/Database/Database.cpp +++ b/src/shared/Database/Database.cpp @@ -249,7 +249,7 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_ else { sLog.outErrorDb("The table `%s` in your [%s] database is missing its version info.",table_name,db_name); - sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name); + sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date."); sLog.outErrorDb(); sLog.outErrorDb("This revision of MaNGOS requires a database updated to:"); sLog.outErrorDb("`%s.sql`",req_sql_update_name); @@ -264,7 +264,7 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_ else { sLog.outErrorDb("The table `%s` in your [%s] database is missing or corrupt.",table_name,db_name); - sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name); + sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date."); sLog.outErrorDb(); sLog.outErrorDb("This revision of mangos requires a database updated to:"); sLog.outErrorDb("`%s.sql`",req_sql_update_name); diff --git a/src/shared/Database/QueryResultMysql.cpp b/src/shared/Database/QueryResultMysql.cpp index a568c5b19..c47b01415 100644 --- a/src/shared/Database/QueryResultMysql.cpp +++ b/src/shared/Database/QueryResultMysql.cpp @@ -88,7 +88,6 @@ enum Field::DataTypes QueryResultMysql::ConvertNativeType(enum_field_types mysql case FIELD_TYPE_NULL: return Field::DB_TYPE_STRING; case FIELD_TYPE_TINY: - case FIELD_TYPE_SHORT: case FIELD_TYPE_LONG: case FIELD_TYPE_INT24: diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index 247fb4a79..41d7c6557 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -67,7 +67,7 @@ void SQLStorage::EraseEntry(uint32 id) else offset += 4; - reinterpret_cast(pIndex[id]) = NULL; + pIndex[id] = NULL; } void SQLStorage::Free () diff --git a/src/shared/Database/SQLStorage.h b/src/shared/Database/SQLStorage.h index 6df7d11bf..f89c27256 100644 --- a/src/shared/Database/SQLStorage.h +++ b/src/shared/Database/SQLStorage.h @@ -101,13 +101,20 @@ struct SQLStorageLoaderBase template void convert_to_str(uint32 field_pos, S src, char * & dst); template - void convert_from_str(uint32 field_pos, char * src, D& dst); - void convert_str_to_str(uint32 field_pos, char *src, char *&dst); + void convert_from_str(uint32 field_pos, char const* src, D& dst); + void convert_str_to_str(uint32 field_pos, char const* src, char *&dst); + // trap, no body + template + void convert_from_str(uint32 field_pos, char* src, D& dst); + void convert_str_to_str(uint32 field_pos, char* src, char *&dst); private: template - void storeValue(V value, SQLStorage &store, char *p, int x, uint32 &offset); - void storeValue(char * value, SQLStorage &store, char *p, int x, uint32 &offset); + void storeValue(V value, SQLStorage &store, char *p, uint32 x, uint32 &offset); + void storeValue(char const* value, SQLStorage &store, char *p, uint32 x, uint32 &offset); + + // trap, no body + void storeValue(char * value, SQLStorage &store, char *p, uint32 x, uint32 &offset); }; struct SQLStorageLoader : public SQLStorageLoaderBase diff --git a/src/shared/Database/SQLStorageImpl.h b/src/shared/Database/SQLStorageImpl.h index 7b9414df6..4b8ccbde7 100644 --- a/src/shared/Database/SQLStorageImpl.h +++ b/src/shared/Database/SQLStorageImpl.h @@ -28,7 +28,7 @@ void SQLStorageLoaderBase::convert(uint32 /*field_pos*/, S src, D &dst) } template -void SQLStorageLoaderBase::convert_str_to_str(uint32 /*field_pos*/, char *src, char *&dst) +void SQLStorageLoaderBase::convert_str_to_str(uint32 /*field_pos*/, char const *src, char *&dst) { if(!src) { @@ -53,14 +53,14 @@ void SQLStorageLoaderBase::convert_to_str(uint32 /*field_pos*/, S /*src*/, ch template template -void SQLStorageLoaderBase::convert_from_str(uint32 /*field_pos*/, char * /*src*/, D& dst) +void SQLStorageLoaderBase::convert_from_str(uint32 /*field_pos*/, char const* /*src*/, D& dst) { dst = 0; } template template -void SQLStorageLoaderBase::storeValue(V value, SQLStorage &store, char *p, int x, uint32 &offset) +void SQLStorageLoaderBase::storeValue(V value, SQLStorage &store, char *p, uint32 x, uint32 &offset) { T * subclass = (static_cast(this)); switch(store.dst_format[x]) @@ -89,7 +89,7 @@ void SQLStorageLoaderBase::storeValue(V value, SQLStorage &store, char *p, in } template -void SQLStorageLoaderBase::storeValue(char * value, SQLStorage &store, char *p, int x, uint32 &offset) +void SQLStorageLoaderBase::storeValue(char const* value, SQLStorage &store, char *p, uint32 x, uint32 &offset) { T * subclass = (static_cast(this)); switch(store.dst_format[x]) @@ -203,7 +203,7 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) case FT_FLOAT: storeValue((float)fields[x].GetFloat(), store, p, x, offset); break; case FT_STRING: - storeValue((char*)fields[x].GetString(), store, p, x, offset); break; + storeValue((char const*)fields[x].GetString(), store, p, x, offset); break; } ++count; }while( result->NextRow() ); diff --git a/src/shared/Database/SqlDelayThread.cpp b/src/shared/Database/SqlDelayThread.cpp index 797e3248e..e1311007e 100644 --- a/src/shared/Database/SqlDelayThread.cpp +++ b/src/shared/Database/SqlDelayThread.cpp @@ -41,7 +41,7 @@ void SqlDelayThread::run() // empty the queue before exiting ACE_Based::Thread::Sleep(loopSleepms); - SqlOperation* s; + SqlOperation* s = NULL; while (m_sqlQueue.next(s)) { s->Execute(m_dbEngine); diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp index 16d613011..25933a32a 100644 --- a/src/shared/Database/SqlOperations.cpp +++ b/src/shared/Database/SqlOperations.cpp @@ -71,7 +71,7 @@ void SqlQuery::Execute(Database *db) void SqlResultQueue::Update() { /// execute the callbacks waiting in the synchronization queue - MaNGOS::IQueryCallback* callback; + MaNGOS::IQueryCallback* callback = NULL; while (next(callback)) { callback->Execute(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f81ea45a5..50f998708 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10791" + #define REVISION_NR "10792" #endif // __REVISION_NR_H__