summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable.h
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2016-08-10 14:15:30 -0700
committer Chih-Hung Hsieh <chh@google.com> 2016-08-11 15:16:41 -0700
commit9b8528fee4eed35b8e887ded0851d08eb2b10db6 (patch)
tree36df1cee89b3689454e6b09a6bfa5eabfb3214b1 /tools/aapt2/ResourceTable.h
parent7310353aeb771c109e5aea2c5415fa502eb13a7b (diff)
Fix clang-tidy warnings in aapt and aapt2.
* Add explicit keyword to conversion constructors. * Add NOLINT(implicit) comments for implicit conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r--tools/aapt2/ResourceTable.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index a5efe355a76c..6b52a4360b7a 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -103,7 +103,7 @@ public:
*/
std::vector<std::unique_ptr<ResourceConfigValue>> values;
- ResourceEntry(const StringPiece& name) : name(name.toString()) { }
+ explicit ResourceEntry(const StringPiece& name) : name(name.toString()) { }
ResourceConfigValue* findValue(const ConfigDescription& config);
ResourceConfigValue* findValue(const ConfigDescription& config, const StringPiece& product);
@@ -200,7 +200,7 @@ public:
IDiagnostics* diag);
bool addResource(const ResourceNameRef& name,
- const ResourceId resId,
+ const ResourceId& resId,
const ConfigDescription& config,
const StringPiece& product,
std::unique_ptr<Value> value,
@@ -231,19 +231,19 @@ public:
IDiagnostics* diag);
bool addResourceAllowMangled(const ResourceNameRef& name,
- const ResourceId id,
+ const ResourceId& id,
const ConfigDescription& config,
const StringPiece& product,
std::unique_ptr<Value> value,
IDiagnostics* diag);
bool setSymbolState(const ResourceNameRef& name,
- const ResourceId resId,
+ const ResourceId& resId,
const Symbol& symbol,
IDiagnostics* diag);
bool setSymbolStateAllowMangled(const ResourceNameRef& name,
- const ResourceId resId,
+ const ResourceId& resId,
const Symbol& symbol,
IDiagnostics* diag);
@@ -294,16 +294,16 @@ private:
IDiagnostics* diag);
bool addResourceImpl(const ResourceNameRef& name,
- ResourceId resId,
+ const ResourceId& resId,
const ConfigDescription& config,
const StringPiece& product,
std::unique_ptr<Value> value,
const char* validChars,
- std::function<int(Value*,Value*)> conflictResolver,
+ const std::function<int(Value*,Value*)>& conflictResolver,
IDiagnostics* diag);
bool setSymbolStateImpl(const ResourceNameRef& name,
- ResourceId resId,
+ const ResourceId& resId,
const Symbol& symbol,
const char* validChars,
IDiagnostics* diag);