naccyde / rpms / systemd

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