Commit e7268258 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Remove trailing whitespace, add checks for malloc return value.

parent 4a66eee1
......@@ -26,7 +26,6 @@
#include <vlc/libvlc.h>
#include <vlc_playlist.h>
/*
* Private functions
*/
......@@ -64,7 +63,8 @@ group_contains_listener( libvlc_event_listeners_group_t * group,
**************************************************************************/
void libvlc_event_init( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
{
(void)p_instance;(void)p_e;
VLC_UNUSED(p_instance);
VLC_UNUSED(p_e);
/* Will certainly be used to install libvlc_instance event */
}
......@@ -75,7 +75,7 @@ void libvlc_event_init( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
**************************************************************************/
void libvlc_event_fini( libvlc_instance_t *p_instance )
{
(void)p_instance;
VLC_UNUSED(p_instance);
}
/**************************************************************************
......@@ -286,6 +286,7 @@ static const char * event_type_to_name[] =
EVENT(libvlc_MediaDiscovererEnded)
#undef EVENT
};
static const char * unkwown_event_name = "Unknown Event";
const char * libvlc_event_type_name( libvlc_event_type_t event_type )
......
......@@ -240,6 +240,12 @@ libvlc_media_t * libvlc_media_new_from_input_item(
}
p_md = malloc( sizeof(libvlc_media_t) );
if( !p_md )
{
libvlc_exception_raise( p_e, "Not enough memory" );
return NULL;
}
p_md->p_libvlc_instance = p_instance;
p_md->p_input_item = p_input_item;
p_md->b_preparsed = false;
......@@ -339,7 +345,7 @@ void libvlc_media_add_option(
const char * ppsz_option,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
input_ItemAddOpt( p_md->p_input_item, ppsz_option,
VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
}
......@@ -404,7 +410,7 @@ char *
libvlc_media_get_mrl( libvlc_media_t * p_md,
libvlc_exception_t * p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
return input_item_GetURI( p_md->p_input_item );
}
......@@ -416,9 +422,8 @@ char * libvlc_media_get_meta( libvlc_media_t *p_md,
libvlc_meta_t e_meta,
libvlc_exception_t *p_e )
{
VLC_UNUSED(p_e);
char * psz_meta;
VLC_UNUSED(p_e);
/* XXX: locking */
......@@ -453,7 +458,7 @@ libvlc_state_t
libvlc_media_get_state( libvlc_media_t *p_md,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
return p_md->state;
}
......@@ -466,8 +471,8 @@ libvlc_media_set_state( libvlc_media_t *p_md,
libvlc_state_t state,
libvlc_exception_t *p_e )
{
(void)p_e;
libvlc_event_t event;
VLC_UNUSED(p_e);
p_md->state = state;
......@@ -581,4 +586,3 @@ libvlc_media_get_user_data( libvlc_media_t * p_md,
return NULL;
}
}
......@@ -113,7 +113,7 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
static void services_discovery_started( const vlc_event_t * p_event,
void * user_data )
{
(void)p_event;
VLC_UNUSED(p_event);
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_event_t event;
p_mdis->running = true;
......@@ -128,7 +128,7 @@ static void services_discovery_started( const vlc_event_t * p_event,
static void services_discovery_ended( const vlc_event_t * p_event,
void * user_data )
{
(void)p_event;
VLC_UNUSED(p_event);
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_event_t event;
p_mdis->running = false;
......@@ -270,4 +270,3 @@ libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
{
return p_mdis->running;
}
......@@ -59,6 +59,7 @@ static const libvlc_state_t vlc_to_libvlc_state_array[] =
[END_S] = libvlc_Ended,
[ERROR_S] = libvlc_Error,
};
static inline libvlc_state_t vlc_to_libvlc_state( int vlc_state )
{
if( vlc_state < 0 || vlc_state > 6 )
......@@ -290,6 +291,11 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
}
p_mi = malloc( sizeof(libvlc_media_player_t) );
if( !p_mi )
{
libvlc_exception_raise( p_e, "Not enough memory" );
return NULL;
}
p_mi->p_md = NULL;
p_mi->drawable = 0;
p_mi->p_libvlc_instance = p_libvlc_instance;
......@@ -477,7 +483,7 @@ void libvlc_media_player_set_media(
libvlc_media_t *p_md,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
if( !p_mi )
return;
......@@ -516,7 +522,7 @@ libvlc_media_player_get_media(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
if( !p_mi->p_md )
return NULL;
......@@ -533,7 +539,7 @@ libvlc_media_player_event_manager(
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
return p_mi->p_event_manager;
}
......@@ -665,7 +671,7 @@ void libvlc_media_player_set_drawable( libvlc_media_player_t *p_mi,
libvlc_drawable_t drawable,
libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
p_mi->drawable = drawable;
}
......@@ -675,7 +681,7 @@ void libvlc_media_player_set_drawable( libvlc_media_player_t *p_mi,
libvlc_drawable_t
libvlc_media_player_get_drawable ( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e )
{
(void)p_e;
VLC_UNUSED(p_e);
return p_mi->drawable;
}
......
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