+3.11_06 - 2007-09-11
+
+ * fix cpan #29302: Perl_croak_nocontext doesn't need aTHX_
+ (spotted by Jerry D. Hedden)
+ * fix a Win32 VC++ compiler warning (thanks to Steve Hay for
+ providing a patch)
+ * don't generate redundant specs for provided Perl_ functions
+ * fun with const and casts to avoid compiler warnings
+ * bump max supported version to 5.10.0
+
3.11_05 - 2007-08-20
* fix: PERL_HASH() was emitting a warning when passed in a
#
################################################################################
#
-# $Revision: 55 $
+# $Revision: 57 $
# $Author: mhx $
-# $Date: 2007/08/19 19:41:37 +0200 $
+# $Date: 2007/09/11 23:28:24 +0200 $
#
################################################################################
#
my @perl_api;
for (keys %provides) {
+ next if /^Perl_(.*)/ && exists $embed{$1};
next if exists $embed{$_};
push @perl_api, $_;
check(2, "No API definition for provided element $_ found.");
{join "\n", @todo}gem;
$data =~ s{__MIN_PERL__}{5.003}g;
-$data =~ s{__MAX_PERL__}{5.9.5}g;
+$data =~ s{__MAX_PERL__}{5.10.0}g;
open FH, ">PPPort.pm" or die "PPPort.pm: $!\n";
print FH $data;
#
################################################################################
#
-# $Revision: 55 $
+# $Revision: 57 $
# $Author: mhx $
-# $Date: 2007/08/19 19:41:37 +0200 $
+# $Date: 2007/09/11 23:28:24 +0200 $
#
################################################################################
#
use strict;
use vars qw($VERSION $data);
-$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
+$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
sub _init_data
{
TODO:
-* bump __MAX_PERL__ before 5.10
-
* > 3. In several cases, "perl ppport.h --copy=.new" output a new file in
> which the only change was the addition of "#include "ppport.h"". In each
> case, that actually wasn't necessary because the source file in question
################################################################################
##
-## $Revision: 17 $
+## $Revision: 18 $
## $Author: mhx $
-## $Date: 2007/08/13 22:59:33 +0200 $
+## $Date: 2007/09/11 23:19:51 +0200 $
##
################################################################################
##
#if { NEED sv_2pvbyte }
char *
-sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
+sv_2pvbyte(pTHX_ SV *sv, STRLEN *lp)
{
sv_utf8_downgrade(sv,0);
return SvPV(sv,*lp);
################################################################################
##
-## $Revision: 13 $
+## $Revision: 14 $
## $Author: mhx $
-## $Date: 2007/08/12 23:57:10 +0200 $
+## $Date: 2007/09/11 23:20:41 +0200 $
##
################################################################################
##
#ifndef grok_bin
#if { NEED grok_bin }
UV
-grok_bin(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+grok_bin(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
#ifndef grok_hex
#if { NEED grok_hex }
UV
-grok_hex(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+grok_hex(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
#ifndef grok_oct
#if { NEED grok_oct }
UV
-grok_oct(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+grok_oct(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
################################################################################
##
-## $Revision: 14 $
+## $Revision: 15 $
## $Author: mhx $
-## $Date: 2007/08/20 19:19:24 +0200 $
+## $Date: 2007/09/11 23:20:42 +0200 $
##
################################################################################
##
mg = mg_find(sv, '~');
RETVAL = mg->mg_ptr == foo;
#else
- sv_magic(sv, 0, '~', foo, strlen(foo));
+ sv_magic(sv, 0, '~', (char *) foo, strlen(foo));
mg = mg_find(sv, '~');
RETVAL = strEQ(mg->mg_ptr, foo);
#endif
################################################################################
##
-## $Revision: 11 $
+## $Revision: 12 $
## $Author: mhx $
-## $Date: 2007/01/02 12:32:33 +0100 $
+## $Date: 2007/09/11 23:20:42 +0200 $
##
################################################################################
##
#if { NEED newCONSTSUB }
void
-newCONSTSUB(HV *stash, char *name, SV *sv)
+newCONSTSUB(HV *stash, const char *name, SV *sv)
{
U32 oldhints = PL_hints;
HV *old_cop_stash = PL_curcop->cop_stash;
start_subparse(FALSE, 0),
#endif
- newSVOP(OP_CONST, 0, newSVpv(name,0)),
+ newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
);
################################################################################
##
-## $Revision: 44 $
+## $Revision: 45 $
## $Author: mhx $
-## $Date: 2007/08/20 18:21:09 +0200 $
+## $Date: 2007/09/11 23:18:31 +0200 $
##
################################################################################
##
for $func (sort keys %{$file{uses_Perl}}) {
if ($API{$func}{varargs}) {
- my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
- { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
- if ($changes) {
- warning("Doesn't pass interpreter argument aTHX to Perl_$func");
- $file{changes} += $changes;
+ unless ($API{$func}{nothxarg}) {
+ my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
+ { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
+ if ($changes) {
+ warning("Doesn't pass interpreter argument aTHX to Perl_$func");
+ $file{changes} += $changes;
+ }
}
}
else {
################################################################################
##
-## $Revision: 40 $
+## $Revision: 41 $
## $Author: mhx $
-## $Date: 2007/08/20 18:06:48 +0200 $
+## $Date: 2007/09/11 23:18:33 +0200 $
##
################################################################################
##
##
################################################################################
-=tests plan => 225
+=tests plan => 229
BEGIN {
if ($ENV{'SKIP_SLOW_TESTS'}) {
- for (1 .. 225) {
+ for (1 .. 229) {
skip("skip: SKIP_SLOW_TESTS", 0);
}
exit 0;
# define SOMETHING_ELSE PL_defgv + \
PL_sv_undef
+===============================================================================
+
+my $o = ppport(qw(--copy=f));
+
+for (qw(file.xs)) {
+ ok($o =~ /^Writing copy of.*\Q$_\E.*with changes/mi);
+ ok(-e "${_}f");
+ ok(eq_files("${_}f", "${_}r"));
+ unlink "${_}f";
+}
+
+---------------------------- file.xs -----------------------------------------
+
+#define NEED_sv_2pv_flags
+#define NEED_vnewSVpvf
+#define NEED_warner
+#include "ppport.h"
+Perl_croak_nocontext("foo");
+Perl_croak("bar");
+croak("foo");
+croak_nocontext("foo");
+Perl_warner_nocontext("foo");
+Perl_warner("foo");
+warner_nocontext("foo");
+warner("foo");
+
+---------------------------- file.xsr -----------------------------------------
+
+#define NEED_sv_2pv_flags
+#define NEED_vnewSVpvf
+#define NEED_warner
+#include "ppport.h"
+Perl_croak_nocontext("foo");
+Perl_croak(aTHX_ "bar");
+croak("foo");
+croak_nocontext("foo");
+Perl_warner_nocontext("foo");
+Perl_warner(aTHX_ "foo");
+warner_nocontext("foo");
+warner("foo");
+
################################################################################
##
-## $Revision: 1 $
+## $Revision: 3 $
## $Author: mhx $
-## $Date: 2007/08/19 19:38:17 +0200 $
+## $Date: 2007/09/11 23:20:42 +0200 $
##
################################################################################
##
if (len < 0)
len = -len;
if (!hash)
- PERL_HASH(hash, src, len);
+ PERL_HASH(hash, (char*) src, len);
sv = newSVpvn((char *) src, len);
sv_upgrade(sv, SVt_PVIV);
SvIVX(sv) = hash;
RETVAL = 0;
s = "mhx";
len = 3;
- PERL_HASH(hash, s, len);
+ PERL_HASH(hash, (char *) s, len);
sv = newSVpvn_share(s, len, 0);
s = 0;
RETVAL += strEQ(SvPV_nolen_const(sv), "mhx");
SvREFCNT_dec(sv);
s = "foobar";
len = 6;
- PERL_HASH(hash, s, len);
- sv = newSVpvn_share(s, -len, hash);
+ PERL_HASH(hash, (char *) s, len);
+ sv = newSVpvn_share(s, -(I32) len, hash);
s = 0;
RETVAL += strEQ(SvPV_nolen_const(sv), "foobar");
RETVAL += SvCUR(sv) == len;
################################################################################
##
-## $Revision: 7 $
+## $Revision: 8 $
## $Author: mhx $
-## $Date: 2007/08/12 23:57:10 +0200 $
+## $Date: 2007/09/11 23:20:43 +0200 $
##
################################################################################
##
#if { VERSION >= 5.004 }
sv = vnewSVpvf(pat, &args);
#else
- sv = newSVpv(pat, 0);
+ sv = newSVpv((char *) pat, 0);
#endif
va_end(args);
return sv;
#if { VERSION >= 5.004 }
sv_vcatpvf(sv, pat, &args);
#else
- sv_catpv(sv, pat);
+ sv_catpv(sv, (char *) pat);
#endif
va_end(args);
}
#if { VERSION >= 5.004 }
sv_vsetpvf(sv, pat, &args);
#else
- sv_setpv(sv, pat);
+ sv_setpv(sv, (char *) pat);
#endif
va_end(args);
}
################################################################################
##
-## $Revision: 11 $
+## $Revision: 12 $
## $Author: mhx $
-## $Date: 2007/08/13 00:31:48 +0200 $
+## $Date: 2007/09/11 23:20:43 +0200 $
##
################################################################################
##
SV *
PL_hexdigit()
CODE:
- RETVAL = newSVpv(PL_hexdigit, 0);
+ RETVAL = newSVpv((char *) PL_hexdigit, 0);
OUTPUT:
RETVAL
use List::Util qw(max);
use Config;
-my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_05 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
+my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.11_06 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
$| = 1;
my %OPT = (
require 'testutil.pl' if $@;
}
- if (225) {
+ if (229) {
load();
- plan(tests => 225);
+ plan(tests => 229);
}
}
BEGIN {
if ($ENV{'SKIP_SLOW_TESTS'}) {
- for (1 .. 225) {
+ for (1 .. 229) {
skip("skip: SKIP_SLOW_TESTS", 0);
}
exit 0;
# define SOMETHING_ELSE PL_defgv + \
PL_sv_undef
+===============================================================================
+
+my $o = ppport(qw(--copy=f));
+
+for (qw(file.xs)) {
+ ok($o =~ /^Writing copy of.*\Q$_\E.*with changes/mi);
+ ok(-e "${_}f");
+ ok(eq_files("${_}f", "${_}r"));
+ unlink "${_}f";
+}
+
+---------------------------- file.xs -----------------------------------------
+
+#define NEED_sv_2pv_flags
+#define NEED_vnewSVpvf
+#define NEED_warner
+#include "ppport.h"
+Perl_croak_nocontext("foo");
+Perl_croak("bar");
+croak("foo");
+croak_nocontext("foo");
+Perl_warner_nocontext("foo");
+Perl_warner("foo");
+warner_nocontext("foo");
+warner("foo");
+
+---------------------------- file.xsr -----------------------------------------
+
+#define NEED_sv_2pv_flags
+#define NEED_vnewSVpvf
+#define NEED_warner
+#include "ppport.h"
+Perl_croak_nocontext("foo");
+Perl_croak(aTHX_ "bar");
+croak("foo");
+croak_nocontext("foo");
+Perl_warner_nocontext("foo");
+Perl_warner(aTHX_ "foo");
+warner_nocontext("foo");
+warner("foo");
+