Clean up reporting of bad oneway return/out params
Change the messages on detecting a bad parameter direction from:
a/IFoo.aidl:1oneway method cannot have out parameters: f
to the more readable:
a/IBar.aidl:1 oneway method 'f' cannot have out parameters
Bug: None
Test: unit test output is prettier
Change-Id: I1b8da80edf4d04c0fae110c941300afa2080deb7
diff --git a/aidl.cpp b/aidl.cpp
index 670e8dc..133fe3d 100644
--- a/aidl.cpp
+++ b/aidl.cpp
@@ -201,8 +201,8 @@
if (oneway && m->GetType().GetName() != "void") {
cerr << filename << ":" << m->GetLine()
- << "oneway method cannot return a value: "
- << m->GetName() << endl;
+ << " oneway method '" << m->GetName() << "' cannot return a value"
+ << endl;
err = 1;
}
@@ -215,8 +215,8 @@
if (oneway && arg->IsOut()) {
cerr << filename << ":" << m->GetLine()
- << "oneway method cannot have out parameters: "
- << m->GetName() << endl;
+ << " oneway method '" << m->GetName()
+ << "' cannot have out parameters" << endl;
err = 1;
}
}