Use NULL not 0 for raw pointers
Use if (p != NULL) instead of if (ptr)
Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 5ceb912..1d1f645 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -811,9 +811,9 @@
mThreadCanCallJava = threadCanCallJava;
mStreamType = streamType;
mVolume = volume;
- mpAudioTrack = 0;
- mpToneDesc = 0;
- mpNewToneDesc = 0;
+ mpAudioTrack = NULL;
+ mpToneDesc = NULL;
+ mpNewToneDesc = NULL;
// Generate tone by chunks of 20 ms to keep cadencing precision
mProcessSize = (mSamplingRate * 20) / 1000;
@@ -855,7 +855,7 @@
ToneGenerator::~ToneGenerator() {
ALOGV("ToneGenerator destructor\n");
- if (mpAudioTrack) {
+ if (mpAudioTrack != NULL) {
stopTone();
ALOGV("Delete Track: %p\n", mpAudioTrack);
delete mpAudioTrack;
@@ -1012,7 +1012,7 @@
if (mpAudioTrack) {
delete mpAudioTrack;
- mpAudioTrack = 0;
+ mpAudioTrack = NULL;
}
// Open audio track in mono, PCM 16bit, default sampling rate, default buffer size
@@ -1048,7 +1048,7 @@
if (mpAudioTrack) {
ALOGV("Delete Track I: %p\n", mpAudioTrack);
delete mpAudioTrack;
- mpAudioTrack = 0;
+ mpAudioTrack = NULL;
}
return false;
@@ -1317,7 +1317,7 @@
bool ToneGenerator::prepareWave() {
unsigned int segmentIdx = 0;
- if (!mpNewToneDesc) {
+ if (mpNewToneDesc == NULL) {
return false;
}