ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
8d419f
From 46118fd04a49b25bc0c686b07d1b26309ab4e395 Mon Sep 17 00:00:00 2001
8d419f
From: Yu Watanabe <watanabe.yu+github@gmail.com>
8d419f
Date: Sun, 17 Apr 2022 06:46:25 +0900
8d419f
Subject: [PATCH] json: use unsigned for refernce counter
8d419f
8d419f
For other places, we use unsigned for reference counter.
8d419f
8d419f
(cherry picked from commit 6dd18b34cf53ab663140f43f8814904c71cc29f7)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 src/shared/json.c | 4 ++--
8d419f
 1 file changed, 2 insertions(+), 2 deletions(-)
8d419f
8d419f
diff --git a/src/shared/json.c b/src/shared/json.c
8d419f
index 6d23bdf4f9..bcc109abc2 100644
8d419f
--- a/src/shared/json.c
8d419f
+++ b/src/shared/json.c
8d419f
@@ -41,7 +41,7 @@ assert_cc(DEPTH_MAX <= UINT16_MAX);
8d419f
 
8d419f
 typedef struct JsonSource {
8d419f
         /* When we parse from a file or similar, encodes the filename, to indicate the source of a json variant */
8d419f
-        size_t n_ref;
8d419f
+        unsigned n_ref;
8d419f
         unsigned max_line;
8d419f
         unsigned max_column;
8d419f
         char name[];
8d419f
@@ -53,7 +53,7 @@ struct JsonVariant {
8d419f
                 /* We either maintain a reference counter for this variant itself, or we are embedded into an
8d419f
                  * array/object, in which case only that surrounding object is ref-counted. (If 'embedded' is false,
8d419f
                  * see below.) */
8d419f
-                size_t n_ref;
8d419f
+                unsigned n_ref;
8d419f
 
8d419f
                 /* If this JsonVariant is part of an array/object, then this field points to the surrounding
8d419f
                  * JSON_VARIANT_ARRAY/JSON_VARIANT_OBJECT object. (If 'embedded' is true, see below.) */