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

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Issue 397453004: Mojo: Correctly handle large unsigned integer literals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ULL Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(__clang__) 5 #if defined(__clang__)
6 #pragma clang diagnostic push 6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field" 7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #endif 8 #endif
9 9
10 #include "{{module.path}}.h" 10 #include "{{module.path}}.h"
11 11
12 #include "mojo/public/cpp/bindings/lib/array_serialization.h" 12 #include "mojo/public/cpp/bindings/lib/array_serialization.h"
13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" 13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
14 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" 14 #include "mojo/public/cpp/bindings/lib/bounds_checker.h"
15 #include "mojo/public/cpp/bindings/lib/message_builder.h" 15 #include "mojo/public/cpp/bindings/lib/message_builder.h"
16 #include "mojo/public/cpp/bindings/lib/string_serialization.h" 16 #include "mojo/public/cpp/bindings/lib/string_serialization.h"
17 #include "mojo/public/cpp/bindings/lib/validation_errors.h" 17 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
18 18
19 {%- for namespace in namespaces_as_array %} 19 {%- for namespace in namespaces_as_array %}
20 namespace {{namespace}} { 20 namespace {{namespace}} {
21 {%- endfor %} 21 {%- endfor %}
22 22
23 {#--- Constants #} 23 {#--- Constants #}
24 {% for constant in module.constants %} 24 {% for constant in module.constants %}
25 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant.value|expres sion_to_text}}; 25 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_val ue}};
26 {%- endfor %} 26 {%- endfor %}
27 27
28 namespace internal { 28 namespace internal {
29 namespace { 29 namespace {
30 30
31 #pragma pack(push, 1) 31 #pragma pack(push, 1)
32 32
33 {#--- Interface parameter definitions #} 33 {#--- Interface parameter definitions #}
34 {%- for interface in interfaces %} 34 {%- for interface in interfaces %}
35 {%- for method in interface.methods %} 35 {%- for method in interface.methods %}
(...skipping 15 matching lines...) Expand all
51 {#--- Struct definitions #} 51 {#--- Struct definitions #}
52 {% for struct in structs %} 52 {% for struct in structs %}
53 {%- include "struct_definition.tmpl" %} 53 {%- include "struct_definition.tmpl" %}
54 {%- endfor %} 54 {%- endfor %}
55 55
56 } // namespace internal 56 } // namespace internal
57 57
58 {#--- Struct Constants #} 58 {#--- Struct Constants #}
59 {%- for struct in structs %} 59 {%- for struct in structs %}
60 {% for constant in struct.constants %} 60 {% for constant in struct.constants %}
61 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant.value|expression_to_text}}; 61 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant|constant_value}};
62 {%- endfor %} 62 {%- endfor %}
63 {%- endfor %} 63 {%- endfor %}
64 64
65 {#--- Struct builder definitions #} 65 {#--- Struct builder definitions #}
66 {%- for struct in structs %} 66 {%- for struct in structs %}
67 {%- include "wrapper_class_definition.tmpl" %} 67 {%- include "wrapper_class_definition.tmpl" %}
68 {%- endfor %} 68 {%- endfor %}
69 69
70 {#--- Interface definitions #} 70 {#--- Interface definitions #}
71 {%- for interface in interfaces %} 71 {%- for interface in interfaces %}
72 {%- include "interface_definition.tmpl" %} 72 {%- include "interface_definition.tmpl" %}
73 {%- endfor %} 73 {%- endfor %}
74 74
75 {#--- Struct Serialization Helpers #} 75 {#--- Struct Serialization Helpers #}
76 {%- for struct in structs %} 76 {%- for struct in structs %}
77 {%- include "struct_serialization_definition.tmpl" %} 77 {%- include "struct_serialization_definition.tmpl" %}
78 {%- endfor %} 78 {%- endfor %}
79 79
80 {%- for namespace in namespaces_as_array|reverse %} 80 {%- for namespace in namespaces_as_array|reverse %}
81 } // namespace {{namespace}} 81 } // namespace {{namespace}}
82 {%- endfor %} 82 {%- endfor %}
83 83
84 #if defined(__clang__) 84 #if defined(__clang__)
85 #pragma clang diagnostic pop 85 #pragma clang diagnostic pop
86 #endif 86 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698