From 9d1f02d74fd395ec4de6861147da289423f0ab6f Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 8 Feb 2012 17:47:58 -0800 Subject: Follow raw pointer and sp<> conventions Unconditional delete for raw pointers. Use "if (sp != 0)" not "if (sp.get() != 0)" or "if (sp != NULL)". Use "if (raw != NULL)" not "if (raw)". Change-Id: I531a8da7c37149261ed2f34b862ec4896a4b785b --- media/libmedia/IAudioFlinger.cpp | 2 +- media/libmedia/JetPlayer.cpp | 8 +++----- media/libmedia/ToneGenerator.cpp | 2 +- services/audioflinger/AudioPolicyService.cpp | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index c3252e7..4507e5d 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -559,7 +559,7 @@ public: if (status != NO_ERROR) { return status; } - if (numEffects) { + if (numEffects != NULL) { *numEffects = (uint32_t)reply.readInt32(); } return NO_ERROR; diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp index 8456db5..6cb5b82 100644 --- a/media/libmedia/JetPlayer.cpp +++ b/media/libmedia/JetPlayer.cpp @@ -246,14 +246,12 @@ int JetPlayer::render() { }//while (1) threadExit: - if (mAudioTrack) { + if (mAudioTrack != NULL) { mAudioTrack->stop(); mAudioTrack->flush(); } - if (mAudioBuffer) { - delete [] mAudioBuffer; - mAudioBuffer = NULL; - } + delete [] mAudioBuffer; + mAudioBuffer = NULL; mMutex.lock(); mTid = -1; mCondition.signal(); diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index dfa41c4..6cb10aa 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -1045,7 +1045,7 @@ bool ToneGenerator::initAudioTrack() { initAudioTrack_exit: // Cleanup - if (mpAudioTrack) { + if (mpAudioTrack != NULL) { ALOGV("Delete Track I: %p", mpAudioTrack); delete mpAudioTrack; mpAudioTrack = NULL; diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index af464b2..f8b430e 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -588,10 +588,10 @@ status_t AudioPolicyService::dump(int fd, const Vector& args) } dumpInternals(fd); - if (mAudioCommandThread != NULL) { + if (mAudioCommandThread != 0) { mAudioCommandThread->dump(fd); } - if (mTonePlaybackThread != NULL) { + if (mTonePlaybackThread != 0) { mTonePlaybackThread->dump(fd); } -- cgit v1.1