diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-05-02 22:51:50 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-05-02 22:52:09 -0400 |
commit | 44a6b1b68029833893f6e9cee35aa27a974038f6 (patch) | |
tree | 170b79abd66a206598ac095156a6c4012d0583f4 /src/shared/util.c | |
parent | 2f79c10e9aef916efbcf29315eea8c25d0a50ac4 (diff) |
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls.
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index f9ec14aff4..5d01802ed9 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1449,7 +1449,7 @@ char *ascii_strlower(char *t) { return t; } -static bool ignore_file_allow_backup(const char *filename) { +_pure_ static bool ignore_file_allow_backup(const char *filename) { assert(filename); return @@ -1512,7 +1512,7 @@ int fd_cloexec(int fd, bool cloexec) { return 0; } -static bool fd_in_set(int fd, const int fdset[], unsigned n_fdset) { +_pure_ static bool fd_in_set(int fd, const int fdset[], unsigned n_fdset) { unsigned i; assert(n_fdset == 0 || fdset); @@ -2770,7 +2770,7 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct return ret; } -static int is_temporary_fs(struct statfs *s) { +_pure_ static int is_temporary_fs(struct statfs *s) { assert(s); return F_TYPE_CMP(s->f_type, TMPFS_MAGIC) || |