]> git.imager.perl.org - imager.git/commitdiff
quote a few hash keys to prevent warnings on 5.004
authorTony Cook <tony@develop=help.com>
Tue, 19 Mar 2002 00:23:12 +0000 (00:23 +0000)
committerTony Cook <tony@develop=help.com>
Tue, 19 Mar 2002 00:23:12 +0000 (00:23 +0000)
Changes
Imager.pm
lib/Imager/Font/FreeType2.pm
t/t21draw.t

diff --git a/Changes b/Changes
index 896351537a4d2fc40bca0f809067923a48fc9db6..4831fcf0e7e38a5582ff360ae4a251fdf7f7a3fa 100644 (file)
--- a/Changes
+++ b/Changes
@@ -607,6 +607,7 @@ Revision history for Perl extension Imager.
        - fixed minor pod errors involving &gt;
         - make t1log optional, defaulting to off.  You can enable the log
           with Imager::init(t1log=>1) (Ticket #369)
+        - quote a few hash key strings to prevent warnings on 5.004
 
 =================================================================
 
index 185a3522d41c45153af1e4233acd875776755af3..2b283a4fe6288f1c8f8992363aaa92c9b7d195fe 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -2228,7 +2228,7 @@ sub setpixel {
 sub getpixel {
   my $self = shift;
 
-  my %opts = ( type=>'8bit', @_);
+  my %opts = ( "type"=>'8bit', @_);
 
   unless (exists $opts{'x'} && exists $opts{'y'}) {
     $self->{ERRSTR} = 'missing x and y parameters';
@@ -2243,7 +2243,7 @@ sub getpixel {
       return undef;
     }
     my @result;
-    if ($opts{type} eq '8bit') {
+    if ($opts{"type"} eq '8bit') {
       for my $i (0..$#{$opts{'x'}}) {
         push(@result, i_get_pixel($self->{IMG}, $x->[$i], $y->[$i]));
       }
@@ -2256,7 +2256,7 @@ sub getpixel {
     return wantarray ? @result : \@result;
   }
   else {
-    if ($opts{type} eq '8bit') {
+    if ($opts{"type"} eq '8bit') {
       return i_get_pixel($self->{IMG}, $x, $y);
     }
     else {
index 4ebf8ec4c72ff6681e0e16bc8a2c89ff65cd8252..f22a7239f9722eee87d48aa36e4d318412f773f9 100644 (file)
@@ -111,7 +111,7 @@ sub has_chars {
     $Imager::ERRSTR = "No string supplied to \$font->has_chars()";
     return;
   }
-  return i_ft2_has_chars($self->{id}, $hsh{string}, $hsh{utf8} || 0);
+  return i_ft2_has_chars($self->{id}, $hsh{string}, $hsh{'utf8'} || 0);
 }
 
 1;
index 46db0c8c1b200759f0fa2a1d9fbf2aab37724ac9..f40d5da3a1890a475aa62657f91e080466b2a9f1 100644 (file)
@@ -37,17 +37,17 @@ ok($img->box(color=>$redobj, xmin=>10, ymin=>30, xmax=>28, ymax=>48, filled=>1),
 ok($img->box(color=>$red, xmin=>30, ymin=>30, xmax=>48, ymax=>48, filled=>1),
    "filled box with color");
 
-ok($img->arc(x=>75, 'y'=>25, r=>24, color=>$redobj),
+ok($img->arc('x'=>75, 'y'=>25, r=>24, color=>$redobj),
    "filled arc with colorobj");
 
-ok($img->arc(x=>75, 'y'=>25, r=>20, color=>$green),
+ok($img->arc('x'=>75, 'y'=>25, r=>20, color=>$green),
    "filled arc with colorobj");
-ok($img->arc(x=>75, 'y'=>25, r=>18, color=>$white, d1=>325, d2=>225),
+ok($img->arc('x'=>75, 'y'=>25, r=>18, color=>$white, d1=>325, d2=>225),
    "filled arc with color");
 
-ok($img->arc(x=>75, 'y'=>25, r=>18, color=>$blue, d1=>225, d2=>325),
+ok($img->arc('x'=>75, 'y'=>25, r=>18, color=>$blue, d1=>225, d2=>325),
    "filled arc with color");
-ok($img->arc(x=>75, 'y'=>25, r=>15, color=>$green, aa=>1),
+ok($img->arc('x'=>75, 'y'=>25, r=>15, color=>$green, aa=>1),
    "filled arc with color");
 
 ok($img->line(color=>$blueobj, x1=>5, y1=>55, x2=>35, y2=>95),
@@ -65,36 +65,36 @@ ok($img->line(color=>$green, x1=>15, y1=>55, x2=>45, y2=>95, antialias=>1),
 ok($img->polyline(points=>[ [ 55, 55 ], [ 90, 60 ], [ 95, 95] ],
                   color=>$redobj),
    "polyline points with color obj");
-ok($img->polyline(x=>[ 55, 85, 90 ], 'y'=>[60, 65, 95], color=>$green, aa=>1),
+ok($img->polyline('x'=>[ 55, 85, 90 ], 'y'=>[60, 65, 95], color=>$green, aa=>1),
    "polyline xy with color aa");
-ok($img->polyline(x=>[ 55, 80, 85 ], 'y'=>[65, 70, 95], color=>$green, 
+ok($img->polyline('x'=>[ 55, 80, 85 ], 'y'=>[65, 70, 95], color=>$green, 
                   antialias=>1),
    "polyline xy with color antialias");
 
-ok($img->setpixel(x=>[35, 37, 39], 'y'=>[55, 57, 59], color=>$red),
+ok($img->setpixel('x'=>[35, 37, 39], 'y'=>[55, 57, 59], color=>$red),
    "set array of pixels");
-ok($img->setpixel(x=>39, 'y'=>55, color=>$green),
+ok($img->setpixel('x'=>39, 'y'=>55, color=>$green),
    "set single pixel");
 use Imager::Color::Float;
 my $flred = Imager::Color::Float->new(1, 0, 0, 0);
 my $flgreen = Imager::Color::Float->new(0, 1, 0, 0);
-ok($img->setpixel(x=>[41, 43, 45], 'y'=>[55, 57, 59], color=>$flred),
+ok($img->setpixel('x'=>[41, 43, 45], 'y'=>[55, 57, 59], color=>$flred),
    "set array of float pixels");
-ok($img->setpixel(x=>45, 'y'=>55, color=>$flgreen),
+ok($img->setpixel('x'=>45, 'y'=>55, color=>$flgreen),
    "set single float pixel");
-my @gp = $img->getpixel(x=>[41, 43, 45], 'y'=>[55, 57, 59]);
+my @gp = $img->getpixel('x'=>[41, 43, 45], 'y'=>[55, 57, 59]);
 ok(grep($_->isa('Imager::Color'), @gp) == 3, "check getpixel result type");
 ok(grep(color_cmp($_, NC(255, 0, 0)) == 0, @gp) == 3, 
    "check getpixel result colors");
-my $gp = $img->getpixel(x=>45, 'y'=>55);
+my $gp = $img->getpixel('x'=>45, 'y'=>55);
 ok($gp->isa('Imager::Color'), "check scalar getpixel type");
 ok(color_cmp($gp, NC(0, 255, 0)) == 0, "check scalar getpixel color");
-@gp = $img->getpixel(x=>[35, 37, 39], 'y'=>[55, 57, 59], type=>'float');
+@gp = $img->getpixel('x'=>[35, 37, 39], 'y'=>[55, 57, 59], type=>'float');
 ok(grep($_->isa('Imager::Color::Float'), @gp) == 3, 
    "check getpixel float result type");
 ok(grep(color_cmp($_, $flred) == 0, @gp) == 3,
    "check getpixel float result type");
-$gp = $img->getpixel(x=>39, 'y'=>55, type=>'float');
+$gp = $img->getpixel('x'=>39, 'y'=>55, type=>'float');
 ok($gp->isa('Imager::Color::Float'), "check scalar float getpixel type");
 ok(color_cmp($gp, $flgreen) == 0, "check scalar float getpixel color");