forked from Mirrors/openclonk
Silence some spurious compiler warnings about partially initialized structures.
parent
15a1a62521
commit
e5814f8841
|
@ -271,8 +271,7 @@ namespace {
|
|||
if (SymInitialize(process, 0, true))
|
||||
{
|
||||
LOG_STATIC_TEXT("\nStack trace:\n");
|
||||
STACKFRAME64 frame;
|
||||
memset(&frame, 0, sizeof(STACKFRAME64));
|
||||
auto frame = STACKFRAME64();
|
||||
DWORD image_type;
|
||||
CONTEXT context = *exc->ContextRecord;
|
||||
// Setup frame info
|
||||
|
@ -439,8 +438,8 @@ LONG WINAPI GenerateDump(EXCEPTION_POINTERS* pExceptionPointers)
|
|||
|
||||
if (file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
MINIDUMP_USER_STREAM_INFORMATION user_stream_info = {0};
|
||||
MINIDUMP_USER_STREAM user_stream = {0};
|
||||
auto user_stream_info = MINIDUMP_USER_STREAM_INFORMATION();
|
||||
auto user_stream = MINIDUMP_USER_STREAM();
|
||||
char build_id[] = OC_BUILD_ID;
|
||||
if (OC_BUILD_ID[0] != '\0')
|
||||
{
|
||||
|
@ -544,7 +543,7 @@ namespace {
|
|||
return FALSE;
|
||||
|
||||
// Get thread info
|
||||
CONTEXT ctx = {0};
|
||||
auto ctx = CONTEXT();
|
||||
#ifndef CONTEXT_ALL
|
||||
#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \
|
||||
CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS)
|
||||
|
@ -553,7 +552,7 @@ namespace {
|
|||
BOOL result = GetThreadContext(data->thread, &ctx);
|
||||
|
||||
// Setup a fake exception to log
|
||||
EXCEPTION_RECORD erec = {0};
|
||||
auto erec = EXCEPTION_RECORD();
|
||||
erec.ExceptionCode = STATUS_ASSERTION_FAILURE;
|
||||
erec.ExceptionFlags = 0L;
|
||||
erec.ExceptionInformation[0] = (ULONG_PTR)data->expression;
|
||||
|
|
|
@ -167,7 +167,7 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
case WM_CHAR:
|
||||
{
|
||||
// UTF-8 has 1 to 4 data bytes, and we need a terminating \0
|
||||
char c[5] = {0};
|
||||
char c[5] = {0,0,0,0,0};
|
||||
if(!WideCharToMultiByte(CP_UTF8, 0L, reinterpret_cast<LPCWSTR>(&wParam), 1, c, 4, 0, 0))
|
||||
return 0;
|
||||
// GUI: forward
|
||||
|
@ -574,7 +574,7 @@ C4Window * C4Window::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp,
|
|||
else if (windowKind == W_Fullscreen)
|
||||
{
|
||||
// Register window class
|
||||
WNDCLASSEXW WndClass = {0};
|
||||
auto WndClass = WNDCLASSEXW();
|
||||
WndClass.cbSize = sizeof(WNDCLASSEX);
|
||||
WndClass.style = CS_DBLCLKS;
|
||||
WndClass.lpfnWndProc = FullScreenWinProc;
|
||||
|
|
|
@ -458,7 +458,7 @@ bool FileExists(const char *szFilename)
|
|||
size_t FileSize(const char *szFilename)
|
||||
{
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
WIN32_FILE_ATTRIBUTE_DATA attributes = {0};
|
||||
auto attributes = WIN32_FILE_ATTRIBUTE_DATA();
|
||||
if (GetFileAttributesEx(GetWideChar(szFilename), GetFileExInfoStandard, &attributes) == 0)
|
||||
return 0;
|
||||
#ifdef _WIN64
|
||||
|
@ -488,7 +488,7 @@ size_t FileSize(int fdes)
|
|||
int FileTime(const char *szFilename)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WIN32_FILE_ATTRIBUTE_DATA attributes = {0};
|
||||
auto attributes = WIN32_FILE_ATTRIBUTE_DATA();
|
||||
if (GetFileAttributesEx(GetWideChar(szFilename), GetFileExInfoStandard, &attributes) == 0)
|
||||
return 0;
|
||||
int64_t ft = (static_cast<int64_t>(attributes.ftLastWriteTime.dwHighDateTime) << (sizeof(attributes.ftLastWriteTime.dwLowDateTime) * 8)) | attributes.ftLastWriteTime.dwLowDateTime;
|
||||
|
@ -968,7 +968,7 @@ void DirectoryIterator::Read(const char *dirname)
|
|||
std::string search_path(dirname);
|
||||
search_path.push_back(DirectorySeparator);
|
||||
#ifdef WIN32
|
||||
WIN32_FIND_DATAW file = {0};
|
||||
auto file = WIN32_FIND_DATAW();
|
||||
HANDLE fh = FindFirstFileW(GetWideChar((search_path + '*').c_str()), &file);
|
||||
if (fh == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue