Commit ce572d7e authored by Christophe Mutricy's avatar Christophe Mutricy

Remove always true tests

parent 2e71482d
...@@ -654,8 +654,7 @@ char *str_format_time( const char *tformat ) ...@@ -654,8 +654,7 @@ char *str_format_time( const char *tformat )
} }
/* same than INSERT_STRING, except that string won't be freed */ /* same than INSERT_STRING, except that string won't be freed */
#define INSERT_STRING_NO_FREE( check, string ) \ #define INSERT_STRING_NO_FREE( string ) \
if( check && string ) \
{ \ { \
int len = strlen( string ); \ int len = strlen( string ); \
dst = realloc( dst, \ dst = realloc( dst, \
...@@ -663,11 +662,6 @@ char *str_format_time( const char *tformat ) ...@@ -663,11 +662,6 @@ char *str_format_time( const char *tformat )
strncpy( d, string, len+1 ); \ strncpy( d, string, len+1 ); \
d += len; \ d += len; \
free( string ); \ free( string ); \
} \
else \
{ \
*d = '-'; \
d++; \
} }
char *__str_format_meta( vlc_object_t *p_object, const char *string ) char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
...@@ -761,7 +755,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -761,7 +755,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "-" ); sprintf( buf, b_empty_if_na ? "" : "-" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'C': case 'C':
if( p_input ) if( p_input )
...@@ -773,7 +767,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -773,7 +767,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "-" ); sprintf( buf, b_empty_if_na ? "" : "-" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'D': case 'D':
if( p_item ) if( p_item )
...@@ -788,7 +782,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -788,7 +782,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "--:--:--" ); sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'F': case 'F':
INSERT_STRING( p_item, input_item_GetURI( p_item ) ); INSERT_STRING( p_item, input_item_GetURI( p_item ) );
...@@ -803,7 +797,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -803,7 +797,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "-" ); sprintf( buf, b_empty_if_na ? "" : "-" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'L': case 'L':
if( p_item && p_input ) if( p_item && p_input )
...@@ -819,7 +813,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -819,7 +813,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "--:--:--" ); sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'N': case 'N':
INSERT_STRING( p_item, input_item_GetName( p_item ) ); INSERT_STRING( p_item, input_item_GetName( p_item ) );
...@@ -848,7 +842,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -848,7 +842,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "--.-%%" ); sprintf( buf, b_empty_if_na ? "" : "--.-%%" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'R': case 'R':
if( p_input ) if( p_input )
...@@ -860,7 +854,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -860,7 +854,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "-" ); sprintf( buf, b_empty_if_na ? "" : "-" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'S': case 'S':
if( p_input ) if( p_input )
...@@ -872,7 +866,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -872,7 +866,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "-" ); sprintf( buf, b_empty_if_na ? "" : "-" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'T': case 'T':
if( p_input ) if( p_input )
...@@ -886,7 +880,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -886,7 +880,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
{ {
sprintf( buf, b_empty_if_na ? "" : "--:--:--" ); sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
} }
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
case 'U': case 'U':
INSERT_STRING( p_item, input_item_GetPublisher(p_item) ); INSERT_STRING( p_item, input_item_GetPublisher(p_item) );
...@@ -896,7 +890,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string ) ...@@ -896,7 +890,7 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
audio_volume_t volume; audio_volume_t volume;
aout_VolumeGet( p_object, &volume ); aout_VolumeGet( p_object, &volume );
snprintf( buf, 10, "%d", volume ); snprintf( buf, 10, "%d", volume );
INSERT_STRING_NO_FREE( 1, buf ); INSERT_STRING_NO_FREE( buf );
break; break;
} }
case '_': case '_':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment