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
+1 -1
View File
@@ -191,7 +191,7 @@ int fd_cloexec_many(const int fds[], size_t n_fds, bool cloexec) {
return ret;
}
_pure_ static bool fd_in_set(int fd, const int fdset[], size_t n_fdset) {
static bool fd_in_set(int fd, const int fdset[], size_t n_fdset) {
assert(n_fdset == 0 || fdset);
for (size_t i = 0; i < n_fdset; i++) {
+1 -1
View File
@@ -213,7 +213,7 @@ static void remove_item(Prioq *q, struct prioq_item *i) {
}
}
_pure_ static struct prioq_item* find_item(Prioq *q, void *data, unsigned *idx) {
static struct prioq_item* find_item(Prioq *q, void *data, unsigned *idx) {
struct prioq_item *i;
assert(q);