Use String8/16 c_str [audio]
Bug: 295394788
Test: make checkbuild
Change-Id: Idd3610f6820093bd8710a401f87a136cc26279c5
Merged-In: Idd3610f6820093bd8710a401f87a136cc26279c5
diff --git a/media/img_utils/src/FileInput.cpp b/media/img_utils/src/FileInput.cpp
index 4c85a51..1eb614b 100644
--- a/media/img_utils/src/FileInput.cpp
+++ b/media/img_utils/src/FileInput.cpp
@@ -33,12 +33,12 @@
status_t FileInput::open() {
if (mOpen) {
- ALOGW("%s: Open called when file %s already open.", __FUNCTION__, mPath.string());
+ ALOGW("%s: Open called when file %s already open.", __FUNCTION__, mPath.c_str());
return OK;
}
mFp = ::fopen(mPath, "rb");
if (!mFp) {
- ALOGE("%s: Could not open file %s", __FUNCTION__, mPath.string());
+ ALOGE("%s: Could not open file %s", __FUNCTION__, mPath.c_str());
return BAD_VALUE;
}
mOpen = true;
@@ -47,14 +47,14 @@
ssize_t FileInput::read(uint8_t* buf, size_t offset, size_t count) {
if (!mOpen) {
- ALOGE("%s: Could not read file %s, file not open.", __FUNCTION__, mPath.string());
+ ALOGE("%s: Could not read file %s, file not open.", __FUNCTION__, mPath.c_str());
return BAD_VALUE;
}
size_t bytesRead = ::fread(buf + offset, sizeof(uint8_t), count, mFp);
int error = ::ferror(mFp);
if (error != 0) {
- ALOGE("%s: Error %d occurred while reading file %s.", __FUNCTION__, error, mPath.string());
+ ALOGE("%s: Error %d occurred while reading file %s.", __FUNCTION__, error, mPath.c_str());
return BAD_VALUE;
}
@@ -68,13 +68,13 @@
status_t FileInput::close() {
if(!mOpen) {
- ALOGW("%s: Close called when file %s already close.", __FUNCTION__, mPath.string());
+ ALOGW("%s: Close called when file %s already close.", __FUNCTION__, mPath.c_str());
return OK;
}
status_t ret = OK;
if(::fclose(mFp) != 0) {
- ALOGE("%s: Failed to close file %s.", __FUNCTION__, mPath.string());
+ ALOGE("%s: Failed to close file %s.", __FUNCTION__, mPath.c_str());
ret = BAD_VALUE;
}
mOpen = false;
diff --git a/media/img_utils/src/FileOutput.cpp b/media/img_utils/src/FileOutput.cpp
index 0346762..5e37324 100644
--- a/media/img_utils/src/FileOutput.cpp
+++ b/media/img_utils/src/FileOutput.cpp
@@ -25,19 +25,19 @@
FileOutput::~FileOutput() {
if (mOpen) {
- ALOGW("%s: Destructor called with %s still open.", __FUNCTION__, mPath.string());
+ ALOGW("%s: Destructor called with %s still open.", __FUNCTION__, mPath.c_str());
close();
}
}
status_t FileOutput::open() {
if (mOpen) {
- ALOGW("%s: Open called when file %s already open.", __FUNCTION__, mPath.string());
+ ALOGW("%s: Open called when file %s already open.", __FUNCTION__, mPath.c_str());
return OK;
}
mFp = ::fopen(mPath, "wb");
if (!mFp) {
- ALOGE("%s: Could not open file %s", __FUNCTION__, mPath.string());
+ ALOGE("%s: Could not open file %s", __FUNCTION__, mPath.c_str());
return BAD_VALUE;
}
mOpen = true;
@@ -46,7 +46,7 @@
status_t FileOutput::write(const uint8_t* buf, size_t offset, size_t count) {
if (!mOpen) {
- ALOGE("%s: Could not write file %s, file not open.", __FUNCTION__, mPath.string());
+ ALOGE("%s: Could not write file %s, file not open.", __FUNCTION__, mPath.c_str());
return BAD_VALUE;
}
@@ -54,7 +54,7 @@
int error = ::ferror(mFp);
if (error != 0) {
- ALOGE("%s: Error %d occurred while writing file %s.", __FUNCTION__, error, mPath.string());
+ ALOGE("%s: Error %d occurred while writing file %s.", __FUNCTION__, error, mPath.c_str());
return BAD_VALUE;
}
return OK;
@@ -62,13 +62,13 @@
status_t FileOutput::close() {
if(!mOpen) {
- ALOGW("%s: Close called when file %s already close.", __FUNCTION__, mPath.string());
+ ALOGW("%s: Close called when file %s already close.", __FUNCTION__, mPath.c_str());
return OK;
}
status_t ret = OK;
if(::fclose(mFp) != 0) {
- ALOGE("%s: Failed to close file %s.", __FUNCTION__, mPath.string());
+ ALOGE("%s: Failed to close file %s.", __FUNCTION__, mPath.c_str());
ret = BAD_VALUE;
}
mOpen = false;
diff --git a/media/img_utils/src/TiffIfd.cpp b/media/img_utils/src/TiffIfd.cpp
index 3fb00cc..b272814 100644
--- a/media/img_utils/src/TiffIfd.cpp
+++ b/media/img_utils/src/TiffIfd.cpp
@@ -377,7 +377,7 @@
size_t s = mEntries.size();
ALOGI("[ifd: %x, num_entries: %zu, entries:\n", getId(), s);
for(size_t i = 0; i < s; ++i) {
- ALOGI("\t%s", mEntries[i]->toString().string());
+ ALOGI("\t%s", mEntries[i]->toString().c_str());
}
ALOGI(", next_ifd: %x]", ((mNextIfd != NULL) ? mNextIfd->getId() : 0));
}