Commit 94a67470 authored by Rafaël Carré's avatar Rafaël Carré

misc: fix warnings

    declare unused parameters in callbacks as void
    use size_t
    xml/xtag.c: comment dead code
    freetype: use mdate() instead of time(), remove unused parameter from UnderlineGlyphYUVA()
    notify/growl: factorize NotifyGrowl()
parent 25ad0cde
......@@ -56,6 +56,7 @@ int E_(OpenEncoder) ( vlc_object_t *p_this )
****************************************************************************/
static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
{
VLC_UNUSED(p_enc); VLC_UNUSED(p_pict);
return NULL;
}
......@@ -64,6 +65,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
****************************************************************************/
static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_buf )
{
VLC_UNUSED(p_enc); VLC_UNUSED(p_buf);
return NULL;
}
......@@ -72,4 +74,5 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_buf )
*****************************************************************************/
void E_(CloseEncoder) ( vlc_object_t *p_this )
{
VLC_UNUSED(p_this);
}
......@@ -42,6 +42,7 @@
*****************************************************************************/
static int AccessRead( access_t *p_access, uint8_t *p, int i_size )
{
VLC_UNUSED(p_access);
memset( p, 0, i_size );
return i_size;
}
......
......@@ -46,5 +46,6 @@ int E_(OpenRenderer)( vlc_object_t *p_this )
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in )
{
VLC_UNUSED(p_filter); VLC_UNUSED(p_region_out); VLC_UNUSED(p_region_in);
return VLC_EGENERIC;
}
......@@ -196,6 +196,7 @@ static void End( vout_thread_t *p_vout )
*****************************************************************************/
static int Manage( vout_thread_t *p_vout )
{
VLC_UNUSED(p_vout);
return( 0 );
}
......@@ -204,6 +205,7 @@ static int Manage( vout_thread_t *p_vout )
*****************************************************************************/
static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
VLC_UNUSED(p_vout); VLC_UNUSED(p_pic);
/* No need to do anything, the fake direct buffers stay as they are */
}
......@@ -212,6 +214,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
*****************************************************************************/
static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
VLC_UNUSED(p_vout); VLC_UNUSED(p_pic);
/* No need to do anything, the fake direct buffers stay as they are */
}
......@@ -221,5 +224,6 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
static void SetPalette ( vout_thread_t *p_vout,
uint16_t *red, uint16_t *green, uint16_t *blue )
{
VLC_UNUSED(p_vout); VLC_UNUSED(red); VLC_UNUSED(green); VLC_UNUSED(blue);
/* No need to do anything, the fake direct buffers stay as they are */
}
......@@ -39,12 +39,12 @@
#include <vlc_stream.h>
#include <vlc_xml.h>
#include <vlc_input.h>
#include <vlc_mtime.h>
#ifdef HAVE_LINUX_LIMITS_H
# include <linux/limits.h>
#endif
#include <time.h>
#include <math.h>
#include <errno.h>
......@@ -504,10 +504,10 @@ static void FontBuilder( vlc_object_t *p_this )
if( p_fontconfig )
{
time_t t1, t2;
mtime_t t1, t2;
msg_Dbg( p_this, "Building font database..." );
time( &t1 );
t1 = mdate();
if(! FcConfigBuildFonts( p_fontconfig ))
{
/* Don't destroy the fontconfig object - we won't be able to do
......@@ -517,11 +517,10 @@ static void FontBuilder( vlc_object_t *p_this )
msg_Err( p_this, "fontconfig database can't be built. "
"Font styling won't be available" );
}
time( &t2 );
t2 = mdate();
msg_Dbg( p_this, "Finished building font database." );
if( t1 > 0 && t2 > 0 )
msg_Dbg( p_this, "Took %ld seconds", t2 - t1 );
msg_Dbg( p_this, "Took %ld seconds", (long)((t2 - t1)/1000000) );
lock = var_AcquireMutex( "fontbuilder" );
var_SetBool( p_this, "build-done", VLC_TRUE );
......@@ -742,7 +741,7 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, vlc_boo
FT_BitmapGlyph p_this_glyph, FT_Vector *p_this_glyph_pos,
FT_BitmapGlyph p_next_glyph, FT_Vector *p_next_glyph_pos,
int i_glyph_tmax, int i_align_offset,
uint8_t i_y, uint8_t i_u, uint8_t i_v, uint8_t i_alpha,
uint8_t i_y, uint8_t i_u, uint8_t i_v,
subpicture_region_t *p_region)
{
int y, x, z;
......@@ -1044,7 +1043,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
p_line->pp_glyphs[i], &(p_line->p_glyph_pos[i]),
p_line->pp_glyphs[i+1], &(p_line->p_glyph_pos[i+1]),
i_glyph_tmax, i_align_offset,
i_y, i_u, i_v, i_alpha,
i_y, i_u, i_v,
p_region);
}
}
......
......@@ -111,6 +111,7 @@ static int vlclua_httpd_handler_callback(
char *psz_remote_addr, char *psz_remote_host,
uint8_t **pp_data, int *pi_data )
{
VLC_UNUSED(p_handler);
lua_State *L = p_sys->L;
/* function data */
......@@ -198,6 +199,7 @@ static int vlclua_httpd_file_callback(
httpd_file_sys_t *p_sys, httpd_file_t *p_file, uint8_t *psz_request,
uint8_t **pp_data, int *pi_data )
{
VLC_UNUSED(p_file);
lua_State *L = p_sys->L;
/* function data */
......
......@@ -134,7 +134,7 @@ int vlclua_net_recv( lua_State *L )
int vlclua_net_select( lua_State *L )
{
int i_ret;
int i_nfds = luaL_checkint( L, 1 );
size_t i_nfds = luaL_checkint( L, 1 );
fd_set *fds_read = (fd_set*)luaL_checkuserdata( L, 2, sizeof( fd_set ) );
fd_set *fds_write = (fd_set*)luaL_checkuserdata( L, 3, sizeof( fd_set ) );
double f_timeout = luaL_checknumber( L, 4 );
......@@ -176,7 +176,7 @@ int vlclua_fd_isset( lua_State *L )
int vlclua_fd_set( lua_State *L )
{
fd_set *fds = (fd_set*)luaL_checkuserdata( L, 1, sizeof( fd_set ) );
int i_fd = luaL_checkint( L, 2 );
size_t i_fd = luaL_checkint( L, 2 );
/* FIXME: we should really use poll() instead here, but that breaks the
* VLC/LUA API. On Windows, overflow protection is built-in FD_SET, not
* on POSIX. In both cases, run-time behavior will however be wrong. */
......
......@@ -126,6 +126,7 @@ static luaL_Reg p_reg_parse[] =
static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
lua_State * L, void * user_data )
{
VLC_UNUSED(user_data);
demux_t * p_demux = (demux_t *)p_this;
p_demux->p_sys->psz_filename = strdup(psz_filename);
......@@ -284,5 +285,6 @@ static int Demux( demux_t *p_demux )
static int Control( demux_t *p_demux, int i_query, va_list args )
{
VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args);
return VLC_EGENERIC;
}
......@@ -47,8 +47,7 @@ static int ItemChange( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
static int RegisterToGrowl( vlc_object_t *p_this );
static int NotifyToGrowl( vlc_object_t *p_this, char *psz_type,
char *psz_title, char *psz_desc );
static int NotifyToGrowl( vlc_object_t *p_this, const char *psz_desc );
static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset );
#define GROWL_MAX_LENGTH 256
......@@ -114,6 +113,8 @@ static void Close( vlc_object_t *p_this )
static int ItemChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
VLC_UNUSED(psz_var); VLC_UNUSED(oldval); VLC_UNUSED(newval);
VLC_UNUSED(param);
char psz_tmp[GROWL_MAX_LENGTH];
char *psz_title = NULL;
char *psz_artist = NULL;
......@@ -151,7 +152,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
free( psz_artist );
free( psz_album );
NotifyToGrowl( p_this, "Now Playing", "Now Playing", psz_tmp );
NotifyToGrowl( p_this, psz_tmp );
vlc_object_release( p_input );
return VLC_SUCCESS;
......@@ -178,7 +179,7 @@ static int RegisterToGrowl( vlc_object_t *p_this )
{
uint8_t *psz_encoded = malloc(100);
uint8_t i_defaults = 0;
char *psz_notifications[] = {"Now Playing", NULL};
static const char *psz_notifications[] = {"Now Playing", NULL};
vlc_bool_t pb_defaults[] = {VLC_TRUE, VLC_FALSE};
int i = 0, j;
if( psz_encoded == NULL )
......@@ -211,9 +212,9 @@ static int RegisterToGrowl( vlc_object_t *p_this )
return VLC_SUCCESS;
}
static int NotifyToGrowl( vlc_object_t *p_this, char *psz_type,
char *psz_title, char *psz_desc )
static int NotifyToGrowl( vlc_object_t *p_this, const char *psz_desc )
{
const char *psz_type = "Now Playing", *psz_title = "Now Playing";
uint8_t *psz_encoded = malloc(GROWL_MAX_LENGTH + 42);
uint16_t flags;
int i = 0;
......
......@@ -136,6 +136,7 @@ static void Close( vlc_object_t *p_this )
static int ItemChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
VLC_UNUSED(psz_var); VLC_UNUSED(oldval); VLC_UNUSED(newval);
char psz_tmp[MAX_LENGTH];
char psz_notify[MAX_LENGTH];
char *psz_title = NULL;
......@@ -251,6 +252,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
static void Next( NotifyNotification *notification, gchar *psz, gpointer p )
{ /* libnotify callback, called when the "Next" button is pressed */
VLC_UNUSED(psz);
notify_notification_close (notification, NULL);
playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p) );
playlist_Next( p_playlist );
......@@ -259,6 +261,7 @@ static void Next( NotifyNotification *notification, gchar *psz, gpointer p )
static void Prev( NotifyNotification *notification, gchar *psz, gpointer p )
{ /* libnotify callback, called when the "Previous" button is pressed */
VLC_UNUSED(psz);
notify_notification_close (notification, NULL);
playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p) );
playlist_Prev( p_playlist );
......
......@@ -166,6 +166,7 @@ static void Close( vlc_object_t *p_this )
static int ItemChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
VLC_UNUSED(oldval);
intf_thread_t *p_intf = (intf_thread_t *)param;
char *psz_buf = NULL;
input_thread_t *p_input;
......@@ -237,6 +238,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
static int StateChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(oldval);
intf_thread_t *p_intf = (intf_thread_t *)param;
if( p_intf->b_dead )
return VLC_EGENERIC;
......
......@@ -48,7 +48,7 @@ int osd_parser_xmlOpen ( vlc_object_t *p_this );
int osd_parser_xmlOpen( vlc_object_t *p_this )
{
VLC_UNUSED(p_this);
return VLC_SUCCESS;
}
......@@ -87,6 +87,7 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
VLC_UNUSED(p_this);
return;
}
......@@ -95,6 +96,7 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/
static void CatalogLoad( xml_t *p_xml, const char *psz_filename )
{
VLC_UNUSED(p_xml);
if( !psz_filename ) xmlInitializeCatalog();
else xmlLoadCatalog( psz_filename );
}
......@@ -102,6 +104,7 @@ static void CatalogLoad( xml_t *p_xml, const char *psz_filename )
static void CatalogAdd( xml_t *p_xml, const char *psz_arg1,
const char *psz_arg2, const char *psz_filename )
{
VLC_UNUSED(p_xml);
xmlCatalogAdd( (unsigned char*)psz_arg1, (unsigned char*)psz_arg2,
(unsigned char*)psz_filename );
}
......@@ -113,6 +116,7 @@ static void ReaderErrorHandler( void *p_arg, const char *p_msg,
xmlParserSeverities severity,
xmlTextReaderLocatorPtr locator)
{
VLC_UNUSED(severity);
xml_reader_t *p_reader = (xml_reader_t *)p_arg;
int line = xmlTextReaderLocatorLineNumber( locator );
msg_Err( p_reader->p_xml, "XML parser error (line %d) : %s", line, p_msg );
......
......@@ -113,8 +113,10 @@ static void CatalogAdd( xml_t *, const char *, const char *, const char * );
static XTag *xtag_new_parse( const char *, int );
static char *xtag_get_name( XTag * );
#if 0
static char *xtag_get_pcdata( XTag * );
static char *xtag_get_attribute( XTag *, char * );
#endif
static XTag *xtag_first_child( XTag *, char * );
static XTag *xtag_next_child( XTag *, char * );
static XTag *xtag_free( XTag * );
......@@ -141,6 +143,7 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
VLC_UNUSED(p_this);
return;
}
......@@ -149,12 +152,15 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/
static void CatalogLoad( xml_t *p_xml, const char *psz_filename )
{
VLC_UNUSED(psz_filename);
msg_Dbg( p_xml, "catalog support not implemented" );
}
static void CatalogAdd( xml_t *p_xml, const char *psz_arg1,
const char *psz_arg2, const char *psz_filename )
{
VLC_UNUSED(p_xml); VLC_UNUSED(psz_arg1); VLC_UNUSED(psz_arg2);
VLC_UNUSED(psz_filename);
}
/*****************************************************************************
......@@ -231,6 +237,7 @@ static void ReaderDelete( xml_reader_t *p_reader )
static int ReaderUseDTD ( xml_reader_t *p_reader, vlc_bool_t b_use )
{
VLC_UNUSED(p_reader); VLC_UNUSED(b_use);
return VLC_EGENERIC;
}
......@@ -836,6 +843,7 @@ static char *xtag_get_name( XTag *xtag )
return xtag ? xtag->name : NULL;
}
#if 0
static char *xtag_get_pcdata( XTag *xtag )
{
XList *l;
......@@ -872,6 +880,7 @@ static char *xtag_get_attribute( XTag *xtag, char *attribute )
return NULL;
}
#endif
static XTag *xtag_first_child( XTag *xtag, char *name )
{
......
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