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

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

Issue 2218493002: C bindings string descriptor: Use field initializers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « no previous file | no next file » | 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/lib/type_descriptor.h" 5 #include "mojo/public/c/bindings/lib/type_descriptor.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "mojo/public/c/bindings/array.h" 10 #include "mojo/public/c/bindings/array.h"
11 #include "mojo/public/c/bindings/interface.h" 11 #include "mojo/public/c/bindings/interface.h"
12 #include "mojo/public/c/bindings/lib/util.h" 12 #include "mojo/public/c/bindings/lib/util.h"
13 #include "mojo/public/c/bindings/map.h" 13 #include "mojo/public/c/bindings/map.h"
14 #include "mojo/public/c/bindings/struct.h" 14 #include "mojo/public/c/bindings/struct.h"
15 #include "mojo/public/c/bindings/union.h" 15 #include "mojo/public/c/bindings/union.h"
16 16
17 const struct MojomTypeDescriptorArray g_mojom_string_type_description = { 17 const struct MojomTypeDescriptorArray g_mojom_string_type_description = {
18 MOJOM_TYPE_DESCRIPTOR_TYPE_POD, // elem_type 18 .elem_type = MOJOM_TYPE_DESCRIPTOR_TYPE_POD,
19 NULL, // elem_descriptor 19 .elem_descriptor = NULL,
20 0, // num_elements 20 .num_elements = 0,
21 8, // elem_num_bits 21 .elem_num_bits = 8,
22 false, // nullable 22 .nullable = false,
23 }; 23 };
24 24
25 // The encoding of a MojoHandle is an index into an array of Handles. A 25 // The encoding of a MojoHandle is an index into an array of Handles. A
26 // null/invalid handle is encoded as index (which is unsigned) "-1", which 26 // null/invalid handle is encoded as index (which is unsigned) "-1", which
27 // equates to the highest possible index. 27 // equates to the highest possible index.
28 static const MojoHandle kEncodedHandleInvalid = (MojoHandle)-1; 28 static const MojoHandle kEncodedHandleInvalid = (MojoHandle)-1;
29 29
30 bool MojomType_IsPointer(enum MojomTypeDescriptorType type) { 30 bool MojomType_IsPointer(enum MojomTypeDescriptorType type) {
31 return type == MOJOM_TYPE_DESCRIPTOR_TYPE_STRUCT_PTR || 31 return type == MOJOM_TYPE_DESCRIPTOR_TYPE_STRUCT_PTR ||
32 type == MOJOM_TYPE_DESCRIPTOR_TYPE_MAP_PTR || 32 type == MOJOM_TYPE_DESCRIPTOR_TYPE_MAP_PTR ||
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 in_union_data, 451 in_union_data,
452 out_union_data); 452 out_union_data);
453 case MOJOM_TYPE_DESCRIPTOR_TYPE_HANDLE: 453 case MOJOM_TYPE_DESCRIPTOR_TYPE_HANDLE:
454 case MOJOM_TYPE_DESCRIPTOR_TYPE_INTERFACE: 454 case MOJOM_TYPE_DESCRIPTOR_TYPE_INTERFACE:
455 case MOJOM_TYPE_DESCRIPTOR_TYPE_POD: 455 case MOJOM_TYPE_DESCRIPTOR_TYPE_POD:
456 break; 456 break;
457 } 457 }
458 458
459 return true; 459 return true;
460 } 460 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698