Fix some unused variables and integer type conversions.

Controls
Sven Eberhardt 2015-09-01 22:18:39 -04:00
parent e5814f8841
commit 7d9f7aee02
5 changed files with 9 additions and 16 deletions

View File

@ -715,6 +715,7 @@ void C4ConsoleGUI::DisplayInfoText(C4ConsoleGUI::InfoTextType type, StdStrBuf& t
break;
default:
assert(false);
return;
}
SetDlgItemTextW(hWindow,dialog_item,text.GetWideChar());
UpdateWindow(GetDlgItem(hWindow,dialog_item));

View File

@ -154,7 +154,7 @@ static void crash_handler(int signo, siginfo_t * si, void *)
case SIGTERM: write(logfd, "SIGTERM", sizeof ("SIGTERM") - 1); break;
}
char hex[sizeof(void *) * 2];
int i; intptr_t x = reinterpret_cast<intptr_t>(si->si_addr);
intptr_t x = reinterpret_cast<intptr_t>(si->si_addr);
switch (signo)
{
case SIGILL: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGTRAP:

View File

@ -172,7 +172,7 @@ namespace {
LOG_DYNAMIC_TEXT("Additional information for the exception:\n Assertion that failed: " ASSERTION_INFO_FORMAT "\n File: " ASSERTION_INFO_FORMAT "\n Line: %d\n",
reinterpret_cast<ASSERTION_INFO_TYPE>(exc->ExceptionRecord->ExceptionInformation[0]),
reinterpret_cast<ASSERTION_INFO_TYPE>(exc->ExceptionRecord->ExceptionInformation[1]),
exc->ExceptionRecord->ExceptionInformation[2]);
(int) exc->ExceptionRecord->ExceptionInformation[2]);
break;
}
@ -317,11 +317,11 @@ namespace {
}
else if (image_base > 0)
{
LOG_DYNAMIC_TEXT("+%#lx", static_cast<size_t>(frame.AddrPC.Offset - image_base));
LOG_DYNAMIC_TEXT("+%#lx", static_cast<long>(frame.AddrPC.Offset - image_base));
}
else
{
LOG_DYNAMIC_TEXT("%#lx", static_cast<size_t>(frame.AddrPC.Offset));
LOG_DYNAMIC_TEXT("%#lx", static_cast<long>(frame.AddrPC.Offset));
}
DWORD disp;
line->SizeOfStruct = sizeof(*line);

View File

@ -708,7 +708,7 @@ bool C4Window::RestorePosition(const char *szWindowName, const char *szSubKey, b
void C4Window::SetTitle(const char *szToTitle)
{
if (hWindow) SetWindowTextW(hWindow, szToTitle ? GetWideChar(szToTitle) : L"");
if (hWindow) SetWindowTextW(hWindow, (!szToTitle) ? L"" : GetWideChar(szToTitle));
}
bool C4Window::GetSize(C4Rect * pRect)
@ -727,7 +727,7 @@ void C4Window::SetSize(unsigned int cx, unsigned int cy)
if (hWindow)
{
// If bordered, add border size
RECT rect = {0, 0, cx, cy};
RECT rect = { 0, 0, static_cast<LONG>(cx), static_cast<LONG>(cy) };
::AdjustWindowRectEx(&rect, GetWindowLong(hWindow, GWL_STYLE), FALSE, GetWindowLong(hWindow, GWL_EXSTYLE));
cx = rect.right - rect.left;
cy = rect.bottom - rect.top;
@ -828,7 +828,7 @@ bool C4AbstractApp::FlushMessages()
void C4AbstractApp::SetLastErrorFromOS()
{
LPWSTR buffer = 0;
DWORD rv = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
0, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPWSTR>(&buffer), 0, 0);
sLastError.Take(StdStrBuf(buffer));
LocalFree(buffer);
@ -925,7 +925,7 @@ bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigne
SetLastErrorFromOS();
return false;
}
int orientation = dmode.dmDisplayOrientation;
unsigned long orientation = dmode.dmDisplayOrientation;
if (iXRes == -1 && iYRes == -1)
{
dspMode=dmode;

View File

@ -20,14 +20,6 @@
#include "C4Include.h"
#include <StdJoystick.h>
static uint32_t dwStdGamepadAxis1 = 0;
static uint32_t dwStdGamepadAxis2 = 1;
static uint32_t dwStdGamepadMaxX = 0;
static uint32_t dwStdGamepadMinX = 0;
static uint32_t dwStdGamepadMaxY = 0;
static uint32_t dwStdGamepadMinY = 0;
#include <C4windowswrapper.h>
#include <windowsx.h>