]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-json: reorder enum so that SD_JSON_FORMAT_OFF is first
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 4 Oct 2024 15:37:25 +0000 (17:37 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 6 Oct 2024 17:48:17 +0000 (19:48 +0200)
This doesn't really matter, all bits in a word are created equal, but having
the "off" value in the middle seems strange.

src/systemd/sd-json.h

index 4b5cbd4e5da44031b30bd179e0d484c83902ee1a..b0b171dcb62676ab34639870d2732f6c87bac345 100644 (file)
@@ -136,18 +136,18 @@ int sd_json_variant_is_sensitive_recursive(sd_json_variant *v);
 int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *reterr_column);
 
 __extension__ typedef enum _SD_ENUM_TYPE_S64(sd_json_format_flags_t) {
-        SD_JSON_FORMAT_NEWLINE          = 1 << 0, /* suffix with newline */
-        SD_JSON_FORMAT_PRETTY           = 1 << 1, /* add internal whitespace to appeal to human readers */
-        SD_JSON_FORMAT_PRETTY_AUTO      = 1 << 2, /* same, but only if connected to a tty (and JSON_FORMAT_NEWLINE otherwise) */
-        SD_JSON_FORMAT_COLOR            = 1 << 3, /* insert ANSI color sequences */
-        SD_JSON_FORMAT_COLOR_AUTO       = 1 << 4, /* insert ANSI color sequences if colors_enabled() says so */
-        SD_JSON_FORMAT_SOURCE           = 1 << 5, /* prefix with source filename/line/column */
-        SD_JSON_FORMAT_SSE              = 1 << 6, /* prefix/suffix with W3C server-sent events */
-        SD_JSON_FORMAT_SEQ              = 1 << 7, /* prefix/suffix with RFC 7464 application/json-seq */
-        SD_JSON_FORMAT_FLUSH            = 1 << 8, /* call fflush() after dumping JSON */
-        SD_JSON_FORMAT_EMPTY_ARRAY      = 1 << 9, /* output "[]" for empty input */
-        SD_JSON_FORMAT_OFF              = 1 << 10, /* make json_variant_format() fail with -ENOEXEC */
-        SD_JSON_FORMAT_CENSOR_SENSITIVE = 1 << 11, /* Replace all sensitive elements with the string "<sensitive data>" */
+        SD_JSON_FORMAT_OFF              = 1 << 0,  /* disable json output, make json_variant_format() fail with -ENOEXEC */
+        SD_JSON_FORMAT_NEWLINE          = 1 << 1,  /* suffix with newline */
+        SD_JSON_FORMAT_PRETTY           = 1 << 2,  /* add internal whitespace to appeal to human readers */
+        SD_JSON_FORMAT_PRETTY_AUTO      = 1 << 3,  /* same, but only if connected to a tty (and JSON_FORMAT_NEWLINE otherwise) */
+        SD_JSON_FORMAT_COLOR            = 1 << 4,  /* insert ANSI color sequences */
+        SD_JSON_FORMAT_COLOR_AUTO       = 1 << 5,  /* insert ANSI color sequences if colors_enabled() says so */
+        SD_JSON_FORMAT_SOURCE           = 1 << 6,  /* prefix with source filename/line/column */
+        SD_JSON_FORMAT_SSE              = 1 << 7,  /* prefix/suffix with W3C server-sent events */
+        SD_JSON_FORMAT_SEQ              = 1 << 8,  /* prefix/suffix with RFC 7464 application/json-seq */
+        SD_JSON_FORMAT_FLUSH            = 1 << 9,  /* call fflush() after dumping JSON */
+        SD_JSON_FORMAT_EMPTY_ARRAY      = 1 << 10, /* output "[]" for empty input */
+        SD_JSON_FORMAT_CENSOR_SENSITIVE = 1 << 11, /* replace all sensitive elements with the string "<sensitive data>" */
         _SD_ENUM_FORCE_S64(JSON_FORMAT_FLAGS)
 } sd_json_format_flags_t;