forked from Mirrors/openclonk
Silence a few compiler warnings.
parent
ca3ae81658
commit
535fc79c0f
|
@ -40,7 +40,7 @@ macro(__FINDAUDIO_FINDOPENAL)
|
|||
pkg_check_modules(OggVorbis "vorbisfile>=1.3.2" "vorbis>=1.3.2" "ogg>=1.2.2")
|
||||
else()
|
||||
if(MSVC OR APPLE)
|
||||
# We need OpenAL preferrably with alext.h.
|
||||
# We need OpenAL preferably with alext.h.
|
||||
find_path(OpenALExt_INCLUDE_DIRS alext.h PATH_SUFFIXES include/AL include/OpenAL include OpenAL)
|
||||
if(OpenALExt_INCLUDE_DIRS)
|
||||
set(HAVE_ALEXT TRUE)
|
||||
|
|
|
@ -702,7 +702,7 @@ namespace C4GUI
|
|||
// get dialog with matching handle
|
||||
Dialog *pDlg;
|
||||
for (Element *pEl = pLast; pEl; pEl = pEl->GetPrev())
|
||||
if (pDlg = pEl->GetDlg())
|
||||
if ((pDlg = pEl->GetDlg()))
|
||||
if (pDlg->pWindow && pDlg->pWindow->hWindow == hWindow)
|
||||
return pDlg;
|
||||
return NULL;
|
||||
|
|
|
@ -814,8 +814,6 @@ namespace C4GUI
|
|||
void FullscreenDialog::DrawBackground(C4TargetFacet &cgo, C4Facet &rFromFct)
|
||||
{
|
||||
// draw across fullscreen bounds - zoom 1px border to prevent flashing borders by blit offsets
|
||||
Screen *pScr = GetScreen();
|
||||
C4Rect &rcScreenBounds = pScr ? pScr->GetBounds() : GetBounds();
|
||||
rFromFct.DrawFullScreen(cgo);
|
||||
}
|
||||
|
||||
|
|
|
@ -779,7 +779,7 @@ bool C4MessageInput::ProcessCommand(const char *szCommand)
|
|||
// try writing main file (usually {SCENARIO}/TODO.txt); if access is not possible, e.g. because scenario is packed, write to alternate file
|
||||
const char *todo_filenames[] = { ::Config.Developer.TodoFilename, ::Config.Developer.AltTodoFilename };
|
||||
bool success = false;
|
||||
for (int i = 0; i < std::extent<decltype(todo_filenames)>::value; ++i)
|
||||
for (int i = 0; i < static_cast<int>(std::extent<decltype(todo_filenames)>::value); ++i)
|
||||
{
|
||||
StdCopyStrBuf todo_filename(todo_filenames[i]);
|
||||
int replacements = todo_filename.Replace("{SCENARIO}", Game.ScenarioFile.GetFullName().getData());
|
||||
|
|
|
@ -1365,6 +1365,7 @@ void C4PlayerInfoListBox::UpdateSavegamePlayers(ListItem **ppCurrInList)
|
|||
new PlayerListItem(this, -1, iInfoID, true, *ppCurrInList);
|
||||
}
|
||||
// 2do: none-label
|
||||
(void) fAnyPlayers;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1375,14 +1376,11 @@ void C4PlayerInfoListBox::UpdateReplayPlayers(ListItem **ppCurrInList)
|
|||
if (!PlrListItemUpdate(ListItem::ID::PLI_REPLAY, 0, ppCurrInList))
|
||||
new ReplayPlayersListItem(this, *ppCurrInList);
|
||||
// players
|
||||
bool fAnyPlayers = false;
|
||||
C4PlayerInfo *pInfo; int32_t iInfoID=0;
|
||||
while ((pInfo = Game.PlayerInfos.GetNextPlayerInfoByID(iInfoID)))
|
||||
{
|
||||
if (pInfo->IsInvisible()) continue;
|
||||
iInfoID = pInfo->GetID();
|
||||
// players are in the list
|
||||
fAnyPlayers = true;
|
||||
// show them
|
||||
if (!PlrListItemUpdate(ListItem::ID::PLI_PLAYER, iInfoID, ppCurrInList))
|
||||
new PlayerListItem(this, -1, iInfoID, false, *ppCurrInList);
|
||||
|
|
|
@ -184,7 +184,7 @@ bool C4StartupNetListEntry::Execute()
|
|||
{
|
||||
fError = false;
|
||||
sError.Clear();
|
||||
((C4Facet &) pIcon->GetFacet()) = (const C4Facet &) C4Startup::Get()->Graphics.fctNetGetRef;
|
||||
pIcon->SetFacet(C4Startup::Get()->Graphics.fctNetGetRef);
|
||||
pIcon->SetAnimated(true, 1);
|
||||
pIcon->SetBounds(rctIconLarge);
|
||||
sInfoText[1].Copy(LoadResStr("IDS_NET_INFOQUERY"));
|
||||
|
@ -820,7 +820,9 @@ void C4StartupNetDlg::OnBtnInternet(C4GUI::Control *btn)
|
|||
void C4StartupNetDlg::OnBtnRecord(C4GUI::Control *btn)
|
||||
{
|
||||
// toggle league signup flag
|
||||
bool fCheck = Config.General.DefRec = Game.Record = !Game.Record;
|
||||
bool fCheck = !Game.Record;
|
||||
Game.Record = fCheck;
|
||||
Config.General.DefRec = fCheck;
|
||||
btnRecord->SetIcon(fCheck ? C4GUI::Ico_Ex_RecordOn : C4GUI::Ico_Ex_RecordOff);
|
||||
}
|
||||
|
||||
|
|
|
@ -375,7 +375,6 @@ void C4StartupOptionsDlg::ControlConfigListBox::SetUserKey(class C4PlayerControl
|
|||
C4StartupOptionsDlg::ControlConfigArea::ControlConfigArea(const C4Rect &rcArea, int32_t iHMargin, int32_t iVMargin, bool fGamepad, C4StartupOptionsDlg *pOptionsDlg)
|
||||
: C4GUI::Window(), fGamepad(fGamepad), pGamepadOpener(NULL), pOptionsDlg(pOptionsDlg), pGUICtrl(NULL)
|
||||
{
|
||||
CStdFont *pUseFont = &(C4Startup::Get()->Graphics.BookFont);
|
||||
CStdFont *pUseFontSmall = &(C4Startup::Get()->Graphics.BookSmallFont);
|
||||
SetBounds(rcArea);
|
||||
C4GUI::ComponentAligner caArea(rcArea, iHMargin, iVMargin, true);
|
||||
|
|
|
@ -682,7 +682,7 @@ bool C4ScenarioListLoader::Scenario::LoadCustomPre(C4Group &rGrp)
|
|||
const C4ScenarioParameterDefs *deflist = deflists[def_list_idx];
|
||||
if (!deflist) continue;
|
||||
const C4ScenarioParameterDef *def; size_t idx=0;
|
||||
while (def = deflist->GetParameterDefByIndex(idx++))
|
||||
while ((def = deflist->GetParameterDefByIndex(idx++)))
|
||||
{
|
||||
if (def->IsAchievement())
|
||||
{
|
||||
|
@ -1402,7 +1402,6 @@ C4StartupScenSelDlg::C4StartupScenSelDlg(bool fNetwork) : C4StartupDlg(LoadResSt
|
|||
int iButtonHeight = C4GUI_ButtonHgt;
|
||||
int iBookPageWidth;
|
||||
int iExtraHPadding = rcBounds.Wdt >= 700 ? rcBounds.Wdt/50 : 0;
|
||||
int iExtraVPadding = rcBounds.Hgt >= 540 ? rcBounds.Hgt/20 : 0;
|
||||
::GraphicsResource.CaptionFont.GetTextExtent("<< BACK", iButtonWidth, iCaptionFontHgt, true);
|
||||
iButtonWidth *= 3;
|
||||
C4GUI::ComponentAligner caMain(GetClientRect(), 0,0, true);
|
||||
|
|
|
@ -661,7 +661,7 @@ std::list<C4FoWBeamTriangle> C4FoWLightSection::CalculateTriangles(C4FoWRegion *
|
|||
#ifdef FAN_STEP_DEBUG
|
||||
LogSilentF("Descend, b=%.010f, cross=%.010f/%.010f", b, crossX, crossY);
|
||||
#endif
|
||||
assert(f);
|
||||
assert(f); (void) f;
|
||||
if (b <= threshold)
|
||||
{
|
||||
if (nextIt == --result.end())
|
||||
|
@ -702,14 +702,14 @@ std::list<C4FoWBeamTriangle> C4FoWLightSection::CalculateTriangles(C4FoWRegion *
|
|||
}
|
||||
|
||||
// We should only reach this place with a descend collision
|
||||
assert(descendCollision);
|
||||
assert(descendCollision); (void) descendCollision;
|
||||
|
||||
// Should never be parallel -- otherwise we wouldn't be here
|
||||
// in the first place.
|
||||
bool f = find_cross(lightLX, lightLY, tri.fanRX, tri.fanRY,
|
||||
lightRX, lightRY, nextTri.fanLX, nextTri.fanLY,
|
||||
&crossX, &crossY);
|
||||
assert(f);
|
||||
assert(f); (void) f;
|
||||
#ifdef FAN_STEP_DEBUG
|
||||
LogSilentF("Collision, cross=%.02f/%.02f", crossX, crossY);
|
||||
#endif
|
||||
|
@ -722,7 +722,7 @@ std::list<C4FoWBeamTriangle> C4FoWLightSection::CalculateTriangles(C4FoWRegion *
|
|||
continue;
|
||||
|
||||
// This should always follow an elimination, but better check
|
||||
assert(beamCount > result.size());
|
||||
assert(beamCount > static_cast<int>(result.size()));
|
||||
|
||||
C4FoWBeamTriangle newTriangle;
|
||||
newTriangle.fanLX = crossX;
|
||||
|
|
|
@ -230,7 +230,7 @@ void StdMeshLoader::StdMeshXML::LoadBoneAssignments(StdMesh& mesh, std::vector<S
|
|||
// Check quickly if all weight slots are used
|
||||
if (vertex.bone_weight[StdMeshVertex::MaxBoneWeightCount - 1] != 0)
|
||||
{
|
||||
Error(FormatString("Vertex %d is influenced by more than %d bones", VertexIndex, StdMeshVertex::MaxBoneWeightCount), vertexboneassignment_elem);
|
||||
Error(FormatString("Vertex %d is influenced by more than %d bones", VertexIndex, static_cast<int>(StdMeshVertex::MaxBoneWeightCount)), vertexboneassignment_elem);
|
||||
}
|
||||
for (size_t weight_index = 0; weight_index < StdMeshVertex::MaxBoneWeightCount; ++weight_index)
|
||||
{
|
||||
|
|
|
@ -164,11 +164,15 @@ namespace {
|
|||
}
|
||||
#ifdef __CRT_WIDE
|
||||
# define ASSERTION_INFO_FORMAT "%ls"
|
||||
# define ASSERTION_INFO_TYPE wchar_t *
|
||||
#else
|
||||
# define ASSERTION_INFO_FORMAT "%s"
|
||||
# define ASSERTION_INFO_TYPE char *
|
||||
#endif
|
||||
LOG_DYNAMIC_TEXT("Additional information for the exception:\n Assertion that failed: " ASSERTION_INFO_FORMAT "\n File: " ASSERTION_INFO_FORMAT "\n Line: %d\n",
|
||||
exc->ExceptionRecord->ExceptionInformation[0], exc->ExceptionRecord->ExceptionInformation[1], exc->ExceptionRecord->ExceptionInformation[2]);
|
||||
reinterpret_cast<ASSERTION_INFO_TYPE>(exc->ExceptionRecord->ExceptionInformation[0]),
|
||||
reinterpret_cast<ASSERTION_INFO_TYPE>(exc->ExceptionRecord->ExceptionInformation[1]),
|
||||
exc->ExceptionRecord->ExceptionInformation[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -267,7 +271,8 @@ namespace {
|
|||
if (SymInitialize(process, 0, true))
|
||||
{
|
||||
LOG_STATIC_TEXT("\nStack trace:\n");
|
||||
STACKFRAME64 frame = {0};
|
||||
STACKFRAME64 frame;
|
||||
memset(&frame, 0, sizeof(STACKFRAME64));
|
||||
DWORD image_type;
|
||||
CONTEXT context = *exc->ContextRecord;
|
||||
// Setup frame info
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
#pragma warning(disable: 4521) // multiple copy constructors specified
|
||||
// Get non-standard <cmath> constants (M_PI etc.)
|
||||
# define _USE_MATH_DEFINES
|
||||
// Use IPv4 functions (inet_ntoa) since we don't support IPv6 yet.
|
||||
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue