diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-27 12:58:25 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-27 12:58:25 +0000 |
commit | 8e2e2899446ea21d82eb822c5734d04e756b7184 (patch) | |
tree | 78830bac1a0b6df41d9baa4c07055452c3d867a6 /json.h | |
parent | ccc3c5d85f1fabc99e3d4acd43fa5b9da8602cdf (diff) | |
download | gpsd-8e2e2899446ea21d82eb822c5734d04e756b7184.tar.gz |
Use STRUCTARRAY everywhere it's apprpriate. JSON regression tests pass.
Diffstat (limited to 'json.h')
-rw-r--r-- | json.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -80,15 +80,14 @@ const char *json_error_string(int); * Use the following macros to declare template initializers for structobject * arrays. Writing the equivalents out by hand is error-prone. * - * STRUCTOBJECT takes a type t (one of the enumerated scalar field types - * above), a structure name s, and a fieldname f in s. + * STRUCTOBJECT takes a structure name s, and a fieldname f in s. * * STRUCTARRAY takes the name of a structure array, a pointer to a an * initializer defining the subobject type, and the address of an integer to * store the length in. */ -#define STRUCTOBJECT(t, s, f) .type = t, .addr.offset = offsetof(s, f) -#define STRUCTARRAY(a, e, n) .type = array, \ +#define STRUCTOBJECT(s, f) .addr.offset = offsetof(s, f) +#define STRUCTARRAY(a, e, n) \ .addr.array.element_type = structobject, \ .addr.array.arr.objects.subtype = e, \ .addr.array.arr.objects.base = (char*)a, \ |