Code

mpdclient: move code to mpdclient_invoke_error_callback()
authorMax Kellermann <max.kellermann@gmail.com>
Fri, 17 Mar 2017 21:47:32 +0000 (22:47 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Fri, 17 Mar 2017 21:47:32 +0000 (22:47 +0100)
src/mpdclient.c

index 8177efa72309637299a3524851d85dd9e9741939..c8351d14cb1526365975875ae10d2520179feeb8 100644 (file)
 
 #include <mpd/client.h>
 
+#include <assert.h>
+
+static void
+mpdclient_invoke_error_callback(gcc_unused enum mpd_error error,
+                               const char *message)
+{
+       mpdclient_error_callback(message);
+}
+
 /****************************************************************************/
 /*** mpdclient functions ****************************************************/
 /****************************************************************************/
@@ -41,7 +50,8 @@ mpdclient_handle_error(struct mpdclient *c)
            mpdclient_auth_callback(c))
                return true;
 
-       mpdclient_error_callback(mpd_connection_get_error_message(c->connection));
+       mpdclient_invoke_error_callback(error,
+                                       mpd_connection_get_error_message(c->connection));
 
        if (!mpd_connection_clear_error(c->connection))
                mpdclient_disconnect(c);