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

Side by Side Diff: mojo/public/c/lib/bindings/map.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/buffer.c ('k') | mojo/public/c/lib/bindings/message.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/map.h" 5 #include <mojo/bindings/map.h>
6
7 #include <mojo/macros.h>
6 8
7 struct MojomMapLayout { 9 struct MojomMapLayout {
8 struct MojomStructHeader header_; 10 struct MojomStructHeader header_;
9 union MojomArrayHeaderPtr keys; 11 union MojomArrayHeaderPtr keys;
10 union MojomArrayHeaderPtr values; 12 union MojomArrayHeaderPtr values;
11 }; 13 };
12 MOJO_STATIC_ASSERT(sizeof(struct MojomMapLayout) == 24u, 14 MOJO_STATIC_ASSERT(sizeof(struct MojomMapLayout) == 24u,
13 "MojomMapLayout is an invalid size."); 15 "MojomMapLayout is an invalid size.");
14 16
15 MojomValidationResult MojomMap_Validate( 17 MojomValidationResult MojomMap_Validate(
(...skipping 11 matching lines...) Expand all
27 struct MojomArrayHeader* values_arr = 29 struct MojomArrayHeader* values_arr =
28 (struct MojomArrayHeader*)((char*)map + 30 (struct MojomArrayHeader*)((char*)map +
29 (offsetof(struct MojomMapLayout, values) + 31 (offsetof(struct MojomMapLayout, values) +
30 map->values.offset)); 32 map->values.offset));
31 33
32 if (keys_arr->num_elements != values_arr->num_elements) 34 if (keys_arr->num_elements != values_arr->num_elements)
33 return MOJOM_VALIDATION_DIFFERENT_SIZED_ARRAYS_IN_MAP; 35 return MOJOM_VALIDATION_DIFFERENT_SIZED_ARRAYS_IN_MAP;
34 36
35 return MOJOM_VALIDATION_ERROR_NONE; 37 return MOJOM_VALIDATION_ERROR_NONE;
36 } 38 }
OLDNEW
« no previous file with comments | « mojo/public/c/lib/bindings/buffer.c ('k') | mojo/public/c/lib/bindings/message.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698