[vlc-devel] commit: Cosmetics: Remove need to (char*)"..." by making the target const, and replace a call to var_Get(bool) with var_GetBool. (JP Dinger )

git version control git at videolan.org
Sat May 30 12:25:53 CEST 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Sat May 30 09:42:59 2009 +0200| [efe23f26e1cf8777e5c48569262a0ab1317c0db5] | committer: JP Dinger 

Cosmetics: Remove need to (char*)"..." by making the target const, and replace a call to var_Get(bool) with var_GetBool.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=efe23f26e1cf8777e5c48569262a0ab1317c0db5
---

 src/osd/osd.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/osd/osd.c b/src/osd/osd.c
index 9102c12..29e90cc 100644
--- a/src/osd/osd.c
+++ b/src/osd/osd.c
@@ -45,16 +45,12 @@
 static void osd_UpdateState( osd_menu_state_t *, int, int, int, int, picture_t * );
 static inline osd_state_t *osd_VolumeStateChange( osd_state_t *, int );
 static int osd_VolumeStep( vlc_object_t *, int, int );
-static bool osd_isVisible( osd_menu_t *p_osd );
 static bool osd_ParserLoad( osd_menu_t *, const char * );
 static void osd_ParserUnload( osd_menu_t * );
 
-static bool osd_isVisible( osd_menu_t *p_osd )
+static inline bool osd_isVisible( osd_menu_t *p_osd )
 {
-    vlc_value_t val;
-
-    var_Get( p_osd, "osd-menu-visible", &val );
-    return val.b_bool;
+    return var_GetBool( p_osd, "osd-menu-visible" );
 }
 
 static vlc_mutex_t *osd_GetMutex( vlc_object_t *p_this )
@@ -81,13 +77,13 @@ static bool osd_ParserLoad( osd_menu_t *p_menu, const char *psz_file )
     }
     else
     {
-        char *psz_type;
-        char *psz_ext = strrchr( p_menu->psz_file, '.' );
+        const char *psz_type;
+        const char *psz_ext = strrchr( p_menu->psz_file, '.' );
 
         if( psz_ext && !strcmp( psz_ext, ".cfg") )
-            psz_type = (char*)"import-osd";
+            psz_type = "import-osd";
         else
-            psz_type = (char*)"import-osd-xml";
+            psz_type = "import-osd-xml";
 
         p_menu->p_parser = module_need( p_menu, "osd parser",
                                         psz_type, true );




More information about the vlc-devel mailing list