1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r20625: Fix couple of warnings.

(This used to be commit 203076129b)
This commit is contained in:
Jelmer Vernooij 2007-01-09 06:02:41 +00:00 committed by Gerald (Jerry) Carter
parent e0e96ae80d
commit cfa230c480
6 changed files with 234 additions and 222 deletions

View File

@ -110,7 +110,11 @@ sub _Dereference($$)
sub _Error($)
{
my ($self) = @_;
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."' near `". $self->YYData->{LAST_TOKEN} . "'");
if (defined($self->YYData->{LAST_TOKEN})) {
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."' near `". $self->YYData->{LAST_TOKEN} . "'");
} else {
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."'");
}
}
sub Run {

View File

@ -179,7 +179,7 @@ typedecl: usertype ';' { $_[1] };
sign: 'signed' | 'unsigned';
existingtype:
| sign identifier { "$_[1] $_[2]" }
sign identifier { ($_[1]?$_[1]:"signed") ." $_[2]" }
| identifier
;

View File

@ -1349,7 +1349,11 @@ sub _Dereference($$)
sub _Error($)
{
my ($self) = @_;
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."' near `". $self->YYData->{LAST_TOKEN} . "'");
if (defined($self->YYData->{LAST_TOKEN})) {
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."' near `". $self->YYData->{LAST_TOKEN} . "'");
} else {
$self->YYData->{ERROR}->("Parse error in `".$self->YYData->{FULL_INPUT}."'");
}
}
sub Run {

File diff suppressed because it is too large Load Diff

View File

@ -18,14 +18,22 @@ my $warnings = "";
undef &Parse::Pidl::warning;
*Parse::Pidl::warning = sub {
my ($e, $l) = @_;
$warnings .= "$e->{FILE}:$e->{LINE}: $l\n";
if (defined($e)) {
$warnings .= "$e->{FILE}:$e->{LINE}: $l\n";
} else {
$warnings .= "$l\n";
}
};
my $errors = "";
undef &Parse::Pidl::error;
*Parse::Pidl::error = sub {
my ($e, $l) = @_;
$errors .= "$e->{FILE}:$e->{LINE}: $l\n";
if (defined($e)) {
$errors .= "$e->{FILE}:$e->{LINE}: $l\n";
} else {
$errors .= "$l\n";
}
};
use Test::More;

View File

@ -2,6 +2,7 @@
# (C) 2007 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU General Public License
use strict;
use warnings;
use Test::More tests => 56;
use FindBin qw($RealBin);