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
+6 -6
View File
@@ -158,14 +158,14 @@ int file_in_same_dir(const char *path, const char *filename, char **ret);
bool hidden_or_backup_file(const char *filename) _pure_;
bool is_device_path(const char *path);
bool is_device_path(const char *path) _pure_;
bool valid_device_node_path(const char *path);
bool valid_device_allow_pattern(const char *path);
bool valid_device_node_path(const char *path) _pure_;
bool valid_device_allow_pattern(const char *path) _pure_;
bool dot_or_dot_dot(const char *path);
bool dot_or_dot_dot(const char *path) _pure_;
bool path_implies_directory(const char *path);
bool path_implies_directory(const char *path) _pure_;
static inline const char* skip_dev_prefix(const char *p) {
const char *e;
@@ -177,7 +177,7 @@ static inline const char* skip_dev_prefix(const char *p) {
return e ?: p;
}
bool empty_or_root(const char *path);
bool empty_or_root(const char *path) _pure_;
const char* empty_to_root(const char *path) _pure_;
bool path_strv_contains(char * const *l, const char *path);