From 35c731ecf369e0dcd6ebcefbda1460276a029a75 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 29 Jun 2019 19:59:35 -0400 Subject: Prefer single quotes --- diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon index b06d22a..6979330 100755 --- a/bin/bdf2fbcon +++ b/bin/bdf2fbcon @@ -26,7 +26,7 @@ sub warning { my ($fmt, @args) = @_; - STDERR->printf("bdf2fbcon: Warning: " . $fmt . "\n", @args); + STDERR->printf('bdf2fbcon: Warning: ' . $fmt . "\n", @args); return; } @@ -35,7 +35,7 @@ sub error { my ($fmt, @args) = @_; - STDERR->printf("bdf2fbcon: Error: " . $fmt . "\n", @args); + STDERR->printf('bdf2fbcon: Error: ' . $fmt . "\n", @args); return; } @@ -165,7 +165,7 @@ sub parse_bdf_2_1 } } - warning("Missing end of font") unless ($found_end); + warning('Missing end of font') unless ($found_end); return 1; } @@ -193,11 +193,11 @@ sub write_fbcon if (not defined ($output)) { $output = 'font_' . $font->{'id'} . '.c'; } - if ($output eq "-") { + if ($output eq '-') { $output_fh = *STDOUT; } else { - if (not open($output_fh, ">", $output . "~")) { - error("%s: %s", $output . "~", $!); + if (not open($output_fh, '>', $output . '~')) { + error('%s: %s', $output . '~', $!); return; } } @@ -209,7 +209,7 @@ sub write_fbcon $output_fh->printf("#include \n\n"); $output_fh->printf("#define FONTDATAMAX %d\n\n", $bytes_x * $font->{'height'} * 256); - $output_fh->printf("static const unsigned char" . + $output_fh->printf('static const unsigned char' . " fontdata_%s[FONTDATAMAX] = {\n", $font->{'id'}); @@ -224,10 +224,10 @@ sub write_fbcon $shifted_bitmap = $bitmap; $shifted_bitmap <<= $bytes_x * 8 - $font->{'width'}; foreach my $k (reverse(0 .. ($bytes_x - 1))) { - $output_fh->printf("0x%02x, ", + $output_fh->printf('0x%02x, ', ($shifted_bitmap >> ($k * 8)) & 0xFF); } - $output_fh->printf("/* %0" . $font->{'width'} . "b */\n", + $output_fh->printf('/* %0' . $font->{'width'} . "b */\n", $bitmap); } } @@ -243,10 +243,10 @@ sub write_fbcon $output_fh->printf("\t.pref\t= %d,\n", $font->{'pref'}); $output_fh->printf("};\n"); - if ($output ne "-") { + if ($output ne '-') { close($output_fh); - if (not rename($output . "~", $output)) { - error("%s: %s", $output, $!); + if (not rename($output . '~', $output)) { + error('%s: %s', $output, $!); return; } } @@ -261,15 +261,15 @@ sub convert my $line; my $font; - if ($input eq $output and $input ne "-") { - warning("Input and output files are equal"); + if ($input eq $output and $input ne '-') { + warning('Input and output files are equal'); } - if ($input eq "-") { + if ($input eq '-') { $input_fh = *STDIN; } else { - if (not open($input_fh, "<", $input)) { - error("%s: %s", $input, $!); + if (not open($input_fh, '<', $input)) { + error('%s: %s', $input, $!); return; } } @@ -279,11 +279,11 @@ sub convert if ($line =~ m/^STARTFONT 2.[12]$/) { parse_bdf_2_1($input_fh, $font); } else { - error("Unsupported input format"); + error('Unsupported input format'); return; } - if ($input ne "-") { + if ($input ne '-') { close($input_fh); } @@ -339,15 +339,15 @@ sub main my %opts; my %convert_opts; - Getopt::Long::Configure("no_ignore_case", "bundling", "gnu_compat", - "no_getopt_compat"); + Getopt::Long::Configure('no_ignore_case', 'bundling', 'gnu_compat', + 'no_getopt_compat'); if (not GetOptions(\%opts, - "o=s", - "n=s", - "s=s", - "p=s", - "h|help", - "V|version", + 'o=s', + 'n=s', + 's=s', + 'p=s', + 'h|help', + 'V|version', )) { usage(*STDERR); return 4; -- cgit v0.9.1