summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-07-02 14:17:22 -0700
committerGlenn Kasten <gkasten@google.com>2013-07-02 15:11:17 -0700
commit7c5977f0322204240b3d1874a44c1f3911275ae5 (patch)
treecd034a2c8afdb4e33219c0170e63a2429211f921 /media/libmedia/IAudioFlinger.cpp
parent8f13428cb29a9b610a9e9a0f5fea437cd2d3f032 (diff)
downloadframeworks_av-7c5977f0322204240b3d1874a44c1f3911275ae5.zip
frameworks_av-7c5977f0322204240b3d1874a44c1f3911275ae5.tar.gz
frameworks_av-7c5977f0322204240b3d1874a44c1f3911275ae5.tar.bz2
Explicitly compare raw pointers to NULL
Change-Id: Id2c7828a36a6912333465475b21fa87e294c83c7
Diffstat (limited to 'media/libmedia/IAudioFlinger.cpp')
-rw-r--r--media/libmedia/IAudioFlinger.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index e4df77d..6bb7df6 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -365,11 +365,12 @@ public:
const audio_offload_info_t *offloadInfo)
{
Parcel data, reply;
- audio_devices_t devices = pDevices ? *pDevices : (audio_devices_t)0;
- uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
- audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
- audio_channel_mask_t channelMask = pChannelMask ? *pChannelMask : (audio_channel_mask_t)0;
- uint32_t latency = pLatencyMs ? *pLatencyMs : 0;
+ audio_devices_t devices = pDevices != NULL ? *pDevices : (audio_devices_t)0;
+ uint32_t samplingRate = pSamplingRate != NULL ? *pSamplingRate : 0;
+ audio_format_t format = pFormat != NULL ? *pFormat : AUDIO_FORMAT_DEFAULT;
+ audio_channel_mask_t channelMask = pChannelMask != NULL ?
+ *pChannelMask : (audio_channel_mask_t)0;
+ uint32_t latency = pLatencyMs != NULL ? *pLatencyMs : 0;
data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
data.writeInt32(module);
@@ -383,15 +384,15 @@ public:
audio_io_handle_t output = (audio_io_handle_t) reply.readInt32();
ALOGV("openOutput() returned output, %d", output);
devices = (audio_devices_t)reply.readInt32();
- if (pDevices) *pDevices = devices;
+ if (pDevices != NULL) *pDevices = devices;
samplingRate = reply.readInt32();
- if (pSamplingRate) *pSamplingRate = samplingRate;
+ if (pSamplingRate != NULL) *pSamplingRate = samplingRate;
format = (audio_format_t) reply.readInt32();
- if (pFormat) *pFormat = format;
+ if (pFormat != NULL) *pFormat = format;
channelMask = (audio_channel_mask_t)reply.readInt32();
- if (pChannelMask) *pChannelMask = channelMask;
+ if (pChannelMask != NULL) *pChannelMask = channelMask;
latency = reply.readInt32();
- if (pLatencyMs) *pLatencyMs = latency;
+ if (pLatencyMs != NULL) *pLatencyMs = latency;
return output;
}
@@ -440,10 +441,11 @@ public:
audio_channel_mask_t *pChannelMask)
{
Parcel data, reply;
- audio_devices_t devices = pDevices ? *pDevices : (audio_devices_t)0;
- uint32_t samplingRate = pSamplingRate ? *pSamplingRate : 0;
- audio_format_t format = pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT;
- audio_channel_mask_t channelMask = pChannelMask ? *pChannelMask : (audio_channel_mask_t)0;
+ audio_devices_t devices = pDevices != NULL ? *pDevices : (audio_devices_t)0;
+ uint32_t samplingRate = pSamplingRate != NULL ? *pSamplingRate : 0;
+ audio_format_t format = pFormat != NULL ? *pFormat : AUDIO_FORMAT_DEFAULT;
+ audio_channel_mask_t channelMask = pChannelMask != NULL ?
+ *pChannelMask : (audio_channel_mask_t)0;
data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
data.writeInt32(module);
@@ -454,13 +456,13 @@ public:
remote()->transact(OPEN_INPUT, data, &reply);
audio_io_handle_t input = (audio_io_handle_t) reply.readInt32();
devices = (audio_devices_t)reply.readInt32();
- if (pDevices) *pDevices = devices;
+ if (pDevices != NULL) *pDevices = devices;
samplingRate = reply.readInt32();
- if (pSamplingRate) *pSamplingRate = samplingRate;
+ if (pSamplingRate != NULL) *pSamplingRate = samplingRate;
format = (audio_format_t) reply.readInt32();
- if (pFormat) *pFormat = format;
+ if (pFormat != NULL) *pFormat = format;
channelMask = (audio_channel_mask_t)reply.readInt32();
- if (pChannelMask) *pChannelMask = channelMask;
+ if (pChannelMask != NULL) *pChannelMask = channelMask;
return input;
}