diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/install.c | 6 | ||||
-rw-r--r-- | src/shared/install.h | 2 | ||||
-rw-r--r-- | src/shared/test-tables.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/shared/install.c b/src/shared/install.c index bc2a377971..a2f84f893e 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1877,7 +1877,7 @@ int unit_file_preset( assert(scope >= 0); assert(scope < _UNIT_FILE_SCOPE_MAX); - assert(mode < _UNIT_FILE_PRESET_MODE_MAX); + assert(mode < _UNIT_FILE_PRESET_MAX); r = lookup_paths_init_from_scope(&paths, scope, root_dir); if (r < 0) @@ -1945,7 +1945,7 @@ int unit_file_preset_all( assert(scope >= 0); assert(scope < _UNIT_FILE_SCOPE_MAX); - assert(mode < _UNIT_FILE_PRESET_MODE_MAX); + assert(mode < _UNIT_FILE_PRESET_MAX); r = lookup_paths_init_from_scope(&paths, scope, root_dir); if (r < 0) @@ -2182,7 +2182,7 @@ static const char* const unit_file_change_type_table[_UNIT_FILE_CHANGE_TYPE_MAX] DEFINE_STRING_TABLE_LOOKUP(unit_file_change_type, UnitFileChangeType); -static const char* const unit_file_preset_mode_table[_UNIT_FILE_PRESET_MODE_MAX] = { +static const char* const unit_file_preset_mode_table[_UNIT_FILE_PRESET_MAX] = { [UNIT_FILE_PRESET_FULL] = "full", [UNIT_FILE_PRESET_ENABLE_ONLY] = "enable-only", [UNIT_FILE_PRESET_DISABLE_ONLY] = "disable-only", diff --git a/src/shared/install.h b/src/shared/install.h index 91ce192a4f..ff16d9f681 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -49,7 +49,7 @@ typedef enum UnitFilePresetMode { UNIT_FILE_PRESET_FULL, UNIT_FILE_PRESET_ENABLE_ONLY, UNIT_FILE_PRESET_DISABLE_ONLY, - _UNIT_FILE_PRESET_MODE_MAX, + _UNIT_FILE_PRESET_MAX, _UNIT_FILE_PRESET_INVALID = -1 } UnitFilePresetMode; diff --git a/src/shared/test-tables.h b/src/shared/test-tables.h index 3261302077..3ac8729d74 100644 --- a/src/shared/test-tables.h +++ b/src/shared/test-tables.h @@ -49,3 +49,6 @@ static inline void _test_table(const char *name, #define test_table(lower, upper) \ _test_table(STRINGIFY(lower), lower##_to_string, lower##_from_string, _##upper##_MAX, false) + +#define test_table_sparse(lower, upper) \ + _test_table(STRINGIFY(lower), lower##_to_string, lower##_from_string, _##upper##_MAX, true) |