Core: Fix clang 10 warnings

This commit is contained in:
Shauren
2020-04-26 01:25:50 +02:00
parent 70c2b4e5ba
commit 7272508cb4
8 changed files with 10 additions and 34 deletions

View File

@@ -12,7 +12,8 @@ if(WITH_WARNINGS)
-Winit-self
-Wfatal-errors
-Wno-mismatched-tags
-Woverloaded-virtual)
-Woverloaded-virtual
-Wno-deprecated-copy) # warning in g3d
message(STATUS "Clang: All warnings enabled")
endif()
@@ -27,6 +28,7 @@ endif()
# -Wno-narrowing needed to suppress a warning in g3d
# -Wno-deprecated-register is needed to suppress 185 gsoap warnings on Unix systems.
# -Wno-deprecated-copy needed to suppress a warning in g3d
target_compile_options(trinity-compile-option-interface
INTERFACE
-Wno-narrowing

View File

@@ -412,15 +412,6 @@ public:
return !this->operator ==(right);
}
inline flag128 & operator =(const flag128 &right)
{
part[0] = right.part[0];
part[1] = right.part[1];
part[2] = right.part[2];
part[3] = right.part[3];
return *this;
}
inline flag128 operator &(const flag128 &right) const
{
return flag128(part[0] & right.part[0], part[1] & right.part[1],

View File

@@ -82,7 +82,6 @@ bool LoginRESTService::Start(Trinity::Asio::IoContext* ioContext)
_port = 8081;
}
boost::system::error_code ec;
boost::asio::ip::tcp::resolver resolver(*ioContext);
std::string configuredAddress = sConfigMgr->GetStringDefault("LoginREST.ExternalAddress", "127.0.0.1");

View File

@@ -60,6 +60,12 @@ private:
float m_orientation;
public:
Position& operator=(Position const& loc)
{
Relocate(loc);
return *this;
}
bool operator==(Position const &a) const;
inline bool operator!=(Position const &a) const
@@ -242,9 +248,6 @@ public:
WorldLocation(uint32 mapId, Position const& position)
: Position(position), m_mapId(mapId) { }
WorldLocation(WorldLocation const& loc)
: Position(loc), m_mapId(loc.GetMapId()) { }
void WorldRelocate(WorldLocation const& loc)
{
m_mapId = loc.GetMapId();

View File

@@ -23180,7 +23180,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
uint64 price = 0;
if (crItem->IsGoldRequired(pProto) && pProto->GetBuyPrice() > 0) //Assume price cannot be negative (do not know why it is int32)
{
float buyPricePerItem = float(pProto->GetBuyPrice()) / pProto->GetBuyCount();
double buyPricePerItem = double(pProto->GetBuyPrice()) / pProto->GetBuyCount();
uint64 maxCount = MAX_MONEY_AMOUNT / buyPricePerItem;
if ((uint64)count > maxCount)
{

View File

@@ -118,15 +118,6 @@ struct LFGuildPlayer
_level = level;
}
LFGuildPlayer(LFGuildPlayer const& settings) : _comment(settings.GetComment())
{
_guid = settings.GetGUID();
_roles = settings.GetClassRoles();
_availability = settings.GetAvailability();
_interests = settings.GetInterests();
_level = settings.GetLevel();
}
ObjectGuid const& GetGUID() const { return _guid; }
uint8 GetClassRoles() const { return _roles; }
uint8 GetAvailability() const { return _availability; }
@@ -157,9 +148,6 @@ struct LFGuildSettings : public LFGuildPlayer
LFGuildSettings(bool listed, TeamId team, ObjectGuid const& guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string& comment) :
LFGuildPlayer(guid, role, availability, interests, level, comment), _listed(listed), _team(team) {}
LFGuildSettings(LFGuildSettings const& settings) :
LFGuildPlayer(settings), _listed(settings.IsListed()), _team(settings.GetTeam()) {}
bool IsListed() const { return _listed; }
void SetListed(bool state) { _listed = state; }

View File

@@ -75,7 +75,6 @@ namespace Movement
MoveSplineFlag() { raw() = 0; }
MoveSplineFlag(uint32 f) { raw() = f; }
MoveSplineFlag(const MoveSplineFlag& f) { raw() = f.raw(); }
// Constant interface

View File

@@ -164,12 +164,6 @@ class LinkedListHead
{ // construct with node pointer _Pnode
}
Iterator& operator=(Iterator const &_Right)
{
_Ptr = _Right._Ptr;
return *this;
}
Iterator& operator=(const_pointer const &_Right)
{
_Ptr = pointer(_Right);