]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
json: use unsigned for refernce counter
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 16 Apr 2022 21:46:25 +0000 (06:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Apr 2022 08:56:40 +0000 (17:56 +0900)
For other places, we use unsigned for reference counter.

src/shared/json.c

index dff95eda2655d2aa0352e47ce3d6877c10da4522..f66b7df24ca484c51b4a7f666bf450283cfed39f 100644 (file)
@@ -41,7 +41,7 @@ assert_cc(DEPTH_MAX <= UINT16_MAX);
 
 typedef struct JsonSource {
         /* When we parse from a file or similar, encodes the filename, to indicate the source of a json variant */
-        size_t n_ref;
+        unsigned n_ref;
         unsigned max_line;
         unsigned max_column;
         char name[];
@@ -53,7 +53,7 @@ struct JsonVariant {
                 /* We either maintain a reference counter for this variant itself, or we are embedded into an
                  * array/object, in which case only that surrounding object is ref-counted. (If 'embedded' is false,
                  * see below.) */
-                size_t n_ref;
+                unsigned n_ref;
 
                 /* If this JsonVariant is part of an array/object, then this field points to the surrounding
                  * JSON_VARIANT_ARRAY/JSON_VARIANT_OBJECT object. (If 'embedded' is true, see below.) */