You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.5 KiB
78 lines
2.5 KiB
9 years ago
|
From 7808571acdea1c66705d5296c57eb7e0de8ed4c2 Mon Sep 17 00:00:00 2001
|
||
9 years ago
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||
|
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ř <ppisar@redhat.com>
|
||
|
---
|
||
|
XS.xs | 12 ++++++------
|
||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||
|
|
||
|
diff --git a/XS.xs b/XS.xs
|
||
9 years ago
|
index 25e2b9e..2aa6c57 100644
|
||
9 years ago
|
--- a/XS.xs
|
||
|
+++ b/XS.xs
|
||
9 years ago
|
@@ -802,7 +802,7 @@ decode_he (dec_t *dec, HV *hv)
|
||
9 years ago
|
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);
|
||
9 years ago
|
@@ -891,7 +891,7 @@ decode_str (dec_t *dec, int utf8)
|
||
9 years ago
|
STRLEN len = decode_uint (dec);
|
||
|
|
||
|
WANT (len);
|
||
|
- sv_catpvn (sv, dec->cur, len);
|
||
|
+ sv_catpvn (sv, (char *)dec->cur, len);
|
||
|
dec->cur += len;
|
||
|
}
|
||
|
}
|
||
9 years ago
|
@@ -900,7 +900,7 @@ decode_str (dec_t *dec, int utf8)
|
||
9 years ago
|
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)
|
||
9 years ago
|
@@ -911,7 +911,7 @@ decode_str (dec_t *dec, int utf8)
|
||
9 years ago
|
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);
|
||
9 years ago
|
@@ -1221,7 +1221,7 @@ decode_cbor (SV *string, CBOR *cbor, char **offset_return)
|
||
9 years ago
|
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)
|
||
9 years ago
|
@@ -1271,7 +1271,7 @@ incr_parse (CBOR *self, SV *cborstr)
|
||
9 years ago
|
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];
|
||
|
--
|
||
9 years ago
|
2.5.5
|
||
9 years ago
|
|