diff options
-rw-r--r-- | src/class_linker.cc | 6 | ||||
-rw-r--r-- | src/common_test.h | 8 | ||||
-rw-r--r-- | src/compiler.cc | 4 | ||||
-rw-r--r-- | src/compiler/Frontend.cc | 2 | ||||
-rw-r--r-- | src/compiler/codegen/arm/ArchUtility.cc | 7 | ||||
-rw-r--r-- | src/compiler/codegen/arm/Thumb2/Gen.cc | 8 | ||||
-rw-r--r-- | src/dalvik_system_DexFile.cc | 2 | ||||
-rw-r--r-- | src/dex2oat.cc | 2 | ||||
-rw-r--r-- | src/dex_file.cc | 2 | ||||
-rw-r--r-- | src/dex_verifier.cc | 6 | ||||
-rw-r--r-- | src/file_test.cc | 8 | ||||
-rw-r--r-- | src/hprof/hprof.cc | 2 | ||||
-rw-r--r-- | src/java_lang_Class.cc | 2 | ||||
-rw-r--r-- | src/mem_map.cc | 4 | ||||
-rw-r--r-- | src/oat_file.cc | 2 | ||||
-rw-r--r-- | src/oat_writer.cc | 2 | ||||
-rw-r--r-- | src/oatdump.cc | 8 | ||||
-rw-r--r-- | src/object.cc | 4 | ||||
-rw-r--r-- | src/object_utils.h | 4 | ||||
-rw-r--r-- | src/reflection.cc | 2 | ||||
-rw-r--r-- | src/runtime.cc | 2 | ||||
-rw-r--r-- | src/runtime_test.cc | 2 | ||||
-rw-r--r-- | src/thread.cc | 2 | ||||
-rw-r--r-- | src/utils.cc | 6 |
24 files changed, 48 insertions, 49 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc index 88016f4fe0..ab5f9d6ed7 100644 --- a/src/class_linker.cc +++ b/src/class_linker.cc @@ -696,7 +696,7 @@ const OatFile* ClassLinker::FindOatFileFromOatLocation(const std::string& oat_lo } // not found in /foo/bar/baz.oat? try /data/art-cache/foo@bar@baz.oat - std::string cache_location = GetArtCacheFilenameOrDie(oat_location); + std::string cache_location(GetArtCacheFilenameOrDie(oat_location)); oat_file = FindOpenedOatFileFromOatLocation(cache_location); if (oat_file != NULL) { return oat_file; @@ -739,7 +739,7 @@ void ClassLinker::InitFromImage() { static_cast<uint32_t>(dex_caches->GetLength())); for (int i = 0; i < dex_caches->GetLength(); i++) { SirtRef<DexCache> dex_cache(dex_caches->Get(i)); - const std::string& dex_file_location = dex_cache->GetLocation()->ToModifiedUtf8(); + const std::string& dex_file_location(dex_cache->GetLocation()->ToModifiedUtf8()); std::string dex_filename; dex_filename += runtime->GetHostPrefix(); @@ -1018,7 +1018,7 @@ Class* ClassLinker::FindClass(const std::string& descriptor, } } else { - std::string class_name_string = DescriptorToDot(descriptor); + std::string class_name_string(DescriptorToDot(descriptor)); ScopedThreadStateChange(self, Thread::kNative); JNIEnv* env = self->GetJniEnv(); ScopedLocalRef<jclass> c(env, AddLocalReference<jclass>(env, GetClassRoot(kJavaLangClassLoader))); diff --git a/src/common_test.h b/src/common_test.h index 48a9c39894..50939764e0 100644 --- a/src/common_test.h +++ b/src/common_test.h @@ -297,7 +297,7 @@ class CommonTest : public testing::Test { } const DexFile* GetLibCoreDex() { - std::string libcore_dex_file_name = GetLibCoreDexFileName(); + std::string libcore_dex_file_name(GetLibCoreDexFileName()); return DexFile::Open(libcore_dex_file_name, ""); } @@ -330,7 +330,7 @@ class CommonTest : public testing::Test { } void CompileClass(const ClassLoader* class_loader, const char* class_name) { - std::string class_descriptor = DotToDescriptor(class_name); + std::string class_descriptor(DotToDescriptor(class_name)); Class* klass = class_linker_->FindClass(class_descriptor, class_loader); CHECK(klass != NULL) << "Class not found " << class_name; for (size_t i = 0; i < klass->NumDirectMethods(); i++) { @@ -353,7 +353,7 @@ class CommonTest : public testing::Test { const char* class_name, const char* method_name, const char* signature) { - std::string class_descriptor = DotToDescriptor(class_name); + std::string class_descriptor(DotToDescriptor(class_name)); Class* klass = class_linker_->FindClass(class_descriptor, class_loader); CHECK(klass != NULL) << "Class not found " << class_name; Method* method = klass->FindDirectMethod(method_name, signature); @@ -366,7 +366,7 @@ class CommonTest : public testing::Test { const char* class_name, const char* method_name, const char* signature) { - std::string class_descriptor = DotToDescriptor(class_name); + std::string class_descriptor(DotToDescriptor(class_name)); Class* klass = class_linker_->FindClass(class_descriptor, class_loader); CHECK(klass != NULL) << "Class not found " << class_name; Method* method = klass->FindVirtualMethod(method_name, signature); diff --git a/src/compiler.cc b/src/compiler.cc index 7ed953bc34..e01ab749a2 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -439,7 +439,7 @@ static std::string MakeInvokeStubKey(bool is_static, const char* shorty) { } const CompiledInvokeStub* Compiler::FindInvokeStub(bool is_static, const char* shorty) const { - const std::string key = MakeInvokeStubKey(is_static, shorty); + const std::string key(MakeInvokeStubKey(is_static, shorty)); InvokeStubTable::const_iterator it = compiled_invoke_stubs_.find(key); if (it == compiled_invoke_stubs_.end()) { return NULL; @@ -451,7 +451,7 @@ const CompiledInvokeStub* Compiler::FindInvokeStub(bool is_static, const char* s void Compiler::InsertInvokeStub(bool is_static, const char* shorty, const CompiledInvokeStub* compiled_invoke_stub) { - std::string key = MakeInvokeStubKey(is_static, shorty); + std::string key(MakeInvokeStubKey(is_static, shorty)); compiled_invoke_stubs_[key] = compiled_invoke_stub; } diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc index 75f5d7dc66..ba5bd3d5e1 100644 --- a/src/compiler/Frontend.cc +++ b/src/compiler/Frontend.cc @@ -215,7 +215,7 @@ STATIC BasicBlock *findBlock(CompilationUnit* cUnit, void oatDumpCFG(CompilationUnit* cUnit, const char* dirPrefix) { FILE* file; - std::string name = art::PrettyMethod(cUnit->method_idx, *cUnit->dex_file); + std::string name(art::PrettyMethod(cUnit->method_idx, *cUnit->dex_file)); char startOffset[80]; sprintf(startOffset, "_%x", cUnit->entryBlock->fallThrough->startOffset); char* fileName = (char*) oatNew( diff --git a/src/compiler/codegen/arm/ArchUtility.cc b/src/compiler/codegen/arm/ArchUtility.cc index b702682308..52fb018a1e 100644 --- a/src/compiler/codegen/arm/ArchUtility.cc +++ b/src/compiler/codegen/arm/ArchUtility.cc @@ -449,10 +449,9 @@ void oatCodegenDump(CompilationUnit* cUnit) const art::DexFile::MethodId& method_id = cUnit->dex_file->GetMethodId(cUnit->method_idx); - std::string signature = cUnit->dex_file->GetMethodSignature(method_id); - std::string name = cUnit->dex_file->GetMethodName(method_id); - std::string descriptor = - cUnit->dex_file->GetMethodDeclaringClassDescriptor(method_id); + std::string signature(cUnit->dex_file->GetMethodSignature(method_id)); + std::string name(cUnit->dex_file->GetMethodName(method_id)); + std::string descriptor(cUnit->dex_file->GetMethodDeclaringClassDescriptor(method_id)); // Dump mapping table if (cUnit->mappingTable.size() > 0) { diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc index b02cde50c0..6796f6c7c4 100644 --- a/src/compiler/codegen/arm/Thumb2/Gen.cc +++ b/src/compiler/codegen/arm/Thumb2/Gen.cc @@ -36,10 +36,10 @@ STATIC RegLocation getRetLoc(CompilationUnit* cUnit); void warnIfUnresolved(CompilationUnit* cUnit, int fieldIdx, Field* field) { if (field == NULL) { const art::DexFile::FieldId& field_id = cUnit->dex_file->GetFieldId(fieldIdx); - std::string class_name = cUnit->dex_file->GetFieldDeclaringClassDescriptor(field_id); - std::string field_name = cUnit->dex_file->GetFieldName(field_id); - LOG(INFO) << "Field " << art::PrettyDescriptor(class_name) << "." - << field_name << " unresolved at compile time"; + std::string class_name(cUnit->dex_file->GetFieldDeclaringClassDescriptor(field_id)); + std::string field_name(cUnit->dex_file->GetFieldName(field_id)); + LOG(INFO) << "Field " << art::PrettyDescriptor(class_name) << "." << field_name + << " unresolved at compile time"; } else { // We also use the slow path for wide volatile fields. } diff --git a/src/dalvik_system_DexFile.cc b/src/dalvik_system_DexFile.cc index cf4443b459..f668cc9bd5 100644 --- a/src/dalvik_system_DexFile.cc +++ b/src/dalvik_system_DexFile.cc @@ -163,7 +163,7 @@ jclass DexFile_defineClass(JNIEnv* env, jclass, jstring javaName, jobject javaLo if (class_name.c_str() == NULL) { return NULL; } - const std::string descriptor = DotToDescriptor(class_name.c_str()); + const std::string descriptor(DotToDescriptor(class_name.c_str())); const DexFile::ClassDef* dex_class_def = dex_file->FindClassDef(descriptor); if (dex_class_def == NULL) { return NULL; diff --git a/src/dex2oat.cc b/src/dex2oat.cc index 4f11add073..da07dbdbf4 100644 --- a/src/dex2oat.cc +++ b/src/dex2oat.cc @@ -98,7 +98,7 @@ class Dex2Oat { if (StringPiece(dot).starts_with("#") || dot.empty()) { continue; } - std::string descriptor = DotToDescriptor(dot.c_str()); + std::string descriptor(DotToDescriptor(dot.c_str())); SirtRef<Class> klass(class_linker->FindSystemClass(descriptor)); if (klass.get() == NULL) { LOG(WARNING) << "Failed to find class " << descriptor; diff --git a/src/dex_file.cc b/src/dex_file.cc index b92760bb27..ce7dde6bec 100644 --- a/src/dex_file.cc +++ b/src/dex_file.cc @@ -218,7 +218,7 @@ const DexFile* DexFile::OpenZip(const std::string& filename, return NULL; } - std::string cache_path = StringPrintf("%s.%08x", cache_path_tmp.c_str(), zip_entry->GetCrc32()); + std::string cache_path(StringPrintf("%s.%08x", cache_path_tmp.c_str(), zip_entry->GetCrc32())); // Example cache_path = /data/art-cache/parent@dir@foo.jar@classes.dex.1a2b3c4d bool created = false; diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc index 9ba5d34576..36c9d3860b 100644 --- a/src/dex_verifier.cc +++ b/src/dex_verifier.cc @@ -125,7 +125,7 @@ Class* RegType::ClassJoin(Class* s, Class* t) { Class* common_elem = ClassJoin(s_ct, t_ct); ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); const ClassLoader* class_loader = s->GetClassLoader(); - std::string descriptor = "["; + std::string descriptor("["); descriptor += ClassHelper(common_elem).GetDescriptor(); Class* array_class = class_linker->FindClass(descriptor.c_str(), class_loader); DCHECK(array_class != NULL); @@ -523,8 +523,8 @@ const RegType& RegTypeCache::FromCat1Const(int32_t value) { const RegType& RegTypeCache::GetComponentType(const RegType& array, const ClassLoader* loader) { CHECK(array.IsArrayClass()); if (array.IsUnresolvedTypes()) { - std::string descriptor = array.GetDescriptor()->ToModifiedUtf8(); - std::string component = descriptor.substr(1, descriptor.size() - 1); + std::string descriptor(array.GetDescriptor()->ToModifiedUtf8()); + std::string component(descriptor.substr(1, descriptor.size() - 1)); return FromDescriptor(loader, component); } else { return FromClass(array.GetClass()->GetComponentType()); diff --git a/src/file_test.cc b/src/file_test.cc index 99e4b41a8d..2c91ab6fdd 100644 --- a/src/file_test.cc +++ b/src/file_test.cc @@ -11,7 +11,7 @@ namespace art { class FileTest : public CommonTest {}; TEST_F(FileTest, Read) { - std::string filename = GetLibCoreDexFileName(); + std::string filename(GetLibCoreDexFileName()); UniquePtr<File> file(OS::OpenFile(filename.c_str(), false)); ASSERT_TRUE(file.get() != NULL); EXPECT_STREQ(filename.c_str(), file->name()); @@ -25,7 +25,7 @@ TEST_F(FileTest, Read) { TEST_F(FileTest, FileLength) { - std::string filename = GetLibCoreDexFileName(); + std::string filename(GetLibCoreDexFileName()); UniquePtr<File> file(OS::OpenFile(filename.c_str(), false)); ASSERT_TRUE(file.get() != NULL); EXPECT_NE(0, file->Length()); @@ -33,7 +33,7 @@ TEST_F(FileTest, FileLength) { TEST_F(FileTest, FilePosition) { - std::string filename = GetLibCoreDexFileName(); + std::string filename(GetLibCoreDexFileName()); UniquePtr<File> file(OS::OpenFile(filename.c_str(), false)); ASSERT_TRUE(file.get() != NULL); char buf[4]; @@ -45,7 +45,7 @@ TEST_F(FileTest, FilePosition) { TEST_F(FileTest, FileFd) { - std::string filename = GetLibCoreDexFileName(); + std::string filename(GetLibCoreDexFileName()); UniquePtr<File> file(OS::OpenFile(filename.c_str(), false)); ASSERT_TRUE(file.get() != NULL); EXPECT_NE(-1, file->Fd()); diff --git a/src/hprof/hprof.cc b/src/hprof/hprof.cc index 64cd7dbf51..c90ccf07dd 100644 --- a/src/hprof/hprof.cc +++ b/src/hprof/hprof.cc @@ -660,7 +660,7 @@ int Hprof::DumpStrings() { HprofRecord *rec = ¤t_record_; for (StringMapIterator it = strings_.begin(); it != strings_.end(); ++it) { - std::string string = (*it).first; + std::string string((*it).first); size_t id = (*it).second; int err = StartNewRecord(HPROF_TAG_STRING, HPROF_TIME); diff --git a/src/java_lang_Class.cc b/src/java_lang_Class.cc index 92fb6fa658..e36e5db736 100644 --- a/src/java_lang_Class.cc +++ b/src/java_lang_Class.cc @@ -261,7 +261,7 @@ Method* FindConstructorOrMethodInArray(ObjectArray<Method>* methods, const std:: jobject Class_getDeclaredConstructorOrMethod(JNIEnv* env, jclass javaClass, jstring javaName, jobjectArray javaArgs) { Class* c = Decode<Class*>(env, javaClass); - std::string name = Decode<String*>(env, javaName)->ToModifiedUtf8(); + std::string name(Decode<String*>(env, javaName)->ToModifiedUtf8()); ObjectArray<Class>* arg_array = Decode<ObjectArray<Class>*>(env, javaArgs); Method* m = FindConstructorOrMethodInArray(c->GetDirectMethods(), name, arg_array); diff --git a/src/mem_map.cc b/src/mem_map.cc index 0d014c2bd8..c5858c1a03 100644 --- a/src/mem_map.cc +++ b/src/mem_map.cc @@ -86,8 +86,8 @@ void CheckMapRequest(byte* addr, size_t length) { if (remaining < 8+1+8) { // 00008000-0001f000 LOG(FATAL) << "Failed to parse at pos " << i << "\n" << maps; } - std::string start_str = maps.substr(i, 8); - std::string end_str = maps.substr(i+1+8, 8); + std::string start_str(maps.substr(i, 8)); + std::string end_str(maps.substr(i+1+8, 8)); uint32_t start = ParseHex(start_str); uint32_t end = ParseHex(end_str); CHECK(!(base >= start && base < end) // start of new within old diff --git a/src/oat_file.cc b/src/oat_file.cc index 4804864d76..472a20c8bf 100644 --- a/src/oat_file.cc +++ b/src/oat_file.cc @@ -12,7 +12,7 @@ namespace art { std::string OatFile::DexFilenameToOatFilename(const std::string& location) { CHECK(IsValidDexFilename(location) || IsValidZipFilename(location)); - std::string oat_location = location.substr(0, location.size()-3); + std::string oat_location(location.substr(0, location.size() - 3)); oat_location += "oat"; return oat_location; } diff --git a/src/oat_writer.cc b/src/oat_writer.cc index f3e78e6250..32ba4b1694 100644 --- a/src/oat_writer.cc +++ b/src/oat_writer.cc @@ -601,7 +601,7 @@ size_t OatWriter::WriteCodeMethod(File* file, size_t code_offset, size_t oat_cla } OatWriter::OatDexFile::OatDexFile(const DexFile& dex_file) { - const std::string& location = dex_file.GetLocation(); + const std::string& location(dex_file.GetLocation()); dex_file_location_size_ = location.size(); dex_file_location_data_ = reinterpret_cast<const uint8_t*>(location.data()); dex_file_checksum_ = dex_file.GetHeader().checksum_; diff --git a/src/oatdump.cc b/src/oatdump.cc index 5cff2ea2ed..2006827caf 100644 --- a/src/oatdump.cc +++ b/src/oatdump.cc @@ -106,7 +106,7 @@ class OatDump { const OatFile& oat_file, const OatFile::OatDexFile& oat_dex_file) { os << "OAT DEX FILE:\n"; - std::string dex_file_location = oat_dex_file.GetDexFileLocation(); + std::string dex_file_location(oat_dex_file.GetDexFileLocation()); os << "location: " << dex_file_location; if (!host_prefix.empty()) { dex_file_location = host_prefix + dex_file_location; @@ -174,7 +174,7 @@ class OatDump { uint32_t method_idx) { const DexFile::MethodId& method_id = dex_file.GetMethodId(method_idx); const char* name = dex_file.GetMethodName(method_id); - std::string signature = dex_file.GetMethodSignature(method_id); + std::string signature(dex_file.GetMethodSignature(method_id)); os << StringPrintf("\t%d: %s %s (method_idx=%d)\n", method_index, name, signature.c_str(), method_idx); os << StringPrintf("\t\tcode: %p (offset=%08x)\n", @@ -257,7 +257,7 @@ class ImageDump { os << "OAT LOCATION:\n" << std::flush; Object* oat_location_object = image_header.GetImageRoot(ImageHeader::kOatLocation); - std::string oat_location = oat_location_object->AsString()->ToModifiedUtf8(); + std::string oat_location(oat_location_object->AsString()->ToModifiedUtf8()); ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); os << oat_location; if (!host_prefix.empty()) { @@ -436,7 +436,7 @@ class ImageDump { size_t object_bytes_total = 0; typedef TableBytes::const_iterator It; // TODO: C++0x auto for (It it = descriptor_to_bytes.begin(), end = descriptor_to_bytes.end(); it != end; ++it) { - const std::string& descriptor = it->first; + const std::string& descriptor(it->first); size_t bytes = it->second; size_t count = descriptor_to_count[descriptor]; double average = static_cast<double>(bytes) / static_cast<double>(count); diff --git a/src/object.cc b/src/object.cc index 9e843279a4..1ef7201202 100644 --- a/src/object.cc +++ b/src/object.cc @@ -800,9 +800,9 @@ bool Class::IsInSamePackage(const Class* that) const { } // Compare the package part of the descriptor string. ClassHelper kh(klass1); - std::string descriptor1 = kh.GetDescriptor(); + std::string descriptor1(kh.GetDescriptor()); kh.ChangeClass(klass2); - std::string descriptor2 = kh.GetDescriptor(); + std::string descriptor2(kh.GetDescriptor()); return IsInSamePackage(descriptor1, descriptor2); } diff --git a/src/object_utils.h b/src/object_utils.h index f323190dba..c086fb84c1 100644 --- a/src/object_utils.h +++ b/src/object_utils.h @@ -52,7 +52,7 @@ class ClassHelper { std::string GetDescriptor() { if (klass_->IsArrayClass()) { - std::string result = "["; + std::string result("["); const Class* saved_klass = klass_; ChangeClass(klass_->GetComponentType()); result += GetDescriptor(); @@ -118,7 +118,7 @@ class ClassHelper { } } const char* GetSourceFile() { - std::string descriptor = GetDescriptor(); + std::string descriptor(GetDescriptor()); const DexFile& dex_file = GetDexFile(); const DexFile::ClassDef* dex_class_def = dex_file.FindClassDef(descriptor); if (dex_class_def == NULL) { diff --git a/src/reflection.cc b/src/reflection.cc index a6ae096bcd..46b2ff3900 100644 --- a/src/reflection.cc +++ b/src/reflection.cc @@ -305,7 +305,7 @@ bool UnboxPrimitive(JNIEnv* env, Object* o, Class* dst_class, JValue& unboxed_va } JValue boxed_value = { 0 }; - std::string src_descriptor = ClassHelper(o->GetClass()).GetDescriptor(); + std::string src_descriptor(ClassHelper(o->GetClass()).GetDescriptor()); Class* src_class = NULL; ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); Field* primitive_field = o->GetClass()->GetIFields()->Get(0); diff --git a/src/runtime.cc b/src/runtime.cc index 1304787d1a..ad86e05989 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -278,7 +278,7 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b } else if (option.starts_with("-Xcheck:jni")) { parsed->check_jni_ = true; } else if (option.starts_with("-Xrunjdwp:") || option.starts_with("-agentlib:jdwp=")) { - std::string tail = option.substr(option[1] == 'X' ? 10 : 15).ToString(); + std::string tail(option.substr(option[1] == 'X' ? 10 : 15).ToString()); if (tail == "help" || !Dbg::ParseJdwpOptions(tail)) { LOG(FATAL) << "Example: -Xrunjdwp:transport=dt_socket,address=8000,server=y\n" << "Example: -Xrunjdwp:transport=dt_socket,address=localhost:6500,server=n"; diff --git a/src/runtime_test.cc b/src/runtime_test.cc index 213897f5ef..a926a2397b 100644 --- a/src/runtime_test.cc +++ b/src/runtime_test.cc @@ -15,7 +15,7 @@ TEST_F(RuntimeTest, ParsedOptions) { void* test_exit = reinterpret_cast<void*>(0xc); void* null = reinterpret_cast<void*>(NULL); - std::string lib_core = GetLibCoreDexFileName(); + std::string lib_core(GetLibCoreDexFileName()); std::string boot_class_path; boot_class_path += "-Xbootclasspath:"; diff --git a/src/thread.cc b/src/thread.cc index fdfbf31101..741727ce4c 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -1304,7 +1304,7 @@ Thread* Thread::CurrentFromGdb() { void Thread::DumpFromGdb() const { std::ostringstream ss; Dump(ss); - std::string str = ss.str(); + std::string str(ss.str()); // log to stderr for debugging command line processes std::cerr << str; #ifdef HAVE_ANDROID_OS diff --git a/src/utils.cc b/src/utils.cc index 943899dec0..24e0429606 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -260,7 +260,7 @@ std::string DotToDescriptor(const char* class_name) { std::string DescriptorToDot(const std::string& descriptor) { DCHECK_EQ(descriptor[0], 'L'); DCHECK_EQ(descriptor[descriptor.size()-1], ';'); - std::string dot = descriptor.substr(1, descriptor.size()-2); + std::string dot(descriptor.substr(1, descriptor.size() - 2)); std::replace(dot.begin(), dot.end(), '/', '.'); return dot; } @@ -571,7 +571,7 @@ std::string GetArtCacheOrDie() { return ""; } - std::string art_cache = StringPrintf("%s/art-cache", data_root); + std::string art_cache(StringPrintf("%s/art-cache", data_root)); if (!OS::DirectoryExists(art_cache.c_str())) { if (StringPiece(art_cache).starts_with("/tmp/")) { @@ -589,7 +589,7 @@ std::string GetArtCacheOrDie() { } std::string GetArtCacheFilenameOrDie(const std::string& location) { - std::string art_cache = GetArtCacheOrDie(); + std::string art_cache(GetArtCacheOrDie()); CHECK_EQ(location[0], '/'); std::string cache_file(location, 1); // skip leading slash std::replace(cache_file.begin(), cache_file.end(), '/', '@'); |