[vlc-commits] commit: Remove unused msg_Stack stuff ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Sat Nov 27 15:14:52 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 27 16:14:41 2010 +0200| [7e1b4d5377e3c7616cb834700c1f74e68ea4b1fc] | committer: Rémi Denis-Courmont 

Remove unused msg_Stack stuff

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

 src/input/input.c   |    3 +-
 src/libvlc.h        |    5 ---
 src/misc/messages.c |   93 ---------------------------------------------------
 3 files changed, 1 insertions(+), 100 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 8a0e070..801d212 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2435,8 +2435,7 @@ static int InputSourceInit( input_thread_t *p_input,
         {
             if( vlc_object_alive( p_input ) )
             {
-                msg_Err( p_input, "open of `%s' failed: %s", psz_mrl,
-                                                             msg_StackMsg() );
+                msg_Err( p_input, "open of `%s' failed", psz_mrl );
                 dialog_Fatal( p_input, _("Your input can't be opened"),
                               _("VLC is unable to open the MRL '%s'."
                                 " Check the log for details."), psz_mrl );
diff --git a/src/libvlc.h b/src/libvlc.h
index ff52467..dc31535 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -85,11 +85,6 @@ typedef struct msg_bank_t msg_bank_t;
 msg_bank_t *msg_Create (void);
 void msg_Destroy (msg_bank_t *);
 
-/** Internal message stack context */
-void msg_StackSet ( int, const char*, ... );
-void msg_StackAdd ( const char*, ... );
-const char* msg_StackMsg ( void );
-
 /*
  * LibVLC exit event handling
  */
diff --git a/src/misc/messages.c b/src/misc/messages.c
index 063ae60..940462c 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -55,22 +55,6 @@
 #include <vlc_charset.h>
 #include "../libvlc.h"
 
-typedef struct
-{
-    int i_code;
-    char * psz_message;
-} msg_context_t;
-
-static void cleanup_msg_context (void *data)
-{
-    msg_context_t *ctx = data;
-    free (ctx->psz_message);
-    free (ctx);
-}
-
-static vlc_threadvar_t msg_context;
-static uintptr_t banks = 0;
-
 /*****************************************************************************
  * Local macros
  *****************************************************************************/
@@ -128,11 +112,6 @@ msg_bank_t *msg_Create (void)
 
     /* C locale to get error messages in English in the logs */
     bank->locale = newlocale (LC_MESSAGES_MASK, "C", (locale_t)0);
-
-    vlc_mutex_lock( &msg_stack_lock );
-    if( banks++ == 0 )
-        vlc_threadvar_create( &msg_context, cleanup_msg_context );
-    vlc_mutex_unlock( &msg_stack_lock );
     return bank;
 }
 
@@ -183,12 +162,6 @@ void msg_Destroy (msg_bank_t *bank)
     if (unlikely(bank->i_sub != 0))
         fputs ("stale interface subscribers (LibVLC might crash)\n", stderr);
 
-    vlc_mutex_lock( &msg_stack_lock );
-    assert(banks > 0);
-    if( --banks == 0 )
-        vlc_threadvar_delete( &msg_context );
-    vlc_mutex_unlock( &msg_stack_lock );
-
     if (bank->locale != (locale_t)0)
        freelocale (bank->locale);
 
@@ -565,69 +538,3 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
 #endif
     vlc_restorecancel (canc);
 }
-
-static msg_context_t* GetContext(void)
-{
-    msg_context_t *p_ctx = vlc_threadvar_get( msg_context );
-    if( p_ctx == NULL )
-    {
-        p_ctx = malloc( sizeof( msg_context_t ) );
-        if( !p_ctx )
-            return NULL;
-        p_ctx->psz_message = NULL;
-        vlc_threadvar_set( msg_context, p_ctx );
-    }
-    return p_ctx;
-}
-
-void msg_StackSet( int i_code, const char *psz_message, ... )
-{
-    va_list ap;
-    msg_context_t *p_ctx = GetContext();
-
-    if( p_ctx == NULL )
-        return;
-    free( p_ctx->psz_message );
-
-    va_start( ap, psz_message );
-    if( vasprintf( &p_ctx->psz_message, psz_message, ap ) == -1 )
-        p_ctx->psz_message = NULL;
-    va_end( ap );
-
-    p_ctx->i_code = i_code;
-}
-
-void msg_StackAdd( const char *psz_message, ... )
-{
-    char *psz_tmp;
-    va_list ap;
-    msg_context_t *p_ctx = GetContext();
-
-    if( p_ctx == NULL )
-        return;
-
-    va_start( ap, psz_message );
-    if( vasprintf( &psz_tmp, psz_message, ap ) == -1 )
-        psz_tmp = NULL;
-    va_end( ap );
-
-    if( !p_ctx->psz_message )
-        p_ctx->psz_message = psz_tmp;
-    else
-    {
-        char *psz_new;
-        if( asprintf( &psz_new, "%s: %s", psz_tmp, p_ctx->psz_message ) == -1 )
-            psz_new = NULL;
-
-        free( p_ctx->psz_message );
-        p_ctx->psz_message = psz_new;
-        free( psz_tmp );
-    }
-}
-
-const char* msg_StackMsg( void )
-{
-    msg_context_t *p_ctx = GetContext();
-    assert( p_ctx );
-    return p_ctx->psz_message;
-}



More information about the vlc-commits mailing list