projects/aports·blob master · refs

66 lines · 2.7 KiB

1Patch-Source: https://sources.debian.org/data/main/libx/libxml-bare-perl/0.53-4/debian/patches/pointer_from_integer.patch
2--
3Description: fix use of pointer as int
4 fixes "warning: comparison between pointer and integer" and
5 "warning: assignment makes pointer from integer without a cast"
6 compiler warnings
7Author: Florian Schlichting <[email protected]>
8
9--- a/Bare.xs
10+++ b/Bare.xs
11@@ -144,7 +144,7 @@
12 SV *atthref = newRV_noinc( (SV *) atth );
13 hv_store( output, curatt->name, curatt->namelen, atthref, 0 );
14
15- if( curatt->value == -1 ) attval = newSVpvn( "1", 1 );
16+ if( curatt->value == NULL ) attval = newSVpvn( "1", 1 );
17 else attval = newSVpvn( curatt->value, curatt->vallen );
18 SvUTF8_on(attval);
19 hv_store( atth, "value", 5, attval, vhash );
20@@ -272,7 +272,7 @@
21 if( numatts ) {
22 curatt = curnode->firstatt;
23 for( i = 0; i < numatts; i++ ) {
24- if( curatt->value == -1 ) attval = newSVpvn( "1", 1 );
25+ if( curatt->value == NULL ) attval = newSVpvn( "1", 1 );
26 else attval = newSVpvn( curatt->value, curatt->vallen );
27 SvUTF8_on(attval);
28 hv_store( output, curatt->name, curatt->namelen, attval, 0 );
29--- a/parser.c
30+++ b/parser.c
31@@ -417,7 +417,7 @@
32 case 0: last_state = ST_att_name; goto done;
33 case '/': // self closing !! /> is assumed !!
34 curatt = nodec_addattr( curnode, attname, attname_len );
35- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; }
36+ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; }
37 attname_len = 0;
38
39 curnode->z = cpos+1-xmlin;
40@@ -436,7 +436,7 @@
41 goto att_space;
42 case '>':
43 curatt = nodec_addattr( curnode, attname, attname_len );
44- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; }
45+ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; }
46 attname_len = 0;
47 cpos++;
48 goto val_1;
49@@ -832,7 +832,7 @@
50 switch( let ) {
51 case '/': // self closing !! /> is assumed !!
52 curatt = nodec_addattr( curnode, attname, attname_len );
53- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; }
54+ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; }
55 attname_len = 0;
56
57 curnode = curnode->parent;
58@@ -850,7 +850,7 @@
59 goto u_att_space;
60 case '>':
61 curatt = nodec_addattr( curnode, attname, attname_len );
62- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; }
63+ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; }
64 attname_len = 0;
65 cpos++;
66 goto u_val_1;