]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: drop _pure_ + _const_ from local, static functions
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Aug 2023 08:48:47 +0000 (10:48 +0200)
committerMike Yuan <me@yhndnzj.com>
Wed, 9 Aug 2023 16:01:04 +0000 (00:01 +0800)
commitd1e8e8b5ae3533a0a24006029872a98f2b9283fa
treecc6dbb55b69230cf559084fbead2b49a8b685732
parent07ba0bf7f55969fd47c8f3eef69978e3c28d2639
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)
18 files changed:
src/basic/fd-util.c
src/basic/prioq.c
src/core/device.c
src/core/mount.c
src/core/path.c
src/core/scope.c
src/core/service.c
src/core/slice.c
src/core/socket.c
src/core/swap.c
src/core/target.c
src/core/timer.c
src/core/transaction.c
src/libsystemd/sd-journal/fsprg.c
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/mmap-cache.c
src/login/logind-utmp.c
src/shared/bus-polkit.c