Fix build on Windows/MSVC

for some reason <algorithm> dragged in <cstdio> which chocked on the
use_idStr_snPrintf #defines from Str.h
"fixed" by including <algorithm> first
also shut up some compiler warnings about signed/unsigned mismatch
This commit is contained in:
Daniel Gibson 2024-06-03 19:25:50 +02:00
parent 5376c6d74c
commit a9bee9f76e

View file

@ -1,5 +1,7 @@
#ifndef IMGUI_DISABLE
#include <algorithm> // std::sort - TODO: replace with something custom..
#include <SDL.h> // to show display size
#define IMGUI_DEFINE_MATH_OPERATORS
@ -19,8 +21,6 @@
#include "renderer/tr_local.h" // render cvars
#include "sound/snd_local.h" // sound cvars
#include <algorithm> // std::sort - TODO: replace with something custom..
extern const char* D3_GetGamepadStartButtonName();
extern idCVar imgui_style;
@ -261,7 +261,7 @@ struct BindingEntry {
// only removes the entry from bindings, does *not* unbind!
void RemoveBindingEntry( unsigned idx )
{
if ( idx < bindings.Num() ) {
if ( idx < (unsigned)bindings.Num() ) {
bindings.RemoveIndex( idx );
}
}
@ -1532,14 +1532,14 @@ struct CVarOption {
}
};
static void InitOptions(CVarOption options[], size_t numOptions)
static void InitOptions(CVarOption options[], int numOptions)
{
for( int i=0; i < numOptions; ++i ) {
options[i].Init();
}
}
static void DrawOptions(CVarOption options[], size_t numOptions)
static void DrawOptions(CVarOption options[], int numOptions)
{
for( int i=0; i < numOptions; ++i ) {
options[i].Draw();