Rémi Bernon (@rbernon) commented about dlls/dmime/performance.c:
- memset(&format, 0, sizeof(format));
- format.wFormatTag = WAVE_FORMAT_PCM;
- format.nChannels = 1;
- format.nSamplesPerSec = 44000;
- format.nAvgBytesPerSec = 44000*2;
- format.nBlockAlign = 2;
- format.wBitsPerSample = 16;
- format.cbSize = 0;
- memset(&desc, 0, sizeof(desc));
- desc.dwSize = sizeof(desc);
- desc.dwFlags = DSBCAPS_CTRLFX | DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS;
- desc.dwBufferBytes = DSBSIZE_MIN;
- desc.dwReserved = 0;
- desc.lpwfxFormat = &format;
- desc.guid3DAlgorithm = GUID_NULL;
Imo these static initializations are better done in struct initializers, with designated initialization to make it readable. Anything that's not set will be zero-initialized and can be omitted.