Windows: Correct some variable init warnings.

This commit is contained in:
Unknown W. Brackets 2021-02-15 10:20:15 -08:00
parent 4a33b5d4e2
commit 7119011363
5 changed files with 10 additions and 10 deletions

View file

@ -65,7 +65,7 @@ LocalFileLoader::LocalFileLoader(const std::string &filename)
return;
}
LARGE_INTEGER end_offset;
const LARGE_INTEGER zero = { 0 };
const LARGE_INTEGER zero{};
if (SetFilePointerEx(handle_, zero, &end_offset, FILE_END) == 0) {
// Couldn't seek in the file. Close it and give up? This should never happen.
CloseHandle(handle_);

View file

@ -106,8 +106,8 @@ AudioFormatTransform g_AudioFormats[] = {
const int g_cVideoFormats = ARRAYSIZE(g_VideoFormats);
const int g_cAudioFormats = ARRAYSIZE(g_AudioFormats);
MediaParam defaultVideoParam = { 640, 480, 0, MFVideoFormat_RGB24 };
MediaParam defaultAudioParam = { 44100, 2, 16, MFAudioFormat_PCM };
MediaParam defaultVideoParam = { { 640, 480, 0, MFVideoFormat_RGB24 } };
MediaParam defaultAudioParam = { { 44100, 2, 16, MFAudioFormat_PCM } };
HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride);
@ -435,7 +435,7 @@ WindowsCaptureDevice::WindowsCaptureDevice(CAPTUREDEVIDE_TYPE _type) :
errorMessage(""),
state(CAPTUREDEVIDE_STATE::UNINITIALIZED) {
param = { 0 };
deviceParam = { 0 };
deviceParam = { { 0 } };
switch (type) {
case CAPTUREDEVIDE_TYPE::VIDEO:

View file

@ -255,7 +255,7 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
{
char temp[256];
int len;
u32 value;
u32 value = -1;
switch (i)
{

View file

@ -336,7 +336,7 @@ void CGEDebugger::UpdatePreviews() {
return;
}
GPUgstate state = {0};
GPUgstate state{};
if (gpuDebug != nullptr) {
state = gpuDebug->GetGState();
@ -487,7 +487,7 @@ void CGEDebugger::PrimaryPreviewHover(int x, int y) {
desc[0] = 0;
} else if (x < 0 || y < 0) {
// This means they left the area.
GPUgstate state = {0};
GPUgstate state{};
if (gpuDebug != nullptr) {
state = gpuDebug->GetGState();
}
@ -515,7 +515,7 @@ void CGEDebugger::SecondPreviewHover(int x, int y) {
desc[0] = 0;
} else if (x < 0 || y < 0) {
// This means they left the area.
GPUgstate state = {0};
GPUgstate state{};
if (gpuDebug != nullptr) {
state = gpuDebug->GetGState();
}
@ -677,7 +677,7 @@ void CGEDebugger::DescribePixelRGBA(u32 pix, GPUDebugBufferFormat fmt, int x, in
}
void CGEDebugger::UpdateTextureLevel(int level) {
GPUgstate state = {0};
GPUgstate state{};
if (gpuDebug != nullptr) {
state = gpuDebug->GetGState();
}

View file

@ -239,7 +239,7 @@ void SimpleGLWindow::Draw(const u8 *data, int w, int h, bool flipped, Format fmt
GLint components = GL_RGBA;
GLint memComponents = 0;
GLenum glfmt;
GLenum glfmt = GL_UNSIGNED_BYTE;
const u8 *finalData = data;
if (fmt == FORMAT_8888) {
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);