]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: fix argument type of ConfigPerfItemLookup 29989/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 15:37:18 +0000 (00:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 15:46:39 +0000 (00:46 +0900)
Prompted by #29972.

src/shared/conf-parser.h
src/test/test-load-fragment.c

index f1b03a8d152b5f1bcda7b9600602e5266b216215..a1768cd9198e9c511f1075bf84c4a6ebd2431b5c 100644 (file)
@@ -62,7 +62,7 @@ typedef struct ConfigPerfItem {
 } ConfigPerfItem;
 
 /* Prototype for a low-level gperf lookup function */
-typedef const ConfigPerfItem* (*ConfigPerfItemLookup)(const char *section_and_lvalue, unsigned length);
+typedef const ConfigPerfItem* (*ConfigPerfItemLookup)(const char *section_and_lvalue, GPERF_LEN_TYPE length);
 
 /* Prototype for a generic high-level lookup function */
 typedef int (*ConfigItemLookup)(
index ac0ad80132d090f03d320fd2ccd66237c03218f6..8d2cec0c01bd6394c980c849cb74db4a0184ebf8 100644 (file)
@@ -39,6 +39,9 @@ static char *runtime_dir = NULL;
 
 STATIC_DESTRUCTOR_REGISTER(runtime_dir, rm_rf_physical_and_freep);
 
+/* For testing type compatibility. */
+_unused_ ConfigPerfItemLookup unused_lookup = load_fragment_gperf_lookup;
+
 TEST_RET(unit_file_get_set) {
         int r;
         _cleanup_hashmap_free_ Hashmap *h = NULL;