summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-04-22 21:59:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-04-22 21:59:30 +0000
commitdad25588ed26afe49277032b8b1b24b063e34efa (patch)
treeed2e1f85e3e34ab626550ef27e3a858fa57d308a /perl-install/Xconfig
parente70327417f8ce3bd2a03c7da1fd46ea2a8e8e4b0 (diff)
downloaddrakx-dad25588ed26afe49277032b8b1b24b063e34efa.tar
drakx-dad25588ed26afe49277032b8b1b24b063e34efa.tar.gz
drakx-dad25588ed26afe49277032b8b1b24b063e34efa.tar.bz2
drakx-dad25588ed26afe49277032b8b1b24b063e34efa.tar.xz
drakx-dad25588ed26afe49277032b8b1b24b063e34efa.zip
perl_checker compliance for optional method arguments
Diffstat (limited to 'perl-install/Xconfig')
-rw-r--r--perl-install/Xconfig/xfree.pm14
-rw-r--r--perl-install/Xconfig/xfree3.pm6
-rw-r--r--perl-install/Xconfig/xfreeX.pm16
3 files changed, 17 insertions, 19 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index 9a44749ae..8df42bd8a 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -10,17 +10,15 @@ use Xconfig::xfree4;
use log;
-#- files are optional
sub read {
- my ($class, $xfree3_file, $xfree4_file) = @_;
- bless { xfree3 => eval { Xconfig::xfree3->read($xfree3_file) } || [],
- xfree4 => eval { Xconfig::xfree4->read($xfree4_file) } || [] }, $class;
+ my ($class, $o_xfree3_file, $o_xfree4_file) = @_;
+ bless { xfree3 => eval { Xconfig::xfree3->read($o_xfree3_file) } || [],
+ xfree4 => eval { Xconfig::xfree4->read($o_xfree4_file) } || [] }, $class;
}
-#- files are optional
sub write {
- my ($both, $xfree3_file, $xfree4_file) = @_;
- $both->{xfree3} ? $both->{xfree3}->write($xfree3_file) : unlink($xfree3_file);
- $both->{xfree4} ? $both->{xfree4}->write($xfree4_file) : unlink($xfree4_file);
+ my ($both, $o_xfree3_file, $o_xfree4_file) = @_;
+ $both->{xfree3} ? $both->{xfree3}->write($o_xfree3_file) : unlink($o_xfree3_file);
+ $both->{xfree4} ? $both->{xfree4}->write($o_xfree4_file) : unlink($o_xfree4_file);
}
sub empty_config {
diff --git a/perl-install/Xconfig/xfree3.pm b/perl-install/Xconfig/xfree3.pm
index 8d6ce63da..450ce3461 100644
--- a/perl-install/Xconfig/xfree3.pm
+++ b/perl-install/Xconfig/xfree3.pm
@@ -102,11 +102,11 @@ sub new_device_sections {
}
sub is_fbdev {
- my ($raw_X, $Screen) = @_;
+ my ($raw_X, $o_Screen) = @_;
- my $Screen_ = $Screen || $raw_X->get_default_screen or return;
+ my $Screen = $o_Screen || $raw_X->get_default_screen or return;
- val($Screen_->{Server}) eq 'FBDev';
+ val($Screen->{Server}) eq 'FBDev';
}
sub set_Option {}
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index e8d5f33f4..7f79f19f9 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -15,14 +15,14 @@ sub empty_config {
}
sub read {
- my ($class, $file) = @_;
- $file ||= ($::prefix || '') . (bless {}, $class)->config_file;
+ my ($class, $o_file) = @_;
+ my $file = $o_file || ($::prefix || '') . (bless {}, $class)->config_file;
my $raw_X = Xconfig::parse::read_XF86Config($file);
bless $raw_X, $class;
}
sub write {
- my ($raw_X, $file) = @_;
- $file ||= ($::prefix || '') . $raw_X->config_file;
+ my ($raw_X, $o_file) = @_;
+ my $file = $o_file || ($::prefix || '') . $raw_X->config_file;
rename $file, "$file.old";
Xconfig::parse::write_XF86Config($raw_X, $file);
}
@@ -167,8 +167,8 @@ sub set_load_module {
}
sub get_resolution {
- my ($raw_X, $Screen) = @_;
- $Screen ||= $raw_X->get_default_screen or return {};
+ my ($raw_X, $o_Screen) = @_;
+ my $Screen = $o_Screen || $raw_X->get_default_screen or return {};
my $depth = val($Screen->{DefaultColorDepth});
my $Display = find { !$depth || val($_->{l}{Depth}) eq $depth } @{$Screen->{Display} || []} or return {};
@@ -177,9 +177,9 @@ sub get_resolution {
}
sub set_resolution {
- my ($raw_X, $resolution, $Screen_) = @_;
+ my ($raw_X, $resolution, $o_Screen_) = @_;
- foreach my $Screen ($Screen_ ? $Screen_ : $raw_X->get_screens) {
+ foreach my $Screen ($o_Screen_ ? $o_Screen_ : $raw_X->get_screens) {
$Screen ||= $raw_X->get_default_screen or internal_error('no screen');
$Screen->{DefaultColorDepth} = { val => $resolution->{Depth} };