avoiding as much as possible long types in unixlib part
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/winepulse.drv/mmdevdrv.c | 2 +- dlls/winepulse.drv/pulse.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 18009435f1f2..e97a04d6a8d7 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -250,7 +250,7 @@ typedef struct tagLANGANDCODEPAGE WORD wCodePage; } LANGANDCODEPAGE;
-static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, DWORD *len) +static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, UINT *len) { WCHAR pn[37]; swprintf(pn, ARRAY_SIZE(pn), L"\StringFileInfo\%04x%04x\ProductName", lang->wLanguage, lang->wCodePage); diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index f685e2047e74..6309a27f42b0 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -87,7 +87,7 @@ typedef struct _PhysDevice { enum phys_device_bus_type bus_type; USHORT vendor_id, product_id; EndpointFormFactor form; - DWORD channel_mask; + UINT channel_mask; UINT index; char pulse_name[0]; } PhysDevice; @@ -252,7 +252,7 @@ static NTSTATUS pulse_get_endpoint_ids(void *args) struct get_endpoint_ids_params *params = args; struct list *list = (params->flow == eRender) ? &g_phys_speakers : &g_phys_sources; struct endpoint *endpoint = params->endpoints; - DWORD len, name_len, needed; + size_t len, name_len, needed; unsigned int offset; PhysDevice *dev;
@@ -393,10 +393,10 @@ fail: return E_FAIL; }
-static DWORD pulse_channel_map_to_channel_mask(const pa_channel_map *map) +static UINT pulse_channel_map_to_channel_mask(const pa_channel_map *map) { int i; - DWORD mask = 0; + UINT mask = 0;
for (i = 0; i < map->channels; ++i) { switch (map->map[i]) { @@ -452,9 +452,9 @@ static void fill_device_info(PhysDevice *dev, pa_proplist *p) }
static void pulse_add_device(struct list *list, pa_proplist *proplist, int index, EndpointFormFactor form, - DWORD channel_mask, const char *pulse_name, const char *name) + UINT channel_mask, const char *pulse_name, const char *name) { - DWORD len = strlen(pulse_name), name_len = strlen(name); + size_t len = strlen(pulse_name), name_len = strlen(name); PhysDevice *dev = malloc(FIELD_OFFSET(PhysDevice, pulse_name[len + 1])); WCHAR *wname;
@@ -485,7 +485,7 @@ static void pulse_add_device(struct list *list, pa_proplist *proplist, int index static void pulse_phys_speakers_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) { struct list *speaker; - DWORD channel_mask; + UINT channel_mask;
if (!i || !i->name || !i->name[0]) return; @@ -516,7 +516,7 @@ static void pulse_phys_sources_cb(pa_context *c, const pa_source_info *i, int eo * would report for a given channel layout. */ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIBLE *fmt) { - DWORD pa_mask = pulse_channel_map_to_channel_mask(pa_map); + UINT pa_mask = pulse_channel_map_to_channel_mask(pa_map);
TRACE("got mask for PA: 0x%x\n", pa_mask);
@@ -772,7 +772,7 @@ fail: return STATUS_SUCCESS; }
-static DWORD get_channel_mask(unsigned int channels) +static UINT get_channel_mask(unsigned int channels) { switch(channels) { case 0: @@ -845,8 +845,8 @@ static HRESULT pulse_spec_from_waveformat(struct pulse_stream *stream, const WAV break; case WAVE_FORMAT_EXTENSIBLE: { WAVEFORMATEXTENSIBLE *wfe = (WAVEFORMATEXTENSIBLE*)fmt; - DWORD mask = wfe->dwChannelMask; - DWORD i = 0, j; + UINT mask = wfe->dwChannelMask; + unsigned i = 0, j; if (fmt->cbSize != (sizeof(*wfe) - sizeof(*fmt)) && fmt->cbSize != sizeof(*wfe)) break; if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) &&
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/winepulse.drv/Makefile.in | 1 - dlls/winepulse.drv/mmdevdrv.c | 40 ++++++++++++++++++++-------------------- dlls/winepulse.drv/pulse.c | 6 +++--- 3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in index d4b40e666442..39ed860676e6 100644 --- a/dlls/winepulse.drv/Makefile.in +++ b/dlls/winepulse.drv/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winepulse.drv UNIXLIB = winepulse.so IMPORTS = dxguid uuid winmm user32 advapi32 ole32 version diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index e97a04d6a8d7..3cbbc1d8115e 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -403,7 +403,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name status = RegCreateKeyExW(drv_key, key_name, 0, NULL, 0, KEY_READ | KEY_WRITE | KEY_WOW64_64KEY, NULL, &dev_key, NULL); if (status != ERROR_SUCCESS) { - ERR("Failed to open registry key for device %s: %u\n", pulse_name, status); + ERR("Failed to open registry key for device %s: %lu\n", pulse_name, status); CoCreateGuid(guid); return; } @@ -413,7 +413,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name CoCreateGuid(guid); status = RegSetValueExW(dev_key, L"guid", 0, REG_BINARY, (BYTE*)guid, sizeof(*guid)); if (status != ERROR_SUCCESS) - ERR("Failed to store device GUID for %s to registry: %u\n", pulse_name, status); + ERR("Failed to store device GUID for %s to registry: %lu\n", pulse_name, status); } RegCloseKey(dev_key); } @@ -452,7 +452,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **ke status = RegCreateKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, NULL, 0, KEY_WRITE | KEY_WOW64_64KEY, NULL, &drv_key, NULL); if (status != ERROR_SUCCESS) { - ERR("Failed to open devices registry key: %u\n", status); + ERR("Failed to open devices registry key: %lu\n", status); drv_key = NULL; }
@@ -658,7 +658,7 @@ static ULONG WINAPI AudioClient_AddRef(IAudioClient3 *iface) ACImpl *This = impl_from_IAudioClient3(iface); ULONG ref; ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); return ref; }
@@ -667,7 +667,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) ACImpl *This = impl_from_IAudioClient3(iface); ULONG ref; ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) { if (This->pulse_stream) { pulse_release_stream(This->pulse_stream, This->timer); @@ -703,15 +703,15 @@ static void dump_fmt(const WAVEFORMATEX *fmt) TRACE(")\n");
TRACE("nChannels: %u\n", fmt->nChannels); - TRACE("nSamplesPerSec: %u\n", fmt->nSamplesPerSec); - TRACE("nAvgBytesPerSec: %u\n", fmt->nAvgBytesPerSec); + TRACE("nSamplesPerSec: %lu\n", fmt->nSamplesPerSec); + TRACE("nAvgBytesPerSec: %lu\n", fmt->nAvgBytesPerSec); TRACE("nBlockAlign: %u\n", fmt->nBlockAlign); TRACE("wBitsPerSample: %u\n", fmt->wBitsPerSample); TRACE("cbSize: %u\n", fmt->cbSize);
if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt; - TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask); + TRACE("dwChannelMask: %08lx\n", fmtex->dwChannelMask); TRACE("Samples: %04x\n", fmtex->Samples.wReserved); TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat)); } @@ -829,7 +829,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, char *name; HRESULT hr;
- TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, + TRACE("(%p)->(%x, %lx, %s, %s, %p, %s)\n", This, mode, flags, wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid));
if (!fmt) @@ -851,7 +851,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY | AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM)) { - FIXME("Unknown flags: %08x\n", flags); + FIXME("Unknown flags: %08lx\n", flags); return E_INVALIDARG; }
@@ -1128,7 +1128,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface, if (hr == S_OK && exclusive) return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
- TRACE("returning: %08x %p\n", hr, out ? *out : NULL); + TRACE("returning: %08lx %p\n", hr, out ? *out : NULL); return hr; }
@@ -1377,7 +1377,7 @@ static HRESULT WINAPI AudioClient_InitializeSharedAudioStream(IAudioClient3 *ifa { ACImpl *This = impl_from_IAudioClient3(iface);
- FIXME("(%p)->(0x%x, %u, %p, %s)\n", This, flags, period_frames, format, debugstr_guid(session_guid)); + FIXME("(%p)->(0x%lx, %u, %p, %s)\n", This, flags, period_frames, format, debugstr_guid(session_guid));
return E_NOTIMPL; } @@ -1471,7 +1471,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( ACImpl *This = impl_from_IAudioRenderClient(iface); struct release_render_buffer_params params;
- TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); + TRACE("(%p)->(%u, %lx)\n", This, written_frames, flags);
if (!This->pulse_stream) return AUDCLNT_E_NOT_INITIALIZED; @@ -1963,7 +1963,7 @@ static ULONG WINAPI AudioSessionControl_AddRef(IAudioSessionControl2 *iface) AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); ULONG ref; ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); return ref; }
@@ -1972,7 +1972,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface) AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); ULONG ref; ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) { if (This->client) { This->client->session_wrapper = NULL; @@ -2216,7 +2216,7 @@ static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) SessionMgr *This = impl_from_IAudioSessionManager2(iface); ULONG ref; ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); return ref; }
@@ -2225,7 +2225,7 @@ static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) SessionMgr *This = impl_from_IAudioSessionManager2(iface); ULONG ref; ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %u\n", This, ref); + TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) HeapFree(GetProcessHeap(), 0, This); return ref; @@ -2240,7 +2240,7 @@ static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( AudioSessionWrapper *wrapper; HRESULT hr;
- TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), + TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session); @@ -2267,7 +2267,7 @@ static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( AudioSessionWrapper *wrapper; HRESULT hr;
- TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), + TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session); @@ -2648,7 +2648,7 @@ HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARI char pulse_name[MAX_PULSE_NAME_LEN]; DWORD size;
- TRACE("%s, (%s,%u), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out); + TRACE("%s, (%s,%lu), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out);
if (!get_pulse_name_by_guid(guid, pulse_name, ¶ms.flow)) return E_FAIL; diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 6309a27f42b0..1254509f3ce1 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -896,7 +896,7 @@ static HRESULT pulse_spec_from_waveformat(struct pulse_stream *stream, const WAV
if (i < fmt->nChannels || (mask & SPEAKER_RESERVED)) { stream->map.channels = 0; - ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, wfe->dwChannelMask); + ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, (unsigned)wfe->dwChannelMask); break; } break; @@ -1018,7 +1018,7 @@ static NTSTATUS pulse_create_stream(void *args) stream->vol[i] = 1.f;
hr = pulse_spec_from_waveformat(stream, params->fmt); - TRACE("Obtaining format returns %08x\n", hr); + TRACE("Obtaining format returns %08x\n", (unsigned)hr);
if (FAILED(hr)) goto exit; @@ -1984,7 +1984,7 @@ static NTSTATUS pulse_get_latency(void *args) lat = attr->fragsize / pa_frame_size(&stream->ss); *params->latency = (lat * 10000000) / stream->ss.rate + pulse_def_period[0]; pulse_unlock(); - TRACE("Latency: %u ms\n", (DWORD)(*params->latency / 10000)); + TRACE("Latency: %u ms\n", (unsigned)(*params->latency / 10000)); params->result = S_OK; return STATUS_SUCCESS; }
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Wed, May 04, 2022 at 10:22:39AM +0200, Eric Pouech wrote:
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/winepulse.drv/Makefile.in | 1 - dlls/winepulse.drv/mmdevdrv.c | 40 ++++++++++++++++++++-------------------- dlls/winepulse.drv/pulse.c | 6 +++--- 3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in index d4b40e666442..39ed860676e6 100644 --- a/dlls/winepulse.drv/Makefile.in +++ b/dlls/winepulse.drv/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winepulse.drv UNIXLIB = winepulse.so IMPORTS = dxguid uuid winmm user32 advapi32 ole32 version diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index e97a04d6a8d7..3cbbc1d8115e 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -403,7 +403,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name status = RegCreateKeyExW(drv_key, key_name, 0, NULL, 0, KEY_READ | KEY_WRITE | KEY_WOW64_64KEY, NULL, &dev_key, NULL); if (status != ERROR_SUCCESS) {
ERR("Failed to open registry key for device %s: %u\n", pulse_name, status);
}ERR("Failed to open registry key for device %s: %lu\n", pulse_name, status); CoCreateGuid(guid); return;
@@ -413,7 +413,7 @@ static void get_device_guid(HKEY drv_key, EDataFlow flow, const char *pulse_name CoCreateGuid(guid); status = RegSetValueExW(dev_key, L"guid", 0, REG_BINARY, (BYTE*)guid, sizeof(*guid)); if (status != ERROR_SUCCESS)
ERR("Failed to store device GUID for %s to registry: %u\n", pulse_name, status);
} RegCloseKey(dev_key);ERR("Failed to store device GUID for %s to registry: %lu\n", pulse_name, status);
} @@ -452,7 +452,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **ke status = RegCreateKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, NULL, 0, KEY_WRITE | KEY_WOW64_64KEY, NULL, &drv_key, NULL); if (status != ERROR_SUCCESS) {
ERR("Failed to open devices registry key: %u\n", status);
}ERR("Failed to open devices registry key: %lu\n", status); drv_key = NULL;
@@ -658,7 +658,7 @@ static ULONG WINAPI AudioClient_AddRef(IAudioClient3 *iface) ACImpl *This = impl_from_IAudioClient3(iface); ULONG ref; ref = InterlockedIncrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); return ref;
}
@@ -667,7 +667,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) ACImpl *This = impl_from_IAudioClient3(iface); ULONG ref; ref = InterlockedDecrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) { if (This->pulse_stream) { pulse_release_stream(This->pulse_stream, This->timer);
@@ -703,15 +703,15 @@ static void dump_fmt(const WAVEFORMATEX *fmt) TRACE(")\n");
TRACE("nChannels: %u\n", fmt->nChannels);
- TRACE("nSamplesPerSec: %u\n", fmt->nSamplesPerSec);
- TRACE("nAvgBytesPerSec: %u\n", fmt->nAvgBytesPerSec);
TRACE("nSamplesPerSec: %lu\n", fmt->nSamplesPerSec);
TRACE("nAvgBytesPerSec: %lu\n", fmt->nAvgBytesPerSec); TRACE("nBlockAlign: %u\n", fmt->nBlockAlign); TRACE("wBitsPerSample: %u\n", fmt->wBitsPerSample); TRACE("cbSize: %u\n", fmt->cbSize);
if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt;
TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask);
}TRACE("dwChannelMask: %08lx\n", fmtex->dwChannelMask); TRACE("Samples: %04x\n", fmtex->Samples.wReserved); TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat));
@@ -829,7 +829,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, char *name; HRESULT hr;
- TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags,
TRACE("(%p)->(%x, %lx, %s, %s, %p, %s)\n", This, mode, flags, wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid));
if (!fmt)
@@ -851,7 +851,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY | AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM)) {
FIXME("Unknown flags: %08x\n", flags);
}FIXME("Unknown flags: %08lx\n", flags); return E_INVALIDARG;
@@ -1128,7 +1128,7 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface, if (hr == S_OK && exclusive) return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
- TRACE("returning: %08x %p\n", hr, out ? *out : NULL);
- TRACE("returning: %08lx %p\n", hr, out ? *out : NULL); return hr;
}
@@ -1377,7 +1377,7 @@ static HRESULT WINAPI AudioClient_InitializeSharedAudioStream(IAudioClient3 *ifa { ACImpl *This = impl_from_IAudioClient3(iface);
- FIXME("(%p)->(0x%x, %u, %p, %s)\n", This, flags, period_frames, format, debugstr_guid(session_guid));
FIXME("(%p)->(0x%lx, %u, %p, %s)\n", This, flags, period_frames, format, debugstr_guid(session_guid));
return E_NOTIMPL;
} @@ -1471,7 +1471,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( ACImpl *This = impl_from_IAudioRenderClient(iface); struct release_render_buffer_params params;
- TRACE("(%p)->(%u, %x)\n", This, written_frames, flags);
TRACE("(%p)->(%u, %lx)\n", This, written_frames, flags);
if (!This->pulse_stream) return AUDCLNT_E_NOT_INITIALIZED;
@@ -1963,7 +1963,7 @@ static ULONG WINAPI AudioSessionControl_AddRef(IAudioSessionControl2 *iface) AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); ULONG ref; ref = InterlockedIncrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); return ref;
}
@@ -1972,7 +1972,7 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface) AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); ULONG ref; ref = InterlockedDecrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) { if (This->client) { This->client->session_wrapper = NULL;
@@ -2216,7 +2216,7 @@ static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) SessionMgr *This = impl_from_IAudioSessionManager2(iface); ULONG ref; ref = InterlockedIncrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); return ref;
}
@@ -2225,7 +2225,7 @@ static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) SessionMgr *This = impl_from_IAudioSessionManager2(iface); ULONG ref; ref = InterlockedDecrement(&This->ref);
- TRACE("(%p) Refcount now %u\n", This, ref);
- TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) HeapFree(GetProcessHeap(), 0, This); return ref;
@@ -2240,7 +2240,7 @@ static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( AudioSessionWrapper *wrapper; HRESULT hr;
- TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid),
TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session);
@@ -2267,7 +2267,7 @@ static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( AudioSessionWrapper *wrapper; HRESULT hr;
- TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid),
TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session);
@@ -2648,7 +2648,7 @@ HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARI char pulse_name[MAX_PULSE_NAME_LEN]; DWORD size;
- TRACE("%s, (%s,%u), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out);
TRACE("%s, (%s,%lu), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out);
if (!get_pulse_name_by_guid(guid, pulse_name, ¶ms.flow)) return E_FAIL;
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 6309a27f42b0..1254509f3ce1 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -896,7 +896,7 @@ static HRESULT pulse_spec_from_waveformat(struct pulse_stream *stream, const WAV
if (i < fmt->nChannels || (mask & SPEAKER_RESERVED)) { stream->map.channels = 0;
ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, wfe->dwChannelMask);
ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, (unsigned)wfe->dwChannelMask); break; } break;
@@ -1018,7 +1018,7 @@ static NTSTATUS pulse_create_stream(void *args) stream->vol[i] = 1.f;
hr = pulse_spec_from_waveformat(stream, params->fmt);
- TRACE("Obtaining format returns %08x\n", hr);
TRACE("Obtaining format returns %08x\n", (unsigned)hr);
if (FAILED(hr)) goto exit;
@@ -1984,7 +1984,7 @@ static NTSTATUS pulse_get_latency(void *args) lat = attr->fragsize / pa_frame_size(&stream->ss); *params->latency = (lat * 10000000) / stream->ss.rate + pulse_def_period[0]; pulse_unlock();
- TRACE("Latency: %u ms\n", (DWORD)(*params->latency / 10000));
- TRACE("Latency: %u ms\n", (unsigned)(*params->latency / 10000)); params->result = S_OK; return STATUS_SUCCESS;
}
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Wed, May 04, 2022 at 10:22:33AM +0200, Eric Pouech wrote:
avoiding as much as possible long types in unixlib part
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/winepulse.drv/mmdevdrv.c | 2 +- dlls/winepulse.drv/pulse.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 18009435f1f2..e97a04d6a8d7 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -250,7 +250,7 @@ typedef struct tagLANGANDCODEPAGE WORD wCodePage; } LANGANDCODEPAGE;
-static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, DWORD *len) +static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, UINT *len) { WCHAR pn[37]; swprintf(pn, ARRAY_SIZE(pn), L"\StringFileInfo\%04x%04x\ProductName", lang->wLanguage, lang->wCodePage); diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index f685e2047e74..6309a27f42b0 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -87,7 +87,7 @@ typedef struct _PhysDevice { enum phys_device_bus_type bus_type; USHORT vendor_id, product_id; EndpointFormFactor form;
- DWORD channel_mask;
- UINT channel_mask; UINT index; char pulse_name[0];
} PhysDevice; @@ -252,7 +252,7 @@ static NTSTATUS pulse_get_endpoint_ids(void *args) struct get_endpoint_ids_params *params = args; struct list *list = (params->flow == eRender) ? &g_phys_speakers : &g_phys_sources; struct endpoint *endpoint = params->endpoints;
- DWORD len, name_len, needed;
- size_t len, name_len, needed; unsigned int offset; PhysDevice *dev;
@@ -393,10 +393,10 @@ fail: return E_FAIL; }
-static DWORD pulse_channel_map_to_channel_mask(const pa_channel_map *map) +static UINT pulse_channel_map_to_channel_mask(const pa_channel_map *map) { int i;
- DWORD mask = 0;
UINT mask = 0;
for (i = 0; i < map->channels; ++i) { switch (map->map[i]) {
@@ -452,9 +452,9 @@ static void fill_device_info(PhysDevice *dev, pa_proplist *p) }
static void pulse_add_device(struct list *list, pa_proplist *proplist, int index, EndpointFormFactor form,
DWORD channel_mask, const char *pulse_name, const char *name)
UINT channel_mask, const char *pulse_name, const char *name)
{
- DWORD len = strlen(pulse_name), name_len = strlen(name);
- size_t len = strlen(pulse_name), name_len = strlen(name); PhysDevice *dev = malloc(FIELD_OFFSET(PhysDevice, pulse_name[len + 1])); WCHAR *wname;
@@ -485,7 +485,7 @@ static void pulse_add_device(struct list *list, pa_proplist *proplist, int index static void pulse_phys_speakers_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) { struct list *speaker;
- DWORD channel_mask;
UINT channel_mask;
if (!i || !i->name || !i->name[0]) return;
@@ -516,7 +516,7 @@ static void pulse_phys_sources_cb(pa_context *c, const pa_source_info *i, int eo
- would report for a given channel layout. */
static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIBLE *fmt) {
- DWORD pa_mask = pulse_channel_map_to_channel_mask(pa_map);
UINT pa_mask = pulse_channel_map_to_channel_mask(pa_map);
TRACE("got mask for PA: 0x%x\n", pa_mask);
@@ -772,7 +772,7 @@ fail: return STATUS_SUCCESS; }
-static DWORD get_channel_mask(unsigned int channels) +static UINT get_channel_mask(unsigned int channels) { switch(channels) { case 0: @@ -845,8 +845,8 @@ static HRESULT pulse_spec_from_waveformat(struct pulse_stream *stream, const WAV break; case WAVE_FORMAT_EXTENSIBLE: { WAVEFORMATEXTENSIBLE *wfe = (WAVEFORMATEXTENSIBLE*)fmt;
DWORD mask = wfe->dwChannelMask;
DWORD i = 0, j;
UINT mask = wfe->dwChannelMask;
unsigned i = 0, j; if (fmt->cbSize != (sizeof(*wfe) - sizeof(*fmt)) && fmt->cbSize != sizeof(*wfe)) break; if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) &&