DSoundHelpers: use sizeof(DSBUFFERDESC) rather than sizeof(variable)

Microsoft documentation and samples always use sizeof(DSBUFFERDESC), not sizeof(variable).
This commit is contained in:
sukibaby
2025-06-11 07:36:13 -07:00
committed by teejusb
parent b933347374
commit 8f2076eea1
+2 -2
View File
@@ -45,7 +45,7 @@ void DSound::SetPrimaryBufferMode()
{ {
DSBUFFERDESC format; DSBUFFERDESC format;
memset( &format, 0, sizeof(format) ); memset( &format, 0, sizeof(format) );
format.dwSize = sizeof(format); format.dwSize = sizeof(DSBUFFERDESC);
format.dwFlags = DSBCAPS_PRIMARYBUFFER; format.dwFlags = DSBCAPS_PRIMARYBUFFER;
format.dwBufferBytes = 0; format.dwBufferBytes = 0;
format.lpwfxFormat = nullptr; format.lpwfxFormat = nullptr;
@@ -219,7 +219,7 @@ RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware,
/* Try to create the secondary buffer */ /* Try to create the secondary buffer */
DSBUFFERDESC format; DSBUFFERDESC format;
memset( &format, 0, sizeof(format) ); memset( &format, 0, sizeof(format) );
format.dwSize = sizeof(format); format.dwSize = sizeof(DSBUFFERDESC);
if (IsWindowsVistaOrGreater()) if (IsWindowsVistaOrGreater())
{ {