From ccf38f8bef1adef7c1ef8797d8c84e477bc82305 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Fri, 29 Dec 2006 15:29:57 +0000 Subject: [PATCH] fatal warnings --- alliances.pl | 4 +++- calls.pl | 4 +++- intel.pl | 18 ++++++++++-------- templates/alliances.tmpl | 2 +- templates/intel.tmpl | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/alliances.pl b/alliances.pl index 66ecfd6..4cfa2d5 100644 --- a/alliances.pl +++ b/alliances.pl @@ -18,6 +18,8 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; +no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -98,7 +100,7 @@ ORDER BY $order}); $query->execute($alliance->{id},$alliance->{id},$alliance->{id},$alliance->{id}) or $error .= $DBH->errstr; my @intel; - my $i = 0; + $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; diff --git a/calls.pl b/calls.pl index ce708fc..8aab04a 100644 --- a/calls.pl +++ b/calls.pl @@ -18,6 +18,8 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; +no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -160,7 +162,7 @@ WHERE i.call = ? ORDER BY p.x,p.y,p.z}); $attackers->execute($call->{id}); my @attackers; - my $i = 0; + $i = 0; while(my $attacker = $attackers->fetchrow_hashref){ $i++; $attacker->{ODD} = $i % 2; diff --git a/intel.pl b/intel.pl index 90498c2..5db6f9b 100644 --- a/intel.pl +++ b/intel.pl @@ -18,6 +18,8 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; +no warnings qw(uninitialized); use POSIX; our $BODY; our $DBH; @@ -135,7 +137,7 @@ if ($planet){ my $query = $DBH->prepare(intelquery('o.alliance AS oalliance,coords(o.x,o.y,o.z) AS origin',"t.id = ? $showticks")); $query->execute($planet->{id}) or $error .= $DBH->errstr; my @intellists; - my @intel; + my @incomings; my $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ @@ -145,14 +147,14 @@ if ($planet){ } $i++; $intel->{ODD} = $i % 2; - push @intel,$intel; + push @incomings,$intel; } - push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; + push @intellists,{Message => 'Incoming fleets', Intel => \@incomings, Origin => 1}; - my $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks")); + $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks")); $query->execute($planet->{id}) or $error .= $DBH->errstr; - my @intel; - my $i = 0; + my @outgoings; + $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; @@ -161,9 +163,9 @@ if ($planet){ } $i++; $intel->{ODD} = $i % 2; - push @intel,$intel; + push @outgoings,$intel; } - push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; + push @intellists,{Message => 'Outgoing Fleets', Intel => \@outgoings, Target => 1}; $BODY->param(IntelLIsts => \@intellists); diff --git a/templates/alliances.tmpl b/templates/alliances.tmpl index a7e67dd..42e3ded 100644 --- a/templates/alliances.tmpl +++ b/templates/alliances.tmpl @@ -59,8 +59,8 @@ - + diff --git a/templates/intel.tmpl b/templates/intel.tmpl index 3fc6d40..288b1e1 100644 --- a/templates/intel.tmpl +++ b/templates/intel.tmpl @@ -87,8 +87,8 @@ - + -- 2.39.2