* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <stdarg.h> /* va_list for BSD */
#include <errno.h> /* errno */
+#ifdef WIN32
+# include <vlc_network.h> /* 'net_strerror' and 'WSAGetLastError' */
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* close(), write() */
#endif
void __msg_Create( vlc_object_t *p_this )
{
int i;
- vlc_mutex_init( p_this, &(p_this->p_libvlc->msg_bank.lock) );
+ vlc_mutex_init( (vlc_object_t *)NULL,
+ &(p_this->p_libvlc->msg_bank.lock) );
for( i = 0; i < 2; i++ )
{
- vlc_mutex_init( p_this, &QUEUE(i).lock );
+ vlc_mutex_init( (vlc_object_t *)NULL, &QUEUE(i).lock );
QUEUE(i).b_overflow = VLC_FALSE;
QUEUE(i).i_id = i;
QUEUE(i).i_start = 0;
if( QUEUE(i).pp_sub[j] == p_sub )
{
REMOVE_ELEM( QUEUE(i).pp_sub, QUEUE(i).i_sub, j );
- if( p_sub ) free( p_sub );
+ free( p_sub );
}
}
vlc_mutex_unlock( & QUEUE(i).lock );
if( p_this == NULL )
{
+#ifndef NDEBUG
+ if( i_type == VLC_MSG_DBG )
+ return;
+#endif
utf8_vfprintf( stderr, psz_format, _args );
+ fputc ('\n', stderr);
return;
}
/* Expand %m to strerror(errno) - only once */
char buf[strlen( psz_format ) + 2001], *ptr;
strcpy( buf, psz_format );
- ptr = psz_format = buf;
+ ptr = (char*)buf;
+ psz_format = (const char*) buf;
for( ;; )
{
p_obj->psz_header );
}
}
- if( psz_old ) free( psz_old );
+ free( psz_old );
p_obj = p_obj->p_parent;
}
if( p_queue->b_overflow )
{
- if( p_item->psz_module )
- free( p_item->psz_module );
- if( p_item->psz_msg )
- free( p_item->psz_msg );
- if( p_item->psz_header )
- free( p_item->psz_header );
+ free( p_item->psz_module );
+ free( p_item->psz_msg );
+ free( p_item->psz_header );
}
vlc_mutex_unlock ( &p_queue->lock );
i_index != i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE )
{
- if( p_queue->msg[i_index].psz_msg )
- free( p_queue->msg[i_index].psz_msg );
- if( p_queue->msg[i_index].psz_module )
- free( p_queue->msg[i_index].psz_module );
- if( p_queue->msg[i_index].psz_header )
- free( p_queue->msg[i_index].psz_header );
+ free( p_queue->msg[i_index].psz_msg );
+ free( p_queue->msg[i_index].psz_module );
+ free( p_queue->msg[i_index].psz_header );
}
/* Update the new start value */