Skip to content

Commit

Permalink
Remove use of indirect object notation
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nez authored and sn5212 committed Jan 30, 2017
1 parent c5c4bce commit e3feaad
Show file tree
Hide file tree
Showing 37 changed files with 88 additions and 88 deletions.
14 changes: 7 additions & 7 deletions autogen/compilers/compile.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

do $OPT{cfgfile};

my $c = new Convert::Binary::C %config;
my $c = Convert::Binary::C->new(%config);

$c->parse_file('test.h');

Expand All @@ -86,7 +86,7 @@
"$1$suf";
/ge;

my $cc = new Compiler::Config %OPT, ccflags => [@ARGV];
my $cc = Compiler::Config->new(%OPT, ccflags => [@ARGV]);
# my $cfg = $cc->get_config;

my $bin = $cc->_test_type($c->sourcify, 'test', $init, $c->sizeof('test'));
Expand Down Expand Up @@ -411,7 +411,7 @@ sub check_config

$self->{debug} and import Convert::Binary::C debug => 'all';

my $c = eval { new Convert::Binary::C };
my $c = eval { Convert::Binary::C->new };
$@ and return {code => ERR_CREATE};

eval { $c->configure( %$config ) };
Expand Down Expand Up @@ -888,7 +888,7 @@ sub _test_type
my $res = $self->_compile_temp;
$res->{status} and return undef;

my $fh = new IO::File $self->{obj} or return undef;
my $fh = IO::File->new($self->{obj}) or return undef;
binmode $fh;

my $obj = do { local $/; <$fh> };
Expand Down Expand Up @@ -1977,7 +1977,7 @@ sub _names
$files{$file} = 1;
$ff = keys %files;
$self->_work_in_progress( "$ff files found" );
my $fh = new IO::File $file;
my $fh = IO::File->new($file);
next unless defined $fh;
while( <$fh> ) {
if( /^\s*#\s*include\s*[<"]([^>"]+)[>"]/ ) {
Expand All @@ -1999,7 +1999,7 @@ sub _names
$fs++;
$self->_work_in_progress( "($count) $fs/$ff files scanned" );
-e $name or next;
my $fh = new IO::File $name;
my $fh = IO::File->new($name);
next unless defined $fh;
my $file = do { local $/; <$fh> };
$file =~ s{\\\s*$/}{}g;
Expand Down Expand Up @@ -2240,7 +2240,7 @@ sub _temp
unlink $self->{temp}
or croak "Could not remove temporary file '$self->{temp}': $!\n";
}
my $f = new IO::File ">$self->{temp}";
my $f = IO::File->new(">$self->{temp}");
defined $f
or croak "Could not open temporary file '$self->{temp}': $!\n";
$f->print( @_ );
Expand Down
16 changes: 8 additions & 8 deletions autogen/complex/footer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ sub checkrc
}
}

my $p = new Convert::Binary::C ByteOrder => 'LittleEndian',
ShortSize => 2,
IntSize => 4,
LongSize => 4,
PointerSize => 4,
FloatSize => 4,
DoubleSize => 8,
Alignment => 4;
my $p = Convert::Binary::C->new(ByteOrder => 'LittleEndian',
ShortSize => 2,
IntSize => 4,
LongSize => 4,
PointerSize => 4,
FloatSize => 4,
DoubleSize => 8,
Alignment => 4);

$p->parse($types);

Expand Down
8 changes: 4 additions & 4 deletions autogen/doc/Pod/Tree/MyHTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sub _resolve_source

isa $source, 'Pod::Tree' and return $source;

my $tree = new Pod::Tree;
my $tree = Pod::Tree->new;
not $ref and $tree->load_file ( $source);
isa $source, 'IO::File' and $tree->load_fh ( $source);
$ref eq 'SCALAR' and $tree->load_string ($$source);
Expand All @@ -80,11 +80,11 @@ sub _resolve_dest
local *isa = \&UNIVERSAL::isa;

isa $dest, 'HTML::Stream' and return $dest;
ref $dest and return new HTML::Stream $dest;
ref $dest and return HTML::Stream->new($dest);

my $fh = new IO::File;
my $fh = IO::File->new;
$fh->open(">$dest") or die "Pod::Tree::MyHTML::new: Can't open $dest: $!\n";
new HTML::Stream $fh
HTML::Stream->new($fh)
}


Expand Down
6 changes: 3 additions & 3 deletions autogen/doc/clone.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#-8<-

$c = new Convert::Binary::C Include => ['/usr/include'];
$c = Convert::Binary::C->new(Include => ['/usr/include']);
$c->parse_file('definitions.c');
$clone = $c->clone;

#-8<-

$c = new Convert::Binary::C Include => ['/usr/include'];
$c = Convert::Binary::C->new(Include => ['/usr/include']);
$c->parse_file('definitions.c');
$clone = new Convert::Binary::C %{$c->configure};
$clone = Convert::Binary::C->new(%{$c->configure});
$clone->parse($c->sourcify);

2 changes: 1 addition & 1 deletion autogen/doc/compound.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Data::Dumper;
$Data::Dumper::Indent = 1;

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;
$c->parse_file('definitions.c');

#-8<-
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/compound_alignment.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Data::Dumper;
$Data::Dumper::Indent = 0;

$c = new Convert::Binary::C Alignment => 4, CompoundAlignment => 4;
$c = Convert::Binary::C->new(Alignment => 4, CompoundAlignment => 4);

#-8<-

Expand Down
6 changes: 3 additions & 3 deletions autogen/doc/configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use vars qw( $order ); #-8<-
$Data::Dumper::Indent = 1; #-8<-

$c = new Convert::Binary::C Define => ['DEBUGGING', 'FOO=123'],
Include => ['/usr/include'];
$c = Convert::Binary::C->new(Define => ['DEBUGGING', 'FOO=123'],
Include => ['/usr/include']);

print Dumper($c->configure);

Expand All @@ -29,7 +29,7 @@

#-8<- 6

$c = new Convert::Binary::C Include => ['/include'];
$c = Convert::Binary::C->new(Include => ['/include']);
$c->Include('/usr/include', '/usr/local/include');
print Dumper($c->Include);

Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/enum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Data::Dumper;
$Data::Dumper::Indent = 1;

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;
$c->parse_file('definitions.c');

#-8<-
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/enum_names.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Data::Dumper;
$Data::Dumper::Indent = 0;

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;

#-8<-

Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/hooks3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@

use Config;

$c = new Convert::Binary::C %CC, OrderMembers => 1;
$c = Convert::Binary::C->new(%CC, OrderMembers => 1);
$c->Include(["$Config{archlib}/CORE", @{$c->Include}]);
$c->parse(<<ENDC);
#include "EXTERN.h"
Expand Down
6 changes: 3 additions & 3 deletions autogen/doc/intro.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#-8<-

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;

#-8<-

Expand All @@ -15,8 +15,8 @@

#-8<-

$c = new Convert::Binary::C ByteOrder => 'LittleEndian',
Alignment => 2;
$c = Convert::Binary::C->new(ByteOrder => 'LittleEndian',
Alignment => 2);

#-8<-

Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/keywords.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

close FILE;

my $c = new Convert::Binary::C;
my $c = Convert::Binary::C->new;
my @kw;

for my $k (sort keys %h) {
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/parse_file.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use Convert::Binary::C;

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;

#-8<-
$c->parse(<<'#-8<-');
Expand Down
6 changes: 3 additions & 3 deletions autogen/doc/pdf/Pod/MyLaTeX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ sub interior_sequence {

} elsif ($seq_command eq 'L') {

my $link = new Pod::Hyperlink($seq_argument);
my $link = Pod::Hyperlink->new($seq_argument);

# undef on failure
unless (defined $link) {
Expand Down Expand Up @@ -1161,7 +1161,7 @@ sub interior_sequence {
} elsif ($seq_command eq 'P') {
print "[$seq_argument]\n";
if( exists $self->{KnownPODs}{$seq_argument} ) {
my $link = new Pod::Hyperlink($seq_argument);
my $link = Pod::Hyperlink->new($seq_argument);

# undef on failure
unless (defined $link) {
Expand Down Expand Up @@ -1232,7 +1232,7 @@ sub begin_list {

# Indicate that a list should be started for the next item
# need to do this to work out the type of list
push ( @{$self->lists}, new Pod::List(-indent => $indent,
push ( @{$self->lists}, Pod::List->new(-indent => $indent,
-start => $line_num,
-file => $self->input_file,
)
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/pdf/Pod/ParseUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Pod::ParseUtils - helpers for POD parsing and conversion
use Pod::ParseUtils;
my $list = new Pod::List;
my $list = Pod::List->new;
my $link = Pod::Hyperlink->new('Pod::Parser');
=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/preprocessor.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Convert::Binary::C;
$c = new Convert::Binary::C Alignment => 4;
$c = Convert::Binary::C->new(Alignment => 4);

#-8<-

Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/reconfig.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use Convert::Binary::C;

$c = new Convert::Binary::C Alignment => 4, IntSize => 4;
$c = Convert::Binary::C->new(Alignment => 4, IntSize => 4);

#-8<-
$c->parse(<<'#-8<-');
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/sourcify.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use Convert::Binary::C;

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;
$c->parse(<<'END');
#define ADD(a, b) ((a) + (b))
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/synopsis_advanced.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------
# Create a new object
#---------------------
my $c = new Convert::Binary::C ByteOrder => 'BigEndian';
my $c = Convert::Binary::C->new(ByteOrder => 'BigEndian');

#---------------------------------------------------
# Add include paths and global preprocessor defines
Expand Down
2 changes: 1 addition & 1 deletion autogen/doc/types.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
typedef int foo;
#-8<-

$c = new Convert::Binary::C;
$c = Convert::Binary::C->new;
$size = $c->sizeof('unsigned long');
$data = $c->pack('short int', 42);

Expand Down
2 changes: 1 addition & 1 deletion autogen/ppsym/ppsym.pl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ END
sub getsym
{
/\.h$/ or return;
my $fh = new IO::File $_ or return;
my $fh = IO::File->new($_) or return;
my $file = do { local $/; <$fh> };
my $id = '[a-zA-Z_]\w*';

Expand Down
2 changes: 1 addition & 1 deletion autogen/sizes/mkoffsets.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
my $cfg = require '../../tests/include/config.pl';
s!^tests!../../tests! for @{$cfg->{Include}};

my $c = new Convert::Binary::C %$cfg;
my $c = Convert::Binary::C->new(%$cfg);

$c->parse_file( '../../tests/include/include.c' );

Expand Down
2 changes: 1 addition & 1 deletion autogen/sizes/mksizes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
my $cfg = require '../../tests/include/config.pl';
s!^tests!../../tests! for @{$cfg->{Include}};

my $c = new Convert::Binary::C %$cfg;
my $c = Convert::Binary::C->new(%$cfg);

$c->parse_file( '../../tests/include/include.c' );

Expand Down
2 changes: 1 addition & 1 deletion devel/bench.pl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Include => ['tests/include/perlinc', 'tests/include/include'],
);

my $c = new Convert::Binary::C;
my $c = Convert::Binary::C->new;

for my $k (keys %config) {
eval { $c->configure($k => $config{$k}) };
Expand Down
10 changes: 5 additions & 5 deletions devel/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

my $code = do { local $/; <DATA> };

my $p = new Convert::Binary::C ByteOrder => 'BigEndian',
IntSize => 4,
PointerSize => 4,
EnumSize => 0,
Alignment => 4;
my $p = Convert::Binary::C->new(ByteOrder => 'BigEndian',
IntSize => 4,
PointerSize => 4,
EnumSize => 0,
Alignment => 4);

$p->parse( $code );

Expand Down
12 changes: 6 additions & 6 deletions devel/test2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

my $code = do { local $/; <DATA> };

my $p = new Convert::Binary::C ByteOrder => 'BigEndian',
IntSize => 4,
PointerSize => 4,
EnumSize => 0,
Warnings => 1,
Alignment => 4;
my $p = Convert::Binary::C->new(ByteOrder => 'BigEndian',
IntSize => 4,
PointerSize => 4,
EnumSize => 0,
Warnings => 1,
Alignment => 4);

$p->parse( $code );

Expand Down
2 changes: 1 addition & 1 deletion devel/test3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/usr/include
);

my $p = new Convert::Binary::C Include => [@inc];
my $p = Convert::Binary::C->new(Include => [@inc]);

$p->parse( <<'ENDC' );
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion devel/test5.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

my $code = do { local $/; <DATA> };

my $p = new Convert::Binary::C;
my $p = Convert::Binary::C->new;
$p->parse( $code );

print Data::Dumper->Dump( [[$p->enum],[$p->struct],[$p->typedef]],
Expand Down
Loading

0 comments on commit e3feaad

Please sign in to comment.