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

Unified Diff: mojom/generators/c/cgen/header.go

Issue 2163793002: C bindings: Implement _Validate(), and some pre-requisites (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address comments Created 4 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 side-by-side diff with in-line comments
Download patch
Index: mojom/generators/c/cgen/header.go
diff --git a/mojom/generators/c/cgen/header.go b/mojom/generators/c/cgen/header.go
index e7ffe722ea01604868874108b91478fa62ba47a8..1cf7956e1302a5f933b71649eb7c6b2cbeffc3a9 100644
--- a/mojom/generators/c/cgen/header.go
+++ b/mojom/generators/c/cgen/header.go
@@ -447,7 +447,7 @@ func getPaddingAfter(fields []mojom_types.StructField, i int, fileGraph *mojom_f
// Calculate the remaining padding for the last field
if i == len(fields)-1 {
// m = (field offset + field size) % kAlignment
- m := (fields[i].Offset + mojomTypeSize(fields[i].Type, fileGraph)) & (kAlignment - 1)
+ m := (fields[i].Offset + mojomTypeByteSize(fields[i].Type, fileGraph)) & (kAlignment - 1)
if m != 0 {
return kAlignment - m
}
@@ -456,7 +456,7 @@ func getPaddingAfter(fields []mojom_types.StructField, i int, fileGraph *mojom_f
// (next element's offset)
// - (current element's offset + current element's size)
- diff := int64(fields[i+1].Offset) - (int64(fields[i].Offset) + int64(mojomTypeSize(fields[i].Type, fileGraph)))
+ diff := int64(fields[i+1].Offset) - (int64(fields[i].Offset) + int64(mojomTypeByteSize(fields[i].Type, fileGraph)))
if diff <= 0 {
return 0
}
« no previous file with comments | « mojo/public/tools/bindings/mojom_tool/bin/mac64/generators/c.sha1 ('k') | mojom/generators/c/cgen/type_table.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698