tree-wide: drop _pure_ + _const_ from local, static functions

This is supposed to be a help for compilers to apply optimizations on
functions where they can't determine whether they are const/pure on
their own. For static, local functions the compiler can do this on its
own easily however, hence the decoration with pure/const is just noise.
Let's drop it, and let the compiler to its thing better.

(Use it for exported functions, since compilers can't 'reach-over' into
other modules to determine if they are pure, except if LTO is used)
This commit is contained in:
Lennart Poettering
2023-08-10 00:01:04 +08:00
committed by Mike Yuan
parent 07ba0bf7f5
commit d1e8e8b5ae
18 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -733,13 +733,13 @@ static int timer_deserialize_item(Unit *u, const char *key, const char *value, F
return 0;
}
_pure_ static UnitActiveState timer_active_state(Unit *u) {
static UnitActiveState timer_active_state(Unit *u) {
assert(u);
return state_translation_table[TIMER(u)->state];
}
_pure_ static const char *timer_sub_state_to_string(Unit *u) {
static const char *timer_sub_state_to_string(Unit *u) {
assert(u);
return timer_state_to_string(TIMER(u)->state);