From ab2d404f205a4b86a1f88a1a4b6ed41bba21fc36 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Fri, 18 Mar 2011 14:06:22 -0600 Subject: [PATCH] Removing more return 0's. --- bin/auto | 3 ++- lib/API/Std.pm | 4 ++-- lib/Core/Cmd.pm | 18 +++++++++--------- lib/Parser/Config.pm | 14 +++++++------- lib/Parser/Lang.pm | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/bin/auto b/bin/auto index fb57960..916d087 100755 --- a/bin/auto +++ b/bin/auto @@ -77,6 +77,7 @@ use API::Log qw(alog dbug); use Parser::Config; use Parser::Lang; use Proto::IRC; +use State::IRC; use Core::IRC; use Core::IRC::Users; use Core::Cmd; @@ -562,7 +563,7 @@ sub socksnd { return 1; } else { - return 0; + return; } } diff --git a/lib/API/Std.pm b/lib/API/Std.pm index deaf856..3ef0bdc 100644 --- a/lib/API/Std.pm +++ b/lib/API/Std.pm @@ -432,9 +432,9 @@ sub ratelimit_check { return 1; } else { - # Increment their uses and return 0. + # Increment their uses and return false. $Core::IRC::usercmd{$src{nick}.'@'.$src{host}.'/'.$src{svr}}++; - return 0; + return; } } else { diff --git a/lib/Core/Cmd.pm b/lib/Core/Cmd.pm index 8918997..b9493c7 100644 --- a/lib/Core/Cmd.pm +++ b/lib/Core/Cmd.pm @@ -21,13 +21,13 @@ sub cmd_modload # Check for the needed parameters. if (!defined $argv[0]) { notice($src->{svr}, $src->{nick}, trans("Not enough parameters")."."); - return 0; + return; } # Check if the module is already loaded. if (API::Std::mod_exists($argv[0])) { notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 is already loaded."); - return 0; + return; } # Go for it! @@ -41,7 +41,7 @@ sub cmd_modload else { # We weren't. notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 failed to load."); - return 0; + return; } return 1; @@ -59,13 +59,13 @@ sub cmd_modunload # Check for the needed parameters. if (!defined $argv[0]) { notice($src->{svr}, $src->{nick}, trans("Not enough parameters")."."); - return 0; + return; } # Check if the module exists. if (!API::Std::mod_exists($argv[0])) { notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 is not loaded."); - return 0; + return; } # Go for it! @@ -79,7 +79,7 @@ sub cmd_modunload else { # We weren't. notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 failed to unload."); - return 0; + return; } return 1; @@ -97,13 +97,13 @@ sub cmd_modreload # Check for the needed parameters. if (!defined $argv[0]) { notice($src->{svr}, $src->{nick}, trans("Not enough parameters")."."); - return 0; + return; } # Check if the module exists. if (!API::Std::mod_exists($argv[0])) { notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 is not loaded."); - return 0; + return; } # Go for it! @@ -119,7 +119,7 @@ sub cmd_modreload else { # We weren't. notice($src->{svr}, $src->{nick}, "Module \002".$argv[0]."\002 failed to reload."); - return 0; + return; } return 1; diff --git a/lib/Parser/Config.pm b/lib/Parser/Config.pm index 3c3ed48..6ad7cad 100644 --- a/lib/Parser/Config.pm +++ b/lib/Parser/Config.pm @@ -14,13 +14,13 @@ sub new # Check to see if the configuration file exists. if (!-e "$Auto::bin{etc}/$file") { - return 0; + return; } # Open, read and close the config. - open(my $FCONF, q{<}, "$Auto::bin{etc}/$file") or return 0; - my @cosfl = <$FCONF> or return 0; - close $FCONF or return 0; + open(my $FCONF, q{<}, "$Auto::bin{etc}/$file") or return; + my @cosfl = <$FCONF> or return; + close $FCONF or return; # Save it to self variable. $self->{'config'}->{'path'} = "$Auto::bin{etc}/$file"; @@ -38,9 +38,9 @@ sub parse my (%rs); # Open, read and close it. - open(my $FCONF, q{<}, "$file") or return 0; - my @fbuf = <$FCONF> or return 0; - close $FCONF or return 0; + open(my $FCONF, q{<}, "$file") or return; + my @fbuf = <$FCONF> or return; + close $FCONF or return; # Iterate the file. foreach my $buff (@fbuf) { diff --git a/lib/Parser/Lang.pm b/lib/Parser/Lang.pm index 02508e3..4246021 100644 --- a/lib/Parser/Lang.pm +++ b/lib/Parser/Lang.pm @@ -21,7 +21,7 @@ sub parse } # Open, read and close the file. - open(my $FALF, '<', "$Auto::bin{lng}/$lang.alf") or return 0; + open(my $FALF, '<', "$Auto::bin{lng}/$lang.alf") or return; my @fbuf = <$FALF>; close $FALF;