Skip to content

Commit 5a77192

Browse files
committed
pv_uni_display(): Declare as U8 to eliminate casts
Every use of these variables expects them to be pointers to U8.
1 parent 5957de4 commit 5a77192

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utf8.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4189,21 +4189,22 @@ Perl_pv_uni_display(pTHX_ SV *dsv, const U8 *spv, STRLEN len, STRLEN pvlim,
41894189
UV flags)
41904190
{
41914191
int truncated = 0;
4192-
const char *s, *e;
4192+
const U8 *s, *e;
41934193

41944194
PERL_ARGS_ASSERT_PV_UNI_DISPLAY;
41954195

41964196
SvPVCLEAR(dsv);
41974197
SvUTF8_off(dsv);
4198-
for (s = (const char *)spv, e = s + len; s < e; s += UTF8SKIP(s)) {
4198+
for (s = spv, e = s + len; s < e; s += UTF8SKIP(s)) {
41994199
UV u;
42004200
bool ok = 0;
42014201

42024202
if (pvlim && SvCUR(dsv) >= pvlim) {
42034203
truncated++;
42044204
break;
42054205
}
4206-
u = utf8_to_uvchr_buf((U8*)s, (U8*)e, 0);
4206+
4207+
u = utf8_to_uvchr_buf(s, e, 0);
42074208
if (u < 256) {
42084209
const U8 c = (U8) u;
42094210
if (flags & UNI_DISPLAY_BACKSLASH) {

0 commit comments

Comments
 (0)