1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
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 <fsfs@debian.org>
--- 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;
|