Commit 8eb251e5 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix compilation warning (const variables)

parent 2e554fa9
...@@ -267,8 +267,8 @@ static void ParseText( decoder_t *p_dec, block_t *p_block ) ...@@ -267,8 +267,8 @@ static void ParseText( decoder_t *p_dec, block_t *p_block )
val.p_address = psz_tmp; val.p_address = psz_tmp;
if( var_Set( p_dec, "psz-current-anchor-url", val ) != VLC_SUCCESS ) if( var_Set( p_dec, "psz-current-anchor-url", val ) != VLC_SUCCESS )
{ {
(void) var_Create( p_dec, "psz-current-anchor-url", var_Create( p_dec, "psz-current-anchor-url",
VLC_VAR_ADDRESS|VLC_VAR_DOINHERIT ); VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT );
msg_Dbg( p_dec, "creating psz-current-anchor-url" ); msg_Dbg( p_dec, "creating psz-current-anchor-url" );
if( var_Set( p_dec, "psz-current-anchor-url", val ) != VLC_SUCCESS ) if( var_Set( p_dec, "psz-current-anchor-url", val ) != VLC_SUCCESS )
msg_Dbg( p_dec, "var_Set of psz-current-anchor-url failed" ); msg_Dbg( p_dec, "var_Set of psz-current-anchor-url failed" );
...@@ -282,8 +282,8 @@ static void ParseText( decoder_t *p_dec, block_t *p_block ) ...@@ -282,8 +282,8 @@ static void ParseText( decoder_t *p_dec, block_t *p_block )
val.p_address = psz_tmp; val.p_address = psz_tmp;
if( var_Set( p_dec, "psz-current-anchor-description", val ) != VLC_SUCCESS ) if( var_Set( p_dec, "psz-current-anchor-description", val ) != VLC_SUCCESS )
{ {
(void) var_Create( p_dec, "psz-current-anchor-description", var_Create( p_dec, "psz-current-anchor-description",
VLC_VAR_ADDRESS|VLC_VAR_DOINHERIT ); VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT );
msg_Dbg( p_dec, "creating psz-current-anchor-description" ); msg_Dbg( p_dec, "creating psz-current-anchor-description" );
if( var_Set( p_dec, "psz-current-anchor-description", val ) != VLC_SUCCESS ) if( var_Set( p_dec, "psz-current-anchor-description", val ) != VLC_SUCCESS )
msg_Dbg( p_dec, "var_Set of psz-current-anchor-description failed" ); msg_Dbg( p_dec, "var_Set of psz-current-anchor-description failed" );
......
...@@ -83,8 +83,8 @@ void xtag_free (XTag * xtag); ...@@ -83,8 +83,8 @@ void xtag_free (XTag * xtag);
XTag * xtag_new_parse (const char * s, int n); XTag * xtag_new_parse (const char * s, int n);
char * xtag_get_name (XTag * xtag); char * xtag_get_name (XTag * xtag);
char * xtag_get_pcdata (XTag * xtag); char * xtag_get_pcdata (XTag * xtag);
char * xtag_get_attribute (XTag * xtag, char * attribute); char * xtag_get_attribute (XTag * xtag, const char* attribute);
XTag * xtag_first_child (XTag * xtag, char * name); XTag * xtag_first_child (XTag * xtag, const char * name);
XTag * xtag_next_child (XTag * xtag, char * name); XTag * xtag_next_child (XTag * xtag, char * name);
int xtag_snprint (char * buf, int n, XTag * xtag); int xtag_snprint (char * buf, int n, XTag * xtag);
...@@ -521,50 +521,54 @@ xtag_get_pcdata (XTag * xtag) ...@@ -521,50 +521,54 @@ xtag_get_pcdata (XTag * xtag)
return NULL; return NULL;
} }
char * char* xtag_get_attribute (XTag * xtag, const char * attribute)
xtag_get_attribute (XTag * xtag, char * attribute)
{ {
XList * l; XList * l;
XAttribute * attr; XAttribute * attr;
if (xtag == NULL) return NULL; if( !xtag )
return NULL;
for (l = xtag->attributes; l; l = l->next) { for( l = xtag->attributes; l; l = l->next )
if ((attr = (XAttribute *)l->data) != NULL) { {
if (attr->name && attribute && !strcmp (attr->name, attribute)) if( ( attr = (XAttribute *)l->data ) != NULL )
{
if( attr->name && attribute && !strcmp( attr->name, attribute ) )
return attr->value; return attr->value;
} }
} }
return NULL; return NULL;
} }
XTag * XTag* xtag_first_child (XTag * xtag, const char * name)
xtag_first_child (XTag * xtag, char * name)
{ {
XList * l; XList * l;
XTag * child; XTag * child;
if (xtag == NULL) return NULL; if( !xtag )
return NULL;
if ((l = xtag->children) == NULL) return NULL; if( ( l = xtag->children ) == NULL )
return NULL;
if (name == NULL) { if( !name )
{
xtag->current_child = l; xtag->current_child = l;
return (XTag *)l->data; return (XTag *)l->data;
} }
for (; l; l = l->next) { for( ; l; l = l->next )
{
child = (XTag *)l->data; child = (XTag *)l->data;
if (child->name && name && !strcmp(child->name, name)) { if( child->name && name && !strcmp( child->name, name ) )
{
xtag->current_child = l; xtag->current_child = l;
return child; return child;
} }
} }
xtag->current_child = NULL; xtag->current_child = NULL;
return NULL; return NULL;
} }
......
...@@ -36,9 +36,9 @@ char * xtag_get_name (XTag * xtag); ...@@ -36,9 +36,9 @@ char * xtag_get_name (XTag * xtag);
char * xtag_get_pcdata (XTag * xtag); char * xtag_get_pcdata (XTag * xtag);
char * xtag_get_attribute (XTag * xtag, char * attribute); char * xtag_get_attribute (XTag * xtag, const char * attribute);
XTag * xtag_first_child (XTag * xtag, char * name); XTag * xtag_first_child (XTag * xtag, const char * name);
XTag * xtag_next_child (XTag * xtag, char * name); XTag * xtag_next_child (XTag * xtag, char * name);
......
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