[gimp] pdb: use if defined $proc->{outargs} not if exists $proc->{outargs}
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] pdb: use if defined $proc->{outargs} not if exists $proc->{outargs}
- Date: Thu, 26 Sep 2013 12:11:21 +0000 (UTC)
commit 39bcc5883d611e6f955e66d45bc328fb8c0724bf
Author: Michael Natterer <mitch gimp org>
Date: Thu Sep 26 14:09:08 2013 +0200
pdb: use if defined $proc->{outargs} not if exists $proc->{outargs}
in app.pl and lib.pl because pdbgen copies this stuff round so
generically that it always exists. Fixes a ton of perl warnings.
tools/pdbgen/app.pl | 10 +++++-----
tools/pdbgen/lib.pl | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl
index 38a6eda..215f144 100644
--- a/tools/pdbgen/app.pl
+++ b/tools/pdbgen/app.pl
@@ -67,7 +67,7 @@ sub declare_args {
local $result = "";
foreach (@_) {
- my @args = @{$proc->{$_}} if exists $proc->{$_};
+ my @args = @{$proc->{$_}} if (defined $proc->{$_});
foreach (@args) {
my ($type, $name) = &arg_parse($_->{type});
@@ -104,7 +104,7 @@ sub marshal_inargs {
my $result = "";
my %decls;
- my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
+ my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
foreach (@inargs) {
my($pdbtype, @typeinfo) = &arg_parse($_->{type});
@@ -132,7 +132,7 @@ sub marshal_outargs {
my $proc = shift;
my $result;
my $argc = 0;
- my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
+ my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
if ($success) {
$result = <<CODE;
@@ -569,8 +569,8 @@ sub generate {
my $proc = $main::pdb{$name};
my $out = \%{$out{$proc->{group}}};
- my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
- my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
+ my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
+ my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
my $help = $proc->{help};
diff --git a/tools/pdbgen/lib.pl b/tools/pdbgen/lib.pl
index a633ba4..d4c991a 100644
--- a/tools/pdbgen/lib.pl
+++ b/tools/pdbgen/lib.pl
@@ -78,8 +78,8 @@ sub generate {
my $proc = $main::pdb{$name};
my $out = \%{$out{$proc->{group}}};
- my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
- my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
+ my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
+ my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
my $funcname = "gimp_$name"; my $wrapped = "";
my %usednames;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]