summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-04-18 15:39:10 -0700
committerColin Cross <ccross@android.com>2014-04-18 15:48:06 -0700
commitc7b6e3c857c5f5af5f244d0b877c41a9c55f92ab (patch)
tree250e0e922f924a0b3fe77e25b9f5e56b2fecf949 /audio
parent600898287d579c41b77af309f0ab75dbe40c559b (diff)
downloadplatform_hardware_libhardware_legacy-c7b6e3c857c5f5af5f244d0b877c41a9c55f92ab.tar.gz
platform_hardware_libhardware_legacy-c7b6e3c857c5f5af5f244d0b877c41a9c55f92ab.tar.bz2
platform_hardware_libhardware_legacy-c7b6e3c857c5f5af5f244d0b877c41a9c55f92ab.zip
audio: allow compiling for 64-bit
Fix a few 64-bit warnings and set -Wno-unused-parameter, which makes the directory warnings-clean on 32-bit and 64-bit. Remove LOCAL_32_BIT_ONLY. Change-Id: I688b31683f1a6598419866d9b7b6bc27a7056f4a
Diffstat (limited to 'audio')
-rw-r--r--audio/Android.mk6
-rw-r--r--audio/AudioPolicyManagerBase.cpp29
2 files changed, 19 insertions, 16 deletions
diff --git a/audio/Android.mk b/audio/Android.mk
index 36a387a..eaf5a6b 100644
--- a/audio/Android.mk
+++ b/audio/Android.mk
@@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := libaudiohw_legacy
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libmedia_helper
-LOCAL_32_BIT_ONLY := true
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_STATIC_LIBRARY)
@@ -31,7 +31,7 @@ endif
LOCAL_STATIC_LIBRARIES := libmedia_helper
LOCAL_MODULE := libaudiopolicy_legacy
LOCAL_MODULE_TAGS := optional
-LOCAL_32_BIT_ONLY := true
+LOCAL_CFLAGS += -Wno-unused-parameter
include $(BUILD_STATIC_LIBRARY)
@@ -56,7 +56,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
LOCAL_MODULE := audio_policy.default
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
-LOCAL_32_BIT_ONLY := true
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_SHARED_LIBRARY)
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index 9674adc..af24dbd 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -31,13 +31,16 @@
// active output devices in isStreamActiveRemotely()
#define APM_AUDIO_OUT_DEVICE_REMOTE_ALL AUDIO_DEVICE_OUT_REMOTE_SUBMIX
+#include <inttypes.h>
+#include <math.h>
+
+#include <cutils/properties.h>
#include <utils/Log.h>
-#include <hardware_legacy/AudioPolicyManagerBase.h>
-#include <hardware/audio_effect.h>
+
#include <hardware/audio.h>
-#include <math.h>
+#include <hardware/audio_effect.h>
#include <hardware_legacy/audio_policy_conf.h>
-#include <cutils/properties.h>
+#include <hardware_legacy/AudioPolicyManagerBase.h>
namespace android_audio_legacy {
@@ -94,7 +97,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(audio_devices_t device
if (checkOutputsForDevice(device, state, outputs) != NO_ERROR) {
return INVALID_OPERATION;
}
- ALOGV("setDeviceConnectionState() checkOutputsForDevice() returned %d outputs",
+ ALOGV("setDeviceConnectionState() checkOutputsForDevice() returned %zu outputs",
outputs.size());
// register new device as available
mAvailableOutputDevices = (audio_devices_t)(mAvailableOutputDevices | device);
@@ -1170,7 +1173,7 @@ audio_io_handle_t AudioPolicyManagerBase::selectOutputForEffects(
for (size_t i = 0; i < outputs.size(); i++) {
AudioOutputDescriptor *desc = mOutputs.valueFor(outputs[i]);
- ALOGV("selectOutputForEffects outputs[%d] flags %x", i, desc->mFlags);
+ ALOGV("selectOutputForEffects outputs[%zu] flags %x", i, desc->mFlags);
if ((desc->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
outputOffloaded = outputs[i];
}
@@ -1403,7 +1406,7 @@ status_t AudioPolicyManagerBase::dump(int fd)
snprintf(buffer, SIZE, "\nHW Modules dump:\n");
write(fd, buffer, strlen(buffer));
for (size_t i = 0; i < mHwModules.size(); i++) {
- snprintf(buffer, SIZE, "- HW Module %d:\n", i + 1);
+ snprintf(buffer, SIZE, "- HW Module %zu:\n", i + 1);
write(fd, buffer, strlen(buffer));
mHwModules[i]->dump(fd);
}
@@ -1430,7 +1433,7 @@ status_t AudioPolicyManagerBase::dump(int fd)
" Stream Can be muted Index Min Index Max Index Cur [device : index]...\n");
write(fd, buffer, strlen(buffer));
for (size_t i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
- snprintf(buffer, SIZE, " %02d ", i);
+ snprintf(buffer, SIZE, " %02zu ", i);
write(fd, buffer, strlen(buffer));
mStreams[i].dump(fd);
}
@@ -1457,7 +1460,7 @@ status_t AudioPolicyManagerBase::dump(int fd)
bool AudioPolicyManagerBase::isOffloadSupported(const audio_offload_info_t& offloadInfo)
{
ALOGV("isOffloadSupported: SR=%u, CM=0x%x, Format=0x%x, StreamType=%d,"
- " BitRate=%u, duration=%lld us, has_video=%d",
+ " BitRate=%u, duration=%" PRId64 " us, has_video=%d",
offloadInfo.sample_rate, offloadInfo.channel_mask,
offloadInfo.format,
offloadInfo.stream_type, offloadInfo.bit_rate, offloadInfo.duration_us,
@@ -1841,7 +1844,7 @@ status_t AudioPolicyManagerBase::checkOutputsForDevice(audio_devices_t device,
for (size_t j = 0; j < mHwModules[i]->mOutputProfiles.size(); j++)
{
if (mHwModules[i]->mOutputProfiles[j]->mSupportedDevices & device) {
- ALOGV("checkOutputsForDevice(): adding profile %d from module %d", j, i);
+ ALOGV("checkOutputsForDevice(): adding profile %zu from module %zu", j, i);
profiles.add(mHwModules[i]->mOutputProfiles[j]);
}
}
@@ -1998,7 +2001,7 @@ status_t AudioPolicyManagerBase::checkOutputsForDevice(audio_devices_t device,
IOProfile *profile = mHwModules[i]->mOutputProfiles[j];
if ((profile->mSupportedDevices & device) &&
(profile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT)) {
- ALOGV("checkOutputsForDevice(): clearing direct output profile %d on module %d",
+ ALOGV("checkOutputsForDevice(): clearing direct output profile %zu on module %zu",
j, i);
if (profile->mSamplingRates[0] == 0) {
profile->mSamplingRates.clear();
@@ -3520,7 +3523,7 @@ void AudioPolicyManagerBase::HwModule::dump(int fd)
if (mOutputProfiles.size()) {
write(fd, " - outputs:\n", sizeof(" - outputs:\n"));
for (size_t i = 0; i < mOutputProfiles.size(); i++) {
- snprintf(buffer, SIZE, " output %d:\n", i);
+ snprintf(buffer, SIZE, " output %zu:\n", i);
write(fd, buffer, strlen(buffer));
mOutputProfiles[i]->dump(fd);
}
@@ -3528,7 +3531,7 @@ void AudioPolicyManagerBase::HwModule::dump(int fd)
if (mInputProfiles.size()) {
write(fd, " - inputs:\n", sizeof(" - inputs:\n"));
for (size_t i = 0; i < mInputProfiles.size(); i++) {
- snprintf(buffer, SIZE, " input %d:\n", i);
+ snprintf(buffer, SIZE, " input %zu:\n", i);
write(fd, buffer, strlen(buffer));
mInputProfiles[i]->dump(fd);
}