summaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-27 12:58:25 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-27 12:58:25 +0000
commit8e2e2899446ea21d82eb822c5734d04e756b7184 (patch)
tree78830bac1a0b6df41d9baa4c07055452c3d867a6 /json.h
parentccc3c5d85f1fabc99e3d4acd43fa5b9da8602cdf (diff)
downloadgpsd-8e2e2899446ea21d82eb822c5734d04e756b7184.tar.gz
Use STRUCTARRAY everywhere it's apprpriate. JSON regression tests pass.
Diffstat (limited to 'json.h')
-rw-r--r--json.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/json.h b/json.h
index b732a39f..597487a1 100644
--- a/json.h
+++ b/json.h
@@ -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, \