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

Side by Side Diff: mojo/public/c/lib/bindings/struct.c

Issue 2232833003: Change the canonical way to include the C bindings headers to <mojo/bindings/*.h>. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_mojo_tests
Patch Set: rebased Created 4 years, 4 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
« no previous file with comments | « mojo/public/c/lib/bindings/message.c ('k') | mojo/public/c/lib/bindings/type_descriptor.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "mojo/public/c/bindings/struct.h" 5 #include <mojo/bindings/struct.h>
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <mojo/bindings/internal/type_descriptor.h>
9 #include <mojo/bindings/union.h>
8 #include <string.h> 10 #include <string.h>
9 11
10 #include "mojo/public/c/bindings/lib/type_descriptor.h"
11 #include "mojo/public/c/bindings/union.h"
12
13 size_t MojomStruct_ComputeSerializedSize( 12 size_t MojomStruct_ComputeSerializedSize(
14 const struct MojomTypeDescriptorStruct* in_type_desc, 13 const struct MojomTypeDescriptorStruct* in_type_desc,
15 const struct MojomStructHeader* in_struct) { 14 const struct MojomStructHeader* in_struct) {
16 assert(in_struct); 15 assert(in_struct);
17 assert(in_type_desc); 16 assert(in_type_desc);
18 17
19 size_t size = in_struct->num_bytes; 18 size_t size = in_struct->num_bytes;
20 for (size_t i = 0; i < in_type_desc->num_entries; i++) { 19 for (size_t i = 0; i < in_type_desc->num_entries; i++) {
21 const struct MojomTypeDescriptorStructEntry* entry = 20 const struct MojomTypeDescriptorStructEntry* entry =
22 &(in_type_desc->entries[i]); 21 &(in_type_desc->entries[i]);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 entry->elem_type, 195 entry->elem_type,
197 entry->elem_descriptor, 196 entry->elem_descriptor,
198 in_elem_data, 197 in_elem_data,
199 out_elem_data)) { 198 out_elem_data)) {
200 return false; 199 return false;
201 } 200 }
202 } 201 }
203 202
204 return true; 203 return true;
205 } 204 }
OLDNEW
« no previous file with comments | « mojo/public/c/lib/bindings/message.c ('k') | mojo/public/c/lib/bindings/type_descriptor.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698