From fb089d08ff9bc5cf45570b950aa33e50ee62371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 29 Sep 2015 10:31:58 +0200 Subject: [PATCH] Cast char* and U8* where needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building with GCC 5.1.1 and perl-5.22.0 produces various warnings about mismatching signess. This patch corrects it. Signed-off-by: Petr Písař --- XS.xs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/XS.xs b/XS.xs index 0af7c95..134ed9e 100644 --- a/XS.xs +++ b/XS.xs @@ -765,7 +765,7 @@ decode_he (dec_t *dec, HV *hv) dec->cur += len; if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) - if (!is_utf8_string (key, len)) + if (!is_utf8_string ((U8*)key, len)) ERR ("corrupted CBOR data (invalid UTF-8 in map key)"); hv_store (hv, key, -len, decode_sv (dec), 0); @@ -854,7 +854,7 @@ decode_str (dec_t *dec, int utf8) STRLEN len = decode_uint (dec); WANT (len); - sv_catpvn (sv, dec->cur, len); + sv_catpvn (sv, (char *)dec->cur, len); dec->cur += len; } } @@ -863,7 +863,7 @@ decode_str (dec_t *dec, int utf8) STRLEN len = decode_uint (dec); WANT (len); - sv = newSVpvn (dec->cur, len); + sv = newSVpvn ((char*)dec->cur, len); dec->cur += len; if (ecb_expect_false (dec->stringref) @@ -874,7 +874,7 @@ decode_str (dec_t *dec, int utf8) if (utf8) { if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) - if (!is_utf8_string (SvPVX (sv), SvCUR (sv))) + if (!is_utf8_string ((U8*)SvPVX (sv), SvCUR (sv))) ERR ("corrupted CBOR data (invalid UTF-8 in text string)"); SvUTF8_on (sv); @@ -1181,7 +1181,7 @@ decode_cbor (SV *string, CBOR *cbor, char **offset_return) sv = decode_sv (&dec); if (offset_return) - *offset_return = dec.cur; + *offset_return = (char *)dec.cur; if (!(offset_return || !sv)) if (dec.cur != dec.end && !dec.err) @@ -1231,7 +1231,7 @@ incr_parse (CBOR *self, SV *cborstr) 1, 2, 4, 8,-1,-1,-1,-2 }; - const U8 *p = SvPVX (cborstr) + self->incr_pos; + const U8 *p = (U8*)SvPVX (cborstr) + self->incr_pos; U8 m = *p & MINOR_MASK; IV count = SvIVX (AvARRAY (self->incr_count)[AvFILLp (self->incr_count)]); I8 ilen = incr_len[m]; -- 2.4.3