Skip to content
Permalink
Browse files

Fix compile warnings in client core

  • Loading branch information...
ccw808 committed Oct 27, 2019
1 parent c461a6c commit c2138f2ad2f514f5f296eb60ed3a7a05f0b74355
@@ -17,8 +17,6 @@ using std::list;
extern CCore* g_pCore;
extern bool g_bBoundsChecker;

#define MTA_HELP_SPACING 32

void CCommandFuncs::Help(const char* szParameters)
{
CConsoleInterface* pConsole = g_pCore->GetConsole();
@@ -33,22 +31,9 @@ void CCommandFuncs::Help(const char* szParameters)
// Loop through all the available commands
list<COMMANDENTRY*>::iterator iter = CCommands::GetSingletonPtr()->IterBegin();
list<COMMANDENTRY*>::iterator iterEnd = CCommands::GetSingletonPtr()->IterEnd();

char spacer[MTA_HELP_SPACING + 1];
for (; iter != iterEnd; iter++)
{
const char* szCommandName = (*iter)->szCommandName;
const char* szDescription = (*iter)->szDescription;

// Space out the name and description evenly (tab-like)
unsigned char spacing = MTA_HELP_SPACING - strlen(szCommandName);
if (spacing <= 0)
spacing = 1;

memset(&spacer[0], ' ', MTA_HELP_SPACING);
spacer[spacing] = NULL;

pConsole->Printf("* %s%s%s\n", (*iter)->szCommandName, &spacer[0], (*iter)->szDescription);
pConsole->Printf("* %-31s %s\n", (*iter)->szCommandName, (*iter)->szDescription);
}

pConsole->Printf("***[--------------]***\n");
@@ -2337,7 +2337,7 @@ void CSettings::ProcessKeyBinds()
for (int i = 0; i < m_pBindsList->GetRowCount(); i++)
{
// Get the type and keys
unsigned char ucType = reinterpret_cast<unsigned char>(m_pBindsList->GetItemData(i, m_hBind));
unsigned char ucType = reinterpret_cast<unsigned int>(m_pBindsList->GetItemData(i, m_hBind));
const char* szPri = m_pBindsList->GetItemText(i, m_hPriKey);
const SBindableKey* pPriKey = pKeyBinds->GetBindableFromKey(szPri);
const SBindableKey* pSecKeys[SecKeyNum];
@@ -240,17 +240,17 @@ bool CPixelsManager::GetSurfacePixels(IDirect3DSurface9* pD3DSurface, CPixels& o
D3DSURFACE_DESC SurfDesc;
pD3DSurface->GetDesc(&SurfDesc);

POINT SurfSize = {SurfDesc.Width, SurfDesc.Height};
RECT SurfRect = {0, 0, SurfDesc.Width, SurfDesc.Height};
POINT SurfSize = {static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
RECT SurfRect = {0, 0, static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
if (pRect)
SurfRect = *pRect;

// Calc pixels rect
uint uiPixelsWidth = GetRectWidth(SurfRect);
uint uiPixelsHeight = GetRectHeight(SurfRect);

POINT PixelsSize = {uiPixelsWidth, uiPixelsHeight};
RECT PixelsRect = {0, 0, uiPixelsWidth, uiPixelsHeight};
POINT PixelsSize = {static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};
RECT PixelsRect = {0, 0, static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};

// Validate rects
if (!ClipRects(PixelsSize, PixelsRect, SurfSize, SurfRect))
@@ -371,8 +371,8 @@ bool CPixelsManager::SetSurfacePixels(IDirect3DSurface9* pD3DSurface, const CPix
D3DSURFACE_DESC SurfDesc;
pD3DSurface->GetDesc(&SurfDesc);

POINT SurfSize = {SurfDesc.Width, SurfDesc.Height};
RECT SurfRect = {0, 0, SurfDesc.Width, SurfDesc.Height};
POINT SurfSize = {static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
RECT SurfRect = {0, 0, static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
if (pRect)
SurfRect = *pRect;

@@ -381,8 +381,8 @@ bool CPixelsManager::SetSurfacePixels(IDirect3DSurface9* pD3DSurface, const CPix
if (!GetPlainDimensions(pixels, uiPixelsWidth, uiPixelsHeight))
return false;

POINT PixelsSize = {uiPixelsWidth, uiPixelsHeight};
RECT PixelsRect = {0, 0, uiPixelsWidth, uiPixelsHeight};
POINT PixelsSize = {static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};
RECT PixelsRect = {0, 0, static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};

// Validate rects
if (!ClipRects(PixelsSize, PixelsRect, SurfSize, SurfRect))
@@ -112,17 +112,17 @@ bool CPixelsManager::GetVolumePixels(IDirect3DVolume9* pD3DSurface, CPixels& out
D3DVOLUME_DESC SurfDesc;
pD3DSurface->GetDesc(&SurfDesc);

POINT SurfSize = {SurfDesc.Width, SurfDesc.Height};
RECT SurfRect = {0, 0, SurfDesc.Width, SurfDesc.Height};
POINT SurfSize = {static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
RECT SurfRect = {0, 0, static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
if (pRect)
SurfRect = *pRect;

// Calc pixels rect
uint uiPixelsWidth = GetRectWidth(SurfRect);
uint uiPixelsHeight = GetRectHeight(SurfRect);

POINT PixelsSize = {uiPixelsWidth, uiPixelsHeight};
RECT PixelsRect = {0, 0, uiPixelsWidth, uiPixelsHeight};
POINT PixelsSize = {static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};
RECT PixelsRect = {0, 0, static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};

// Validate rects
if (!ClipRects(PixelsSize, PixelsRect, SurfSize, SurfRect))
@@ -243,8 +243,8 @@ bool CPixelsManager::SetVolumePixels(IDirect3DVolume9* pD3DSurface, const CPixel
D3DVOLUME_DESC SurfDesc;
pD3DSurface->GetDesc(&SurfDesc);

POINT SurfSize = {SurfDesc.Width, SurfDesc.Height};
RECT SurfRect = {0, 0, SurfDesc.Width, SurfDesc.Height};
POINT SurfSize = {static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
RECT SurfRect = {0, 0, static_cast<int>(SurfDesc.Width), static_cast<int>(SurfDesc.Height)};
if (pRect)
SurfRect = *pRect;

@@ -253,8 +253,8 @@ bool CPixelsManager::SetVolumePixels(IDirect3DVolume9* pD3DSurface, const CPixel
if (!GetPlainDimensions(pixels, uiPixelsWidth, uiPixelsHeight))
return false;

POINT PixelsSize = {uiPixelsWidth, uiPixelsHeight};
RECT PixelsRect = {0, 0, uiPixelsWidth, uiPixelsHeight};
POINT PixelsSize = {static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};
RECT PixelsRect = {0, 0, static_cast<int>(uiPixelsWidth), static_cast<int>(uiPixelsHeight)};

// Validate rects
if (!ClipRects(PixelsSize, PixelsRect, SurfSize, SurfRect))

0 comments on commit c2138f2

Please sign in to comment.
You can’t perform that action at this time.