Skip to content

Commit

Permalink
zap legacy genpp support for %extra_cons_args
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Mar 21, 2023
1 parent ee6274e commit 87fecdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions genpp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
false => [0,0], # perl, C
true => [1,1],
);
our %extra_cons_args = (
String => [['const char*', 'str']],
);
our %STAYWRAPPED = map +($_=>[]), qw(Mat String DMatch KeyPoint);
our $IF_ERROR_RETURN = "if (CW_err.error) return *(pdl_error *)&CW_err";

Expand Down Expand Up @@ -370,7 +367,7 @@ =head1 METHODS for $fullclass\n\n
=cut\n
\@${fullclass}::ISA = qw(@{$class2super{$c}});
EOD
my $extra_args = ($class2info{$c}||[])->[1] || $extra_cons_args{$c} || [];
my $extra_args = ($class2info{$c}||[])->[1] || [];
my $cons_doc = ($class2info{$c}||[])->[2] || "\@brief Initialize OpenCV $c object.";
my $cons_def = [$c, 'new', $cons_doc, 0, $c, ['char *', 'klass'], @$extra_args];
genpp(@$_) for ($class2info{$c}[0] ? $cons_def : ()), grep $_->[0] eq $c, @flist;
Expand Down
8 changes: 5 additions & 3 deletions genwrap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use Config;

require ''. catfile $Bin, 'genpp.pl';
our (%type_overrides, %type_alias, %extra_cons_args, %STAYWRAPPED);
our (%type_overrides, %type_alias, %STAYWRAPPED);
my %extra_cons_args = (
String => [['const char*', 'str']],
);
my %GLOBALTYPES = do { no warnings 'once'; (%PP::OpenCV::DIMTYPES, map +($_=>[]), keys %STAYWRAPPED) };
my @PDLTYPES_SUPPORTED = grep $_->real && $_->ppsym !~/[KPQN]/ && howbig($_) <= 8, PDL::Types::types;
my %REALCTYPE2NUMVAL = (
Expand Down Expand Up @@ -366,8 +369,7 @@ sub readclasses {
return +{} if !-f 'classes.pl';
my @classlist = do ''. catfile curdir, 'classes.pl'; die if $@;
+{map +($_->[0]=>[
[], $_->[3],
$_->[4], $_->[5]||$extra_cons_args{$_->[0]}
[], @$_[3..5],
]), @classlist
};
}
Expand Down

0 comments on commit 87fecdd

Please sign in to comment.