summaryrefslogtreecommitdiffstats
path: root/generate_cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generate_cpp.cpp')
-rw-r--r--generate_cpp.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/generate_cpp.cpp b/generate_cpp.cpp
index 77badc4..a8b2157 100644
--- a/generate_cpp.cpp
+++ b/generate_cpp.cpp
@@ -284,7 +284,7 @@ unique_ptr<Declaration> DefineClientTransaction(const TypeNamespace& types,
// if (_aidl_ret_status != ::android::OK) { goto error; }
for (const AidlArgument* a : method.GetInArguments()) {
const Type* type = a->GetType().GetLanguageType<Type>();
- string method = type->WriteToParcelMethod();
+ const string& method = type->WriteToParcelMethod();
string var_name = ((a->IsOut()) ? "*" : "") + a->GetName();
var_name = type->WriteCast(var_name);
@@ -334,7 +334,7 @@ unique_ptr<Declaration> DefineClientTransaction(const TypeNamespace& types,
// If the method is expected to return something, read it first by convention.
const Type* return_type = method.GetType().GetLanguageType<Type>();
if (return_type != types.VoidType()) {
- string method_call = return_type->ReadFromParcelMethod();
+ const string& method_call = return_type->ReadFromParcelMethod();
b->AddStatement(new Assignment(
kAndroidStatusVarName,
new MethodCall(StringPrintf("%s.%s", kReplyVarName,
@@ -438,7 +438,7 @@ bool HandleServerTransaction(const TypeNamespace& types,
// _aidl_ret_status = _aidl_data.ReadInt32(&in_param_name);
// if (_aidl_ret_status != ::android::OK) { break; }
const Type* type = a->GetType().GetLanguageType<Type>();
- string readMethod = type->ReadFromParcelMethod();
+ const string& readMethod = type->ReadFromParcelMethod();
b->AddStatement(new Assignment{
kAndroidStatusVarName,
@@ -485,7 +485,7 @@ bool HandleServerTransaction(const TypeNamespace& types,
// _aidl_ret_status = data.WriteInt32(out_param_name);
// if (_aidl_ret_status != ::android::OK) { break; }
const Type* type = a->GetType().GetLanguageType<Type>();
- string writeMethod = type->WriteToParcelMethod();
+ const string& writeMethod = type->WriteToParcelMethod();
b->AddStatement(new Assignment{
kAndroidStatusVarName,