[syslinux:master] ppmtolss16: remove obsolete Perl construct

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon Apr 25 12:24:45 PDT 2011


Commit-ID:  5450db41bb3f3a5c291caf4042d226b349821d2b
Gitweb:     http://syslinux.zytor.com/commit/5450db41bb3f3a5c291caf4042d226b349821d2b
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 25 Apr 2011 12:22:21 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 25 Apr 2011 12:22:21 -0700

ppmtolss16: remove obsolete Perl construct

defined() on an array is considered obsolete; instead check for a
nonzero number of elements with scalar().

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 utils/ppmtolss16 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils/ppmtolss16 b/utils/ppmtolss16
index 5af9083..ae2d546 100755
--- a/utils/ppmtolss16
+++ b/utils/ppmtolss16
@@ -229,7 +229,7 @@ for ( $y = 0 ; $y < $ysize ; $y++ ) {
     start_new_row();
     for ( $x = 0 ; $x < $xsize ; $x++ ) {
 	die "$0: Premature EOF at ($x,$y) of ($xsize,$ysize)\n"
-	    if ( !defined(@pnmrgb = getrgb($form)) );
+	    if ( !scalar(@pnmrgb = getrgb($form)) );
 	# Convert to 6-bit representation
 	$rgb = rgbconvert($pnmrgb[0], $pnmrgb[1], $pnmrgb[2], $maxmult);
 	$color_count{$rgb}++;



More information about the Syslinux-commits mailing list