summaryrefslogtreecommitdiff
path: root/src/shared/socket-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:51:50 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:52:09 -0400
commit44a6b1b68029833893f6e9cee35aa27a974038f6 (patch)
tree170b79abd66a206598ac095156a6c4012d0583f4 /src/shared/socket-util.h
parent2f79c10e9aef916efbcf29315eea8c25d0a50ac4 (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/socket-util.h')
-rw-r--r--src/shared/socket-util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h
index 33838345ed..7829a337fc 100644
--- a/src/shared/socket-util.h
+++ b/src/shared/socket-util.h
@@ -67,9 +67,9 @@ typedef enum SocketAddressBindIPv6Only {
int socket_address_parse(SocketAddress *a, const char *s);
int socket_address_parse_netlink(SocketAddress *a, const char *s);
int socket_address_print(const SocketAddress *a, char **p);
-int socket_address_verify(const SocketAddress *a);
+int socket_address_verify(const SocketAddress *a) _pure_;
-bool socket_address_can_accept(const SocketAddress *a);
+bool socket_address_can_accept(const SocketAddress *a) _pure_;
int socket_address_listen(
const SocketAddress *a,
@@ -90,12 +90,12 @@ bool socket_address_matches_fd(const SocketAddress *a, int fd);
int make_socket_fd(const char* address, int flags);
-bool socket_address_equal(const SocketAddress *a, const SocketAddress *b);
+bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
bool socket_address_needs_mount(const SocketAddress *a, const char *prefix);
-const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b);
-SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s);
+const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_;
+SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_;
int netlink_family_to_string_alloc(int b, char **s);
int netlink_family_from_string(const char *s);