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

Unified Diff: mojo/public/tools/bindings/generators/mojom_cpp_generator.py

Issue 605443002: The default value for NullableString should be null (was "") (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test fields with type double Created 6 years, 3 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
Index: mojo/public/tools/bindings/generators/mojom_cpp_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 8a17f841e7f71a1fbc64887ad90d39984107b063..14c069f89e477ba100ced602df72856c7273c999 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -233,6 +233,9 @@ def TranslateConstants(token, kind):
if token.value == "double.NAN" or token.value == "float.NAN":
return "NAN";
+ if (mojom.IsFloatKind(kind)):
+ return token if token.isdigit() else token + "f";
+
return '%s%s' % (token, _kind_to_cpp_literal_suffix.get(kind, ''))
def ExpressionToText(value, kind=None):

Powered by Google App Engine
This is Rietveld 408576698