Patch-Source: https://sources.debian.org/data/main/libx/libxml-bare-perl/0.53-4/debian/patches/pointer_from_integer.patch -- Description: fix use of pointer as int fixes "warning: comparison between pointer and integer" and "warning: assignment makes pointer from integer without a cast" compiler warnings Author: Florian Schlichting --- a/Bare.xs +++ b/Bare.xs @@ -144,7 +144,7 @@ SV *atthref = newRV_noinc( (SV *) atth ); hv_store( output, curatt->name, curatt->namelen, atthref, 0 ); - if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); + if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); else attval = newSVpvn( curatt->value, curatt->vallen ); SvUTF8_on(attval); hv_store( atth, "value", 5, attval, vhash ); @@ -272,7 +272,7 @@ if( numatts ) { curatt = curnode->firstatt; for( i = 0; i < numatts; i++ ) { - if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); + if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); else attval = newSVpvn( curatt->value, curatt->vallen ); SvUTF8_on(attval); hv_store( output, curatt->name, curatt->namelen, attval, 0 ); --- a/parser.c +++ b/parser.c @@ -417,7 +417,7 @@ case 0: last_state = ST_att_name; goto done; case '/': // self closing !! /> is assumed !! curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; curnode->z = cpos+1-xmlin; @@ -436,7 +436,7 @@ goto att_space; case '>': curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; cpos++; goto val_1; @@ -832,7 +832,7 @@ switch( let ) { case '/': // self closing !! /> is assumed !! curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; curnode = curnode->parent; @@ -850,7 +850,7 @@ goto u_att_space; case '>': curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; cpos++; goto u_val_1;