Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl

Issue 2392713002: mojo: Mark DataView readers as WARN_UNUSED_RESULT. (Closed)
Patch Set: Fix attribute placement to appease gcc Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/struct_data_view_declaration.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl
index 7f363a6ce129f46fb90ef602870ae828919f0368..5973ba294b2d94e8b6d07eadee2672b1f646693d 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/union_data_view_declaration.tmpl
@@ -31,7 +31,7 @@ class {{union.name}}DataView {
{{kind|cpp_data_view_type}}* output);
template <typename UserType>
- bool Read{{name|under_to_camel}}(UserType* output) {
+ WARN_UNUSED_RESULT bool Read{{name|under_to_camel}}(UserType* output) {
DCHECK(is_{{name}}());
return mojo::internal::Deserialize<{{kind|unmapped_type_for_serializer}}>(
data_->data.f_{{name}}.Get(), output, context_);
@@ -39,7 +39,7 @@ class {{union.name}}DataView {
{%- elif kind|is_enum_kind %}
template <typename UserType>
- bool Read{{name|under_to_camel}}(UserType* output) const {
+ WARN_UNUSED_RESULT bool Read{{name|under_to_camel}}(UserType* output) const {
DCHECK(is_{{name}}());
return mojo::internal::Deserialize<{{kind|unmapped_type_for_serializer}}>(
data_->data.f_{{name}}, output);
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/struct_data_view_declaration.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698