Fix the rest of MSVS compiler warnings

- warning C4099: type name first seen using 'class' now seen using 'struct'
- warning C4291: no matching operator delete found; memory will not be
  freed if initialization throws an exception (false positive)
- warning C4305: truncation from 'double' to 'float'
This commit is contained in:
heinrich5991 2019-02-03 11:13:49 +01:00
parent ea80f967a9
commit 553db4cfaa
5 changed files with 15 additions and 6 deletions

View file

@ -81,7 +81,7 @@ public:
MAX_RCONCMD_RATIO=8,
};
class CMapListEntry;
struct CMapListEntry;
class CClient
{

View file

@ -598,9 +598,9 @@ void CChat::OnRender()
}
// draw a background box
const vec4 CRCWhite(1, 1, 1, 0.25);
const vec4 CRCTeam(0.4, 1, 0.4, 0.4);
const vec4 CRCWhisper(0, 0.5, 1, 0.5);
const vec4 CRCWhite(1.0f, 1.0f, 1.0f, 0.25f);
const vec4 CRCTeam(0.4f, 1.0f, 0.4f, 0.4f);
const vec4 CRCWhisper(0.0f, 0.5f, 1.0f, 0.5f);
vec4 CatRectColor = CRCWhite;
if(m_Mode == CHAT_TEAM)

View file

@ -390,7 +390,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
vec4 IconColor = vec4(1, 1, 1, 1);
if(!DemoItem.m_IsDir)
{
IconColor = vec4(0.6, 0.6, 0.6, 1); // not loaded
IconColor = vec4(0.6f, 0.6f, 0.6f, 1.0f); // not loaded
if(DemoItem.m_Valid && DemoItem.m_InfosLoaded)
IconColor = DemoMarkerCount > 0 ? vec4(0.5, 1, 0.5, 1) : vec4(1,1,1,1);
}

View file

@ -2024,7 +2024,7 @@ void CMenus::RenderSettings(CUIRect MainView)
RenderTools()->DrawUIRect(&RestartWarning, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 5.0f);
// text
TextRender()->TextColor(0.973f, 0.863f, 0.207, 1.0f);
TextRender()->TextColor(0.973f, 0.863f, 0.207f, 1.0f);
RestartWarning.y += 2.0f;
if(m_NeedRestartGraphics || m_NeedRestartSound)
UI()->DoLabel(&RestartWarning, Localize("You must restart the game for all settings to take effect."), RestartWarning.h*ms_FontmodHeight*0.75f, CUI::ALIGN_CENTER);

View file

@ -26,6 +26,7 @@
#define MACRO_ALLOC_POOL_ID() \
public: \
void *operator new(size_t Size, int id); \
void operator delete(void *p, int id); \
void operator delete(void *p); \
private:
@ -41,6 +42,14 @@
mem_zero(ms_PoolData##POOLTYPE[id], Size); \
return ms_PoolData##POOLTYPE[id]; \
} \
void POOLTYPE::operator delete(void *p, int id) \
{ \
dbg_assert(ms_PoolUsed##POOLTYPE[id], "not used"); \
dbg_assert(id == (POOLTYPE*)p - (POOLTYPE*)ms_PoolData##POOLTYPE, "invalid id"); \
/*dbg_msg("pool", "-- %s %d", #POOLTYPE, id);*/ \
ms_PoolUsed##POOLTYPE[id] = 0; \
mem_zero(ms_PoolData##POOLTYPE[id], sizeof(POOLTYPE)); \
} \
void POOLTYPE::operator delete(void *p) \
{ \
int id = (POOLTYPE*)p - (POOLTYPE*)ms_PoolData##POOLTYPE; \