From 1f6d4bcfd316782cc45150c3277b8e50decd8c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 9 May 2013 16:03:38 +0200 Subject: [PATCH] echo: fixes 64 bit warnings --- .../kernel/drivers/audio/echo/midi.cpp | 6 +++-- .../kernel/drivers/audio/echo/multi.cpp | 25 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/echo/midi.cpp b/src/add-ons/kernel/drivers/audio/echo/midi.cpp index d10d16dd55..f90302f56a 100644 --- a/src/add-ons/kernel/drivers/audio/echo/midi.cpp +++ b/src/add-ons/kernel/drivers/audio/echo/midi.cpp @@ -131,13 +131,15 @@ midi_read(void* cookie, off_t pos, void* ptr, size_t* nread) static status_t -midi_write(void* cookie, off_t pos, const void* ptr, size_t* nwritten) +midi_write(void* cookie, off_t pos, const void* ptr, size_t* _nwritten) { echo_dev *card = (echo_dev *) cookie; ECHOSTATUS err; + DWORD nwritten = *_nwritten; LOG(("midi_write()\n")); - err = card->pEG->WriteMidi(*nwritten, (PBYTE)ptr, nwritten); + err = card->pEG->WriteMidi(nwritten, (PBYTE)ptr, &nwritten); + *_nwritten = nwritten; return (err != ECHOSTATUS_OK) ? B_ERROR : B_OK; } diff --git a/src/add-ons/kernel/drivers/audio/echo/multi.cpp b/src/add-ons/kernel/drivers/audio/echo/multi.cpp index ffd364c897..9388550161 100644 --- a/src/add-ons/kernel/drivers/audio/echo/multi.cpp +++ b/src/add-ons/kernel/drivers/audio/echo/multi.cpp @@ -97,8 +97,8 @@ echo_channel_get_mix(void *card, MIXER_AUDIO_CHANNEL channel, int32 type, float } else { values[0] = function[0].Data.iNominal == 4 ? 1.0 : 0.0; } - PRINT(("echo_channel_get_mix iLevel: %ld, %d, %ld\n", function[0].Data.iLevel, - channel.wChannel, channel.dwType)); + PRINT(("echo_channel_get_mix iLevel: %" B_PRId32 ", %d, %" B_PRIu32 + "\n", function[0].Data.iLevel, channel.wChannel, channel.dwType)); } } @@ -134,8 +134,8 @@ echo_channel_set_mix(void *card, MIXER_AUDIO_CHANNEL channel, int32 type, float dev->pEG->ProcessMixerMultiFunction(multi_function, size); if (function[0].RtnStatus == ECHOSTATUS_OK) { - PRINT(("echo_channel_set_mix OK: %ld, %d, %ld\n", function[0].Data.iLevel, - channel.wChannel, channel.dwType)); + PRINT(("echo_channel_set_mix OK: %" B_PRId32 ", %d, %" B_PRIu32 "\n", + function[0].Data.iLevel, channel.wChannel, channel.dwType)); } } @@ -242,7 +242,7 @@ echo_create_controls_list(multi_dev *multi) } multi->control_count = index; - PRINT(("multi->control_count %lu\n", multi->control_count)); + PRINT(("multi->control_count %" B_PRIu32 "\n", multi->control_count)); return B_OK; } @@ -256,7 +256,8 @@ echo_get_mix(echo_dev *card, multi_mix_value_info * mmvi) for (i = 0; i < mmvi->item_count; i++) { id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID; if (id < 0 || id >= card->multi.control_count) { - PRINT(("echo_get_mix : invalid control id requested : %li\n", id)); + PRINT(("echo_get_mix : invalid control id requested : %" B_PRIu32 + "\n", id)); continue; } control = &card->multi.controls[id]; @@ -297,7 +298,8 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * mmvi) for (i = 0; i < mmvi->item_count; i++) { id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID; if (id < 0 || id >= card->multi.control_count) { - PRINT(("echo_set_mix : invalid control id requested : %li\n", id)); + PRINT(("echo_set_mix : invalid control id requested : %" B_PRIu32 + "\n", id)); continue; } control = &card->multi.controls[id]; @@ -307,7 +309,8 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * mmvi) if (i + 1 < mmvi->item_count) { id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID; if (id < 0 || id >= card->multi.control_count) { - PRINT(("echo_set_mix : invalid control id requested : %li\n", id)); + PRINT(("echo_set_mix : invalid control id requested : %" + B_PRIu32 "\n", id)); } else { control2 = &card->multi.controls[id]; if (control2->mix_control.master != control->mix_control.id) @@ -995,21 +998,21 @@ echo_open(const char *name, uint32 flags, void** cookie) value = strtoul (item, &end, 0); if (*end == '\0') current_settings.sample_rate = value; } - PRINT(("sample_rate %lu\n", current_settings.sample_rate)); + PRINT(("sample_rate %" B_PRIu32 "\n", current_settings.sample_rate)); item = get_driver_parameter (settings_handle, "buffer_frames", NULL, NULL); if (item) { value = strtoul (item, &end, 0); if (*end == '\0') current_settings.buffer_frames = value; } - PRINT(("buffer_frames %lu\n", current_settings.buffer_frames)); + PRINT(("buffer_frames %" B_PRIu32 "\n", current_settings.buffer_frames)); item = get_driver_parameter (settings_handle, "buffer_count", NULL, NULL); if (item) { value = strtoul (item, &end, 0); if (*end == '\0') current_settings.buffer_count = value; } - PRINT(("buffer_count %lu\n", current_settings.buffer_count)); + PRINT(("buffer_count %" B_PRId32 "\n", current_settings.buffer_count)); unload_driver_settings (settings_handle); }