applied 3 patches from jhi
Dan Kogai
9 years ago
2 | 2 |
# $Id: Changes,v 2.64 2014/10/29 15:37:54 dankogai Exp dankogai $
|
3 | 3 |
#
|
4 | 4 |
$Revision: 2.64 $ $Date: 2014/10/29 15:37:54 $
|
|
5 |
! Changes Encode.xs bin/enc2xs
|
|
6 |
"We cranked up the warnings in the core." from jhi
|
|
7 |
Message-Id: <54753674.6070909@iki.fi>
|
|
8 |
|
|
9 |
2.64 2014/10/29 15:37:54
|
5 | 10 |
! t/utf8warnings.t MANIFEST
|
6 | 11 |
Retouch pull #26 so it works with perl < 5.14
|
7 | 12 |
! Encode.pm
|
8 | 13 |
+ t/utf8warnings.t
|
9 | 14 |
Pulled: Catch and re-issue utf8 warnings at a higher level
|
10 | 15 |
https://github.com/dankogai/p5-encode/pull/26
|
11 | |
+ Encode.xs
|
|
16 |
! Encode.xs
|
12 | 17 |
Pulled: Validate continuations in the incremental UTF-X decoder
|
13 | 18 |
https://github.com/dankogai/p5-encode/pull/25
|
14 | 19 |
|
20 | 20 |
|
21 | 21 |
#define UNIMPLEMENTED(x,y) y x (SV *sv, char *encoding) { \
|
22 | 22 |
Perl_croak_nocontext("panic_unimplemented"); \
|
|
23 |
PERL_UNUSED_VAR(sv); \
|
|
24 |
PERL_UNUSED_VAR(encoding); \
|
23 | 25 |
return (y)0; /* fool picky compilers */ \
|
24 | 26 |
}
|
25 | 27 |
/**/
|
|
66 | 68 |
call_failure(SV * routine, U8 * done, U8 * dest, U8 * orig)
|
67 | 69 |
{
|
68 | 70 |
/* Exists for breakpointing */
|
|
71 |
PERL_UNUSED_VAR(routine);
|
|
72 |
PERL_UNUSED_VAR(done);
|
|
73 |
PERL_UNUSED_VAR(dest);
|
|
74 |
PERL_UNUSED_VAR(orig);
|
69 | 75 |
}
|
70 | 76 |
|
71 | 77 |
|
|
362 | 368 |
if (strict && uv > PERL_UNICODE_MAX)
|
363 | 369 |
ulen = (STRLEN) -1;
|
364 | 370 |
#endif
|
365 | |
if (ulen == -1) {
|
|
371 |
if (ulen == (STRLEN) -1) {
|
366 | 372 |
if (strict) {
|
367 | 373 |
uv = utf8n_to_uvuni(s, e - s, &ulen,
|
368 | 374 |
UTF8_CHECK_ONLY | UTF8_ALLOW_NONSTRICT);
|
369 | |
if (ulen == -1)
|
|
375 |
if (ulen == (STRLEN) -1)
|
370 | 376 |
goto malformed_byte;
|
371 | 377 |
goto malformed;
|
372 | 378 |
}
|
|
506 | 512 |
U8 *s;
|
507 | 513 |
U8 *e;
|
508 | 514 |
SV *dst;
|
509 | |
bool renewed = 0;
|
510 | 515 |
int check;
|
511 | 516 |
CODE:
|
512 | 517 |
{
|
|
567 | 572 |
SV * obj
|
568 | 573 |
CODE:
|
569 | 574 |
{
|
|
575 |
PERL_UNUSED_VAR(obj);
|
570 | 576 |
XSRETURN(1);
|
571 | 577 |
}
|
572 | 578 |
|
|
575 | 581 |
SV * obj
|
576 | 582 |
CODE:
|
577 | 583 |
RETVAL = 0;
|
|
584 |
PERL_UNUSED_VAR(obj);
|
578 | 585 |
OUTPUT:
|
579 | 586 |
RETVAL
|
580 | 587 |
|
|
676 | 683 |
CODE:
|
677 | 684 |
{
|
678 | 685 |
/* encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); */
|
|
686 |
PERL_UNUSED_VAR(obj);
|
679 | 687 |
ST(0) = &PL_sv_no;
|
680 | 688 |
XSRETURN(1);
|
681 | 689 |
}
|
|
688 | 696 |
/* encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); */
|
689 | 697 |
/* require_pv(PERLIO_FILENAME); */
|
690 | 698 |
|
|
699 |
PERL_UNUSED_VAR(obj);
|
691 | 700 |
eval_pv("require PerlIO::encoding", 0);
|
692 | 701 |
SPAGAIN;
|
693 | 702 |
|
700 | 700 |
my $cpp = ($Config{d_cplusplus} || '') eq 'define';
|
701 | 701 |
my $var = $^O eq 'MacOS' || $cpp ? 'extern' : 'static';
|
702 | 702 |
my $const = $cpp ? '' : 'const';
|
703 | |
print $fh "$var $const encpage_t $name\[",scalar(@{$a->{'Entries'}}),"];\n";
|
|
703 |
my $ccflags = $Config{ccflags};
|
|
704 |
if (defined $Config{ccwarnflags}) {
|
|
705 |
$ccflags .= " " . $Config{ccwarnflags};
|
|
706 |
}
|
|
707 |
my $count = $ccflags =~ /-Wc\+\+-compat/ ? '' : scalar(@{$a->{'Entries'}});
|
|
708 |
print $fh "$var $const encpage_t $name\[$count];\n";
|
704 | 709 |
}
|
705 | 710 |
$a->{'DoneStrings'} = 1;
|
706 | 711 |
foreach my $b (@{$a->{'Entries'}})
|