basic,shared: mark eligible functions with _pure_/_const_

Following the recent witch hunt done to static inline functions
I figure we should at least give the compiler some more hint
on optimizations.
This commit is contained in:
Mike Yuan
2025-05-26 20:26:58 +02:00
parent fae687ec2b
commit 180341e732
19 changed files with 88 additions and 90 deletions
+2 -3
View File
@@ -18,7 +18,7 @@
#define MAP_UID_MIN ((uid_t) 60514)
#define MAP_UID_MAX ((uid_t) 60577)
bool uid_is_valid(uid_t uid);
bool uid_is_valid(uid_t uid) _const_;
static inline bool gid_is_valid(gid_t gid) {
return uid_is_valid((uid_t) gid);
@@ -37,8 +37,7 @@ char* getusername_malloc(void);
const char* default_root_shell_at(int rfd);
const char* default_root_shell(const char *root);
bool is_nologin_shell(const char *shell);
bool is_nologin_shell(const char *shell) _pure_;
bool shell_is_placeholder(const char *shell) _pure_;
typedef enum UserCredsFlags {