]> git.sesse.net Git - vlc/commitdiff
Code factor
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 19 Aug 2007 16:50:42 +0000 (16:50 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 19 Aug 2007 16:50:42 +0000 (16:50 +0000)
src/misc/messages.c

index 6eeed09c8b81e5d166c9deb244f48f0cd9ef0e09..609e0b51945d8fe36731057d6db22d006f24b1f6 100644 (file)
@@ -78,21 +78,19 @@ static void PrintMsg ( vlc_object_t *, msg_item_t * );
  */
 void __msg_Create( vlc_object_t *p_this )
 {
+    int i;
     vlc_mutex_init( p_this, &(p_this->p_libvlc->msg_bank.lock) );
 
-#define QUEUE_INIT(i) \
-    vlc_mutex_init( p_this, &QUEUE(i).lock ); \
-    QUEUE(i).b_overflow = VLC_FALSE; \
-    QUEUE(i).i_id = i; \
-    QUEUE(i).i_start = 0; \
-    QUEUE(i).i_stop = 0; \
-    QUEUE(i).i_sub = 0; \
-    QUEUE(i).pp_sub = 0;
-
-    QUEUE_INIT( 0 );
-    QUEUE_INIT( 1 );
-
-#undef QUEUE_INIT
+    for( i = 0; i < 2; i++ )
+    {
+         vlc_mutex_init( p_this, &QUEUE(i).lock );
+         QUEUE(i).b_overflow = VLC_FALSE;
+         QUEUE(i).i_id = i;
+         QUEUE(i).i_start = 0;
+         QUEUE(i).i_stop = 0;
+         QUEUE(i).i_sub = 0;
+         QUEUE(i).pp_sub = 0;
+    }
 
 #ifdef UNDER_CE
     QUEUE(MSG_QUEUE_NORMAL).logfile =
@@ -312,7 +310,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue, int i_type,
     vasprintf( &psz_str, psz_format, args );
     va_end( args );
 #else
-    psz_str = (char*) malloc( i_size * sizeof(char) );
+    psz_str = (char*) malloc( i_size );
 #endif
 
     if( psz_str == NULL )