Commit fa9d4d05 authored by Rafaël Carré's avatar Rafaël Carré

DBus: remove unused macro, check memory allocation

parent 678f97a6
......@@ -136,10 +136,20 @@ DBUS_METHOD( MprisVersion )
dbus_uint16_t i_minor = VLC_MPRIS_VERSION_MINOR;
DBusMessageIter version;
dbus_message_iter_open_container( &args, DBUS_TYPE_STRUCT, NULL, &version );
dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16, &i_major );
dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16, &i_minor );
dbus_message_iter_close_container( &args, &version );
if( !dbus_message_iter_open_container( &args, DBUS_TYPE_STRUCT, NULL,
&version ) )
return DBUS_HANDLER_RESULT_NEED_MEMORY;
if( !dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16,
&i_major ) )
return DBUS_HANDLER_RESULT_NEED_MEMORY;
if( !dbus_message_iter_append_basic( &version, DBUS_TYPE_UINT16,
&i_minor ) )
return DBUS_HANDLER_RESULT_NEED_MEMORY;
if( !dbus_message_iter_close_container( &args, &version ) )
return DBUS_HANDLER_RESULT_NEED_MEMORY;
REPLY_SEND;
}
......
......@@ -80,7 +80,6 @@
#define ADD_BOOL( b ) DBUS_ADD( DBUS_TYPE_BOOLEAN, b )
#define ADD_INT32( i ) DBUS_ADD( DBUS_TYPE_INT32, i )
#define ADD_BYTE( b ) DBUS_ADD( DBUS_TYPE_BYTE, b )
#define ADD_UINT16( i ) DBUS_ADD( DBUS_TYPE_UINT16, i )
/* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */
......
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