diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index b5488b2d..3bbfc556 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 648, + BUILD_REVISION => 649, BUILD_DATE => "2014-06-17", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index f9c1d488..6700be42 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -716,7 +716,7 @@ declaration: if($first_qualifier) { if(@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { $return .= $first_qualifier =~ m/^[aeiouy]/ ? 'an ' : 'a '; - } else { + } elsif(@identifiers > 1) { $first_qualifier =~ s/pointer/pointers/; } $return .= "$first_qualifier $item{declaration_specifiers} "; @@ -754,7 +754,7 @@ declaration: if($first_qualifier) { if(@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { $return .= $first_qualifier =~ m/^[aeiouy]/ ? 'an ' : 'a '; - } else { + } elsif(@identifiers > 1) { $first_qualifier =~ s/pointer/pointers/; } $return .= "$first_qualifier $item{declaration_specifiers}"; @@ -1100,9 +1100,14 @@ array_declarator: ( '[' assignment_expression(?) ']' { if (@{$item{'assignment_expression(?)'}}) { - $return = 'size '. join('',@{$item{'assignment_expression(?)'}}) . ' '; + my $size = join('', @{$item{'assignment_expression(?)'}}); + if($size =~ /^(unsigned|long)*\s*1$/) { + $return = "$size element "; + } else { + $return = "$size elements "; + } } else { - $return = 'unspecified size '; + $return = 'unspecified length '; } } )(s?)