Commit 9dfbe7f7 authored by Simon McVittie's avatar Simon McVittie Committed by Ralf Habacker

DBusSocket helpers: Declare as _DBUS_GNUC_WARN_UNUSED_RESULT

There is no point in calling these functions for their side-effects,
because they don't have any.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker's avatarRalf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
parent 39efd6eb
......@@ -132,15 +132,18 @@ typedef struct { SOCKET sock; } DBusSocket;
# define DBUS_SOCKET_FORMAT "Iu"
# define DBUS_SOCKET_INIT { INVALID_SOCKET }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline SOCKET
_dbus_socket_printable (DBusSocket s) { return s.sock; }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline dbus_bool_t
_dbus_socket_is_valid (DBusSocket s) { return s.sock != INVALID_SOCKET; }
static inline void
_dbus_socket_invalidate (DBusSocket *s) { s->sock = INVALID_SOCKET; }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline int
_dbus_socket_get_int (DBusSocket s) { return (int)s.sock; }
......@@ -150,20 +153,24 @@ typedef struct { int fd; } DBusSocket;
# define DBUS_SOCKET_FORMAT "d"
# define DBUS_SOCKET_INIT { -1 }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline int
_dbus_socket_printable (DBusSocket s) { return s.fd; }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline dbus_bool_t
_dbus_socket_is_valid (DBusSocket s) { return s.fd >= 0; }
static inline void
_dbus_socket_invalidate (DBusSocket *s) { s->fd = -1; }
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline int
_dbus_socket_get_int (DBusSocket s) { return s.fd; }
#endif /* not DBUS_WIN */
_DBUS_GNUC_WARN_UNUSED_RESULT
static inline DBusSocket
_dbus_socket_get_invalid (void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment