Skip to content

Commit 9d25b82

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "Rename LOG_ASSERT to ALOG_ASSERT"
2 parents 6df477b + f68633d commit 9d25b82

File tree

13 files changed

+68
-68
lines changed

13 files changed

+68
-68
lines changed

core/jni/com_android_internal_content_NativeLibraryHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ iterateOverNativeFiles(JNIEnv *env, jstring javaFilePath, jstring javaCpuAbi, js
308308
}
309309

310310
const char* lastSlash = strrchr(fileName, '/');
311-
LOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);
311+
ALOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);
312312

313313
// Check to make sure the CPU ABI of this file is one we support.
314314
const char* cpuAbiOffset = fileName + APK_LIB_LEN;

libs/binder/IPCThreadState.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
692692

693693
case BR_ACQUIRE_RESULT:
694694
{
695-
LOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT");
695+
ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT");
696696
const int32_t result = mIn.readInt32();
697697
if (!acquireResult) continue;
698698
*acquireResult = result ? NO_ERROR : INVALID_OPERATION;
@@ -703,7 +703,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
703703
{
704704
binder_transaction_data tr;
705705
err = mIn.read(&tr, sizeof(tr));
706-
LOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY");
706+
ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY");
707707
if (err != NO_ERROR) goto finish;
708708

709709
if (reply) {
@@ -752,7 +752,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
752752

753753
status_t IPCThreadState::talkWithDriver(bool doReceive)
754754
{
755-
LOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
755+
ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened");
756756

757757
binder_write_read bwr;
758758

@@ -905,7 +905,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
905905
case BR_ACQUIRE:
906906
refs = (RefBase::weakref_type*)mIn.readInt32();
907907
obj = (BBinder*)mIn.readInt32();
908-
LOG_ASSERT(refs->refBase() == obj,
908+
ALOG_ASSERT(refs->refBase() == obj,
909909
"BR_ACQUIRE: object %p does not match cookie %p (expected %p)",
910910
refs, obj, refs->refBase());
911911
obj->incStrong(mProcess.get());
@@ -921,7 +921,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
921921
case BR_RELEASE:
922922
refs = (RefBase::weakref_type*)mIn.readInt32();
923923
obj = (BBinder*)mIn.readInt32();
924-
LOG_ASSERT(refs->refBase() == obj,
924+
ALOG_ASSERT(refs->refBase() == obj,
925925
"BR_RELEASE: object %p does not match cookie %p (expected %p)",
926926
refs, obj, refs->refBase());
927927
IF_LOG_REMOTEREFS() {
@@ -946,7 +946,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
946946
// NOTE: This assertion is not valid, because the object may no
947947
// longer exist (thus the (BBinder*)cast above resulting in a different
948948
// memory address).
949-
//LOG_ASSERT(refs->refBase() == obj,
949+
//ALOG_ASSERT(refs->refBase() == obj,
950950
// "BR_DECREFS: object %p does not match cookie %p (expected %p)",
951951
// refs, obj, refs->refBase());
952952
mPendingWeakDerefs.push(refs);
@@ -958,7 +958,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
958958

959959
{
960960
const bool success = refs->attemptIncStrong(mProcess.get());
961-
LOG_ASSERT(success && refs->refBase() == obj,
961+
ALOG_ASSERT(success && refs->refBase() == obj,
962962
"BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)",
963963
refs, obj, refs->refBase());
964964

@@ -971,7 +971,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
971971
{
972972
binder_transaction_data tr;
973973
result = mIn.read(&tr, sizeof(tr));
974-
LOG_ASSERT(result == NO_ERROR,
974+
ALOG_ASSERT(result == NO_ERROR,
975975
"Not enough command data for brTRANSACTION");
976976
if (result != NO_ERROR) break;
977977

@@ -1114,7 +1114,7 @@ void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, size_t data
11141114
IF_LOG_COMMANDS() {
11151115
alog << "Writing BC_FREE_BUFFER for " << data << endl;
11161116
}
1117-
LOG_ASSERT(data != NULL, "Called with NULL data");
1117+
ALOG_ASSERT(data != NULL, "Called with NULL data");
11181118
if (parcel != NULL) parcel->closeFileDescriptors();
11191119
IPCThreadState* state = self();
11201120
state->mOut.writeInt32(BC_FREE_BUFFER);

libs/utils/RefBase.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void RefBase::incStrong(const void* id) const
332332

333333
refs->addStrongRef(id);
334334
const int32_t c = android_atomic_inc(&refs->mStrong);
335-
LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
335+
ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
336336
#if PRINT_REFS
337337
ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c);
338338
#endif
@@ -352,7 +352,7 @@ void RefBase::decStrong(const void* id) const
352352
#if PRINT_REFS
353353
ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c);
354354
#endif
355-
LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
355+
ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
356356
if (c == 1) {
357357
refs->mBase->onLastStrongRef(id);
358358
if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) {
@@ -369,7 +369,7 @@ void RefBase::forceIncStrong(const void* id) const
369369

370370
refs->addStrongRef(id);
371371
const int32_t c = android_atomic_inc(&refs->mStrong);
372-
LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
372+
ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
373373
refs);
374374
#if PRINT_REFS
375375
ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c);
@@ -399,7 +399,7 @@ void RefBase::weakref_type::incWeak(const void* id)
399399
weakref_impl* const impl = static_cast<weakref_impl*>(this);
400400
impl->addWeakRef(id);
401401
const int32_t c = android_atomic_inc(&impl->mWeak);
402-
LOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
402+
ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
403403
}
404404

405405

@@ -408,7 +408,7 @@ void RefBase::weakref_type::decWeak(const void* id)
408408
weakref_impl* const impl = static_cast<weakref_impl*>(this);
409409
impl->removeWeakRef(id);
410410
const int32_t c = android_atomic_dec(&impl->mWeak);
411-
LOG_ASSERT(c >= 1, "decWeak called on %p too many times", this);
411+
ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this);
412412
if (c != 1) return;
413413

414414
if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) {
@@ -442,7 +442,7 @@ bool RefBase::weakref_type::attemptIncStrong(const void* id)
442442
weakref_impl* const impl = static_cast<weakref_impl*>(this);
443443

444444
int32_t curCount = impl->mStrong;
445-
LOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow",
445+
ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow",
446446
this);
447447
while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) {
448448
if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) {
@@ -503,7 +503,7 @@ bool RefBase::weakref_type::attemptIncWeak(const void* id)
503503
weakref_impl* const impl = static_cast<weakref_impl*>(this);
504504

505505
int32_t curCount = impl->mWeak;
506-
LOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow",
506+
ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow",
507507
this);
508508
while (curCount > 0) {
509509
if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) {

libs/utils/String16.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ String16::String16(const char16_t* o)
112112
{
113113
size_t len = strlen16(o);
114114
SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
115-
LOG_ASSERT(buf, "Unable to allocate shared buffer");
115+
ALOG_ASSERT(buf, "Unable to allocate shared buffer");
116116
if (buf) {
117117
char16_t* str = (char16_t*)buf->data();
118118
strcpy16(str, o);
@@ -126,7 +126,7 @@ String16::String16(const char16_t* o)
126126
String16::String16(const char16_t* o, size_t len)
127127
{
128128
SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t));
129-
LOG_ASSERT(buf, "Unable to allocate shared buffer");
129+
ALOG_ASSERT(buf, "Unable to allocate shared buffer");
130130
if (buf) {
131131
char16_t* str = (char16_t*)buf->data();
132132
memcpy(str, o, len*sizeof(char16_t));

libs/utils/String8.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static char* allocFromUTF8(const char* in, size_t len)
8080
{
8181
if (len > 0) {
8282
SharedBuffer* buf = SharedBuffer::alloc(len+1);
83-
LOG_ASSERT(buf, "Unable to allocate shared buffer");
83+
ALOG_ASSERT(buf, "Unable to allocate shared buffer");
8484
if (buf) {
8585
char* str = (char*)buf->data();
8686
memcpy(str, in, len);
@@ -103,7 +103,7 @@ static char* allocFromUTF16(const char16_t* in, size_t len)
103103
}
104104

105105
SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
106-
LOG_ASSERT(buf, "Unable to allocate shared buffer");
106+
ALOG_ASSERT(buf, "Unable to allocate shared buffer");
107107
if (!buf) {
108108
return getEmptyString();
109109
}
@@ -125,7 +125,7 @@ static char* allocFromUTF32(const char32_t* in, size_t len)
125125
}
126126

127127
SharedBuffer* buf = SharedBuffer::alloc(bytes+1);
128-
LOG_ASSERT(buf, "Unable to allocate shared buffer");
128+
ALOG_ASSERT(buf, "Unable to allocate shared buffer");
129129
if (!buf) {
130130
return getEmptyString();
131131
}

libs/utils/VectorImpl.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ VectorImpl::VectorImpl(const VectorImpl& rhs)
5656

5757
VectorImpl::~VectorImpl()
5858
{
59-
LOG_ASSERT(!mCount,
59+
ALOG_ASSERT(!mCount,
6060
"[%p] "
6161
"subclasses of VectorImpl must call finish_vector()"
6262
" in their destructor. Leaking %d bytes.",
@@ -66,7 +66,7 @@ VectorImpl::~VectorImpl()
6666

6767
VectorImpl& VectorImpl::operator = (const VectorImpl& rhs)
6868
{
69-
LOG_ASSERT(mItemSize == rhs.mItemSize,
69+
ALOG_ASSERT(mItemSize == rhs.mItemSize,
7070
"Vector<> have different types (this=%p, rhs=%p)", this, &rhs);
7171
if (this != &rhs) {
7272
release_storage();
@@ -248,7 +248,7 @@ ssize_t VectorImpl::replaceAt(size_t index)
248248

249249
ssize_t VectorImpl::replaceAt(const void* prototype, size_t index)
250250
{
251-
LOG_ASSERT(index<size(),
251+
ALOG_ASSERT(index<size(),
252252
"[%p] replace: index=%d, size=%d", this, (int)index, (int)size());
253253

254254
void* item = editItemLocation(index);
@@ -267,7 +267,7 @@ ssize_t VectorImpl::replaceAt(const void* prototype, size_t index)
267267

268268
ssize_t VectorImpl::removeItemsAt(size_t index, size_t count)
269269
{
270-
LOG_ASSERT((index+count)<=size(),
270+
ALOG_ASSERT((index+count)<=size(),
271271
"[%p] remove: index=%d, count=%d, size=%d",
272272
this, (int)index, (int)count, (int)size());
273273

@@ -291,7 +291,7 @@ void VectorImpl::clear()
291291

292292
void* VectorImpl::editItemLocation(size_t index)
293293
{
294-
LOG_ASSERT(index<capacity(),
294+
ALOG_ASSERT(index<capacity(),
295295
"[%p] editItemLocation: index=%d, capacity=%d, count=%d",
296296
this, (int)index, (int)capacity(), (int)mCount);
297297

@@ -303,7 +303,7 @@ void* VectorImpl::editItemLocation(size_t index)
303303

304304
const void* VectorImpl::itemLocation(size_t index) const
305305
{
306-
LOG_ASSERT(index<capacity(),
306+
ALOG_ASSERT(index<capacity(),
307307
"[%p] itemLocation: index=%d, capacity=%d, count=%d",
308308
this, (int)index, (int)capacity(), (int)mCount);
309309

@@ -349,7 +349,7 @@ void* VectorImpl::_grow(size_t where, size_t amount)
349349
// ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
350350
// this, (int)where, (int)amount, (int)mCount, (int)capacity());
351351

352-
LOG_ASSERT(where <= mCount,
352+
ALOG_ASSERT(where <= mCount,
353353
"[%p] _grow: where=%d, amount=%d, count=%d",
354354
this, (int)where, (int)amount, (int)mCount); // caller already checked
355355

@@ -402,7 +402,7 @@ void VectorImpl::_shrink(size_t where, size_t amount)
402402
// ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
403403
// this, (int)where, (int)amount, (int)mCount, (int)capacity());
404404

405-
LOG_ASSERT(where + amount <= mCount,
405+
ALOG_ASSERT(where + amount <= mCount,
406406
"[%p] _shrink: where=%d, amount=%d, count=%d",
407407
this, (int)where, (int)amount, (int)mCount); // caller already checked
408408

media/libmediaplayerservice/TestPlayerStub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ status_t TestPlayerStub::resetInternal()
176176
mContentUrl = NULL;
177177

178178
if (mPlayer) {
179-
LOG_ASSERT(mDeletePlayer != NULL, "mDeletePlayer is null");
179+
ALOG_ASSERT(mDeletePlayer != NULL, "mDeletePlayer is null");
180180
(*mDeletePlayer)(mPlayer);
181181
mPlayer = NULL;
182182
}

services/audioflinger/AudioResampler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ AudioResampler::AudioResampler(int bitDepth, int inChannelCount,
123123
if ((bitDepth != 16) ||(inChannelCount < 1) || (inChannelCount > 2)) {
124124
ALOGE("Unsupported sample format, %d bits, %d channels", bitDepth,
125125
inChannelCount);
126-
// LOG_ASSERT(0);
126+
// ALOG_ASSERT(0);
127127
}
128128

129129
// initialize common members
@@ -164,7 +164,7 @@ void AudioResamplerOrder1::resample(int32_t* out, size_t outFrameCount,
164164
AudioBufferProvider* provider) {
165165

166166
// should never happen, but we overflow if it does
167-
// LOG_ASSERT(outFrameCount < 32767);
167+
// ALOG_ASSERT(outFrameCount < 32767);
168168

169169
// select the appropriate resampler
170170
switch (mChannelCount) {
@@ -261,7 +261,7 @@ void AudioResamplerOrder1::resampleStereo16(int32_t* out, size_t outFrameCount,
261261
provider->releaseBuffer(&mBuffer);
262262

263263
// verify that the releaseBuffer resets the buffer frameCount
264-
// LOG_ASSERT(mBuffer.frameCount == 0);
264+
// ALOG_ASSERT(mBuffer.frameCount == 0);
265265
}
266266
}
267267

@@ -355,7 +355,7 @@ void AudioResamplerOrder1::resampleMono16(int32_t* out, size_t outFrameCount,
355355
provider->releaseBuffer(&mBuffer);
356356

357357
// verify that the releaseBuffer resets the buffer frameCount
358-
// LOG_ASSERT(mBuffer.frameCount == 0);
358+
// ALOG_ASSERT(mBuffer.frameCount == 0);
359359
}
360360
}
361361

services/audioflinger/AudioResamplerCubic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void AudioResamplerCubic::resample(int32_t* out, size_t outFrameCount,
3636
AudioBufferProvider* provider) {
3737

3838
// should never happen, but we overflow if it does
39-
// LOG_ASSERT(outFrameCount < 32767);
39+
// ALOG_ASSERT(outFrameCount < 32767);
4040

4141
// select the appropriate resampler
4242
switch (mChannelCount) {

services/input/EventHub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ EventHub::Device* EventHub::getDeviceByPathLocked(const char* devicePath) const
535535
}
536536

537537
size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSize) {
538-
LOG_ASSERT(bufferSize >= 1);
538+
ALOG_ASSERT(bufferSize >= 1);
539539

540540
AutoMutex _l(mLock);
541541

0 commit comments

Comments
 (0)