]> git.sesse.net Git - vlc/commitdiff
misc: fix warnings
authorRafaël Carré <funman@videolan.org>
Tue, 29 Jan 2008 13:58:41 +0000 (13:58 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 29 Jan 2008 13:58:41 +0000 (13:58 +0000)
    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()

14 files changed:
modules/misc/dummy/encoder.c
modules/misc/dummy/input.c
modules/misc/dummy/renderer.c
modules/misc/dummy/vout.c
modules/misc/freetype.c
modules/misc/lua/httpd.c
modules/misc/lua/net.c
modules/misc/lua/playlist.c
modules/misc/notify/growl.c
modules/misc/notify/notify.c
modules/misc/notify/telepathy.c
modules/misc/osd/xml.c
modules/misc/xml/libxml.c
modules/misc/xml/xtag.c

index e10ce27732556615cbad3cf567466ea2948c089b..072aac6f6eee766eb8f521ab529401ed596801a7 100644 (file)
@@ -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);
 }
index beca7a4629a37bfa3ae2088d0013ced7feb5a21d..8bc6bb3f02368adb4be18750934ccc4ec7e9bcea 100644 (file)
@@ -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;
 }
index 92e2659a1c0dec026f8eaea7857485fdfef53957..904d2ca9c66bade7f7a0e8b33381a5baa138829b 100644 (file)
@@ -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;
 }
index bfa5094faa370ffcc2a0d1f0e3b2188e06551605..ce66e7662fef7aa681b756d2ca1627b629a9682e 100644 (file)
@@ -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 */
 }
index 843a5cca14b0a875b7ad203ca7ccd4ddad59bae7..ae15cf208eb3d65faf5fa8978fbe9b301ce39ecc 100644 (file)
 #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);
             }
         }
index 9cd00aaac4e209088da561320c9df514d8481b9c..656ba525d421af34f47a53a126febcdc6357f8ce 100644 (file)
@@ -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 */
index a4e525cfbfd31bb20be05d5635eedd2006a615b1..2a2fde4240e3328de235470a535895943c8477de 100644 (file)
@@ -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. */
index 0593e903e69c41662086cf5898bd44e3874a64e6..84ab8cbe220212d2a9ea7280f02b91aa13099976 100644 (file)
@@ -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;
 }
index 892aadbb6e38cc949191f3125b9e7a21372728ec..3709b0e5ce1bf97aa36d4c4badd7526b1cb430f8 100644 (file)
@@ -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;
index 68a5f7f64fd2df166ba612f9deaa7290ae48ffc6..793cab8d089a88f04c533ab87c9480c6c10a2e1c 100644 (file)
@@ -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 );
index 6b020ae72cc1cb987f72d9fccd68069a0dfd7e53..39455d36c0af255587c08fc430e501da92bb1576 100644 (file)
@@ -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;
index e70d6589c311a49c7048fa74f580dd7cb665c27b..412b1577884a48f858594e12f425346ca151e097 100644 (file)
@@ -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;
 }
 
index 5198667dac3d2a003a2837c9b3893eb9c31fce1d..c8ba82f8ba3e385f3ce3c5552ac95e1a390c1460 100644 (file)
@@ -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 );
index f99c535cf364f35c2406f6380a0f9c9be35ccfd7..33021b6c892c9b3cf2636de63e661ff5feb1e5bc 100644 (file)
@@ -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 )
 {