]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
json: slightly reorder JsonVariant
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Oct 2018 12:49:50 +0000 (14:49 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Oct 2018 14:44:51 +0000 (16:44 +0200)
Let's move things around a bit, so that the trailing unused whitespace
within the structure due to padding is placed together, so that it is
easier to use for new fields. (Found with pahole)

src/basic/json.c

index ec2952c6da3b3aa277fe8105da943bfba01875a6..b6106498bb7def7f22eefd11504ae243021eacf4 100644 (file)
@@ -45,6 +45,10 @@ struct JsonVariant {
                 JsonVariant *parent;
         };
 
+        /* If this was parsed from some file or buffer, this stores where from, as well as the source line/column */
+        JsonSource *source;
+        unsigned line, column;
+
         JsonVariantType type:5;
 
         /* A marker whether this variant is embedded into in array/object or not. If true, the 'parent' pointer above
@@ -59,10 +63,6 @@ struct JsonVariant {
         /* While comparing two arrays, we use this for marking what we already have seen */
         bool is_marked:1;
 
-        /* If this was parsed from some file or buffer, this stores where from, as well as the source line/column */
-        unsigned line, column;
-        JsonSource *source;
-
         union {
                 /* For simple types we store the value in-line. */
                 JsonValue value;