Skip to content

Commit

Permalink
Fix various warnnigs messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberium authored and xfurry committed Nov 4, 2015
1 parent d838b4b commit 60ede89
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions cmake/compiler/clang/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if(WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
message(STATUS "Clang: All warnings enabled")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused*result")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
endif()

if(DEBUG)
Expand Down
4 changes: 4 additions & 0 deletions cmake/compiler/gcc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ if(PLATFORM EQUAL X86)
set(SSE_FLAGS "-msse2 -mfpmath=sse")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused*result")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
endif()

add_definitions(-DHAVE_SSE2)
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")

Expand Down
8 changes: 4 additions & 4 deletions src/game/CalendarHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
sCalendarMgr.GetPlayerInvitesList(guid, invites);

data << uint32(invites.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %u invites", invites.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %u invites", uint32(invites.size()));

for (CalendarInvitesList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
{
Expand All @@ -66,7 +66,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
sCalendarMgr.GetPlayerEventsList(guid, events);

data << uint32(events.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %u events", events.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %u events", uint32(events.size()));

for (CalendarEventsList::const_iterator itr = events.begin(); itr != events.end(); ++itr)
{
Expand Down Expand Up @@ -368,7 +368,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data)
CharacterDatabase.PExecute("UPDATE calendar_events SET "
"type=%hu, flags=%u, dungeonId=%d, eventTime=%u, title='%s', description='%s'"
"WHERE eventid=" UI64FMTD,
type, flags, dungeonId, event->EventTime, title.c_str(), description.c_str(), eventId);
type, flags, dungeonId, uint32(event->EventTime), title.c_str(), description.c_str(), eventId);
}
else
sCalendarMgr.SendCalendarCommandResult(_player, CALENDAR_ERROR_EVENT_INVALID);
Expand Down Expand Up @@ -510,7 +510,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data)
invite.LastUpdateTime = time(nullptr);

sCalendarMgr.SendCalendarEventInvite(&invite);
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "PREINVITE> sender[%s], Invitee[%u]", playerGuid.GetString().c_str(), inviteeGuid.GetString().c_str());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "PREINVITE> sender[%s], Invitee[%s]", playerGuid.GetString().c_str(), inviteeGuid.GetString().c_str());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20203,7 +20203,7 @@ void Player::SendTransferAbortedByLockStatus(MapEntry const* mapEntry, AreaLockS
case AREA_LOCKSTATUS_QUEST_NOT_COMPLETED:
if (mapEntry->MapID == 269) // Exception for Black Morass
{
GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(LANG_TELEREQ_QUEST_BLACK_MORASS));
GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetMangosString(LANG_TELEREQ_QUEST_BLACK_MORASS));
break;
}
else if (mapEntry->IsContinent()) // do not report anything for quest areatrigge
Expand Down
2 changes: 1 addition & 1 deletion src/scriptdev2/base/escort_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void npc_escortAI::GetAIInformation(ChatHandler& reader)
m_creature->GetMotionMaster()->GetWaypointPathInformation(oss);
}

reader.PSendSysMessage(oss.str().c_str());
reader.PSendSysMessage("%s", oss.str().c_str());
}

bool npc_escortAI::IsVisible(Unit* pWho) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct npc_anubisath_sentinelAI : public ScriptedAI
if (m_lAssistList.size() == MAX_BUDDY)
reader.PSendSysMessage("Anubisath Sentinel - proper group found");
else
reader.PSendSysMessage("Anubisath Sentinel - not correct number of mobs for group found. Number found %u, should be %u", m_lAssistList.size(), MAX_BUDDY);
reader.PSendSysMessage("Anubisath Sentinel - not correct number of mobs for group found. Number found %u, should be %u", uint32(m_lAssistList.size()), MAX_BUDDY);
}

void JustReachedHome() override
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ByteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ void BitStream::Print()
for (uint32 i = 0; i < GetLength(); ++i)
ss << uint32(GetBit(i)) << " ";

sLog.outDebug(ss.str().c_str());
sLog.outDebug("%s", ss.str().c_str());
}

2 changes: 1 addition & 1 deletion src/shared/Database/SQLStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void SQLStorage::prepareToLoad(uint32 maxRecordId, uint32 recordCount, uint32 re

// Set index array
m_Index = new char* [maxRecordId];
memset(m_Index, NULL, maxRecordId * sizeof(char*));
memset(m_Index, 0, maxRecordId * sizeof(char*));

SQLStorageBase::prepareToLoad(maxRecordId, recordCount, recordSize);
}
Expand Down

0 comments on commit 60ede89

Please sign in to comment.