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/core/socket.h | |
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/core/socket.h')
-rw-r--r-- | src/core/socket.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index dbc363217b..4826bb331b 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -167,13 +167,13 @@ void socket_free_ports(Socket *s); extern const UnitVTable socket_vtable; -const char* socket_state_to_string(SocketState i); -SocketState socket_state_from_string(const char *s); +const char* socket_state_to_string(SocketState i) _const_; +SocketState socket_state_from_string(const char *s) _pure_; -const char* socket_exec_command_to_string(SocketExecCommand i); -SocketExecCommand socket_exec_command_from_string(const char *s); +const char* socket_exec_command_to_string(SocketExecCommand i) _const_; +SocketExecCommand socket_exec_command_from_string(const char *s) _pure_; -const char* socket_result_to_string(SocketResult i); -SocketResult socket_result_from_string(const char *s); +const char* socket_result_to_string(SocketResult i) _const_; +SocketResult socket_result_from_string(const char *s) _pure_; -const char* socket_port_type_to_string(SocketPort *p); +const char* socket_port_type_to_string(SocketPort *p) _pure_; |