From 8a8166bdb84124807998f4d2e2a30d2f2a23242f Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Fri, 18 Mar 2011 14:05:10 -0600 Subject: [PATCH] Removing return 0's as it's improper. --- modules/Badwords.pm | 2 +- modules/Bitly.pm | 14 +++++++------- modules/Calc.pm | 6 +++--- modules/EightBall.pm | 8 ++++---- modules/FML.pm | 4 ++-- modules/HelloChan.pm | 4 ++-- modules/IsItUp.pm | 6 +++--- modules/Oper.pm | 14 +++++++------- modules/Weather.pm | 6 +++--- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/Badwords.pm b/modules/Badwords.pm index dc9ac65..c8347fd 100644 --- a/modules/Badwords.pm +++ b/modules/Badwords.pm @@ -27,7 +27,7 @@ sub _init sub _void { # Delete the act_on_badword hook. - hook_del('act_on_badword') or return 0; + hook_del('act_on_badword') or return; # Success. return 1; diff --git a/modules/Bitly.pm b/modules/Bitly.pm index 30ad101..a04b525 100644 --- a/modules/Bitly.pm +++ b/modules/Bitly.pm @@ -15,11 +15,11 @@ sub _init # Check for required configuration values. if (!(conf_get('bitly:user'))[0][0] or !(conf_get('bitly:key'))[0][0]) { err(2, 'Please verify that you have bitly_user and bitly_key defined in your configuration file.', 0); - return 0; + return; } # Create the SHORTEN and REVERSE commands. - cmd_add('SHORTEN', 0, 0, \%M::Bitly::HELP_SHORTEN, \&M::Bitly::shorten) or return 0; - cmd_add('REVERSE', 0, 0, \%M::Bitly::HELP_REVERSE, \&M::Bitly::reverse) or return 0; + cmd_add('SHORTEN', 0, 0, \%M::Bitly::HELP_SHORTEN, \&M::Bitly::shorten) or return; + cmd_add('REVERSE', 0, 0, \%M::Bitly::HELP_REVERSE, \&M::Bitly::reverse) or return; # Success. return 1; @@ -29,8 +29,8 @@ sub _init sub _void { # Delete the SHORTEN and REVERSE commands. - cmd_del('SHORTEN') or return 0; - cmd_del('REVERSE') or return 0; + cmd_del('SHORTEN') or return; + cmd_del('REVERSE') or return; # Success. return 1; @@ -57,7 +57,7 @@ sub shorten # Put together the call to the Bit.ly API. if (!defined $args[0]) { notice($src->{svr}, $src->{nick}, trans('Not enough parameters')."."); - return 0; + return; } my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]); $surl = uri_escape($surl); @@ -93,7 +93,7 @@ sub reverse # Put together the call to the Bit.ly API. if (!defined $args[0]) { notice($src->{svr}, $src->{nick}, trans('Not enough parameters')."."); - return 0; + return; } my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]); $surl = uri_escape($surl); diff --git a/modules/Calc.pm b/modules/Calc.pm index 3b6ef16..2e28787 100644 --- a/modules/Calc.pm +++ b/modules/Calc.pm @@ -14,7 +14,7 @@ use JSON -support_by_pp; sub _init { # Create the CALC command. - cmd_add("CALC", 0, 0, \%M::Calc::HELP_CALC, \&M::Calc::calc) or return 0; + cmd_add("CALC", 0, 0, \%M::Calc::HELP_CALC, \&M::Calc::calc) or return; # Success. return 1; @@ -24,7 +24,7 @@ sub _init sub _void { # Delete the CALC command. - cmd_del("CALC") or return 0; + cmd_del("CALC") or return; # Success. return 1; @@ -49,7 +49,7 @@ sub calc # Put together the call to the Google Calculator API. if (!defined $args[0]) { notice($src->{svr}, $src->{nick}, trans("Not enough parameters")."."); - return 0; + return; } my $expr = join(' ', @args); my $url = "http://www.google.com/ig/calculator?q=".uri_escape($expr); diff --git a/modules/EightBall.pm b/modules/EightBall.pm index 0503e69..7aa6dff 100644 --- a/modules/EightBall.pm +++ b/modules/EightBall.pm @@ -26,8 +26,8 @@ my @responses = ( # Initialization subroutine. sub _init { # Create the 8BALL and RIGBALL commands. - cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0; - cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return 0; + cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return; + cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return; # Success. return 1; @@ -36,8 +36,8 @@ sub _init { # Void subroutine. sub _void { # Delete the 8BALL and RIGBALL commands. - cmd_del('8BALL') or return 0; - cmd_del('RIGBALL') or return 0; + cmd_del('8BALL') or return; + cmd_del('RIGBALL') or return; # Success. return 1; diff --git a/modules/FML.pm b/modules/FML.pm index 8b2631c..f77ea22 100644 --- a/modules/FML.pm +++ b/modules/FML.pm @@ -12,7 +12,7 @@ use LWP::UserAgent; sub _init { # Create the FML command. - cmd_add('FML', 0, 0, \%M::FML::HELP_FML, \&M::FML::fml) or return 0; + cmd_add('FML', 0, 0, \%M::FML::HELP_FML, \&M::FML::fml) or return; # Success. return 1; @@ -22,7 +22,7 @@ sub _init sub _void { # Delete the FML command. - cmd_del('FML') or return 0; + cmd_del('FML') or return; # Success. return 1; diff --git a/modules/HelloChan.pm b/modules/HelloChan.pm index 1e66aee..ea8886d 100644 --- a/modules/HelloChan.pm +++ b/modules/HelloChan.pm @@ -11,7 +11,7 @@ use API::IRC qw(privmsg); sub _init { # Add a hook for when we join a channel. - hook_add('on_ucjoin', 'HelloChan', \&M::HelloChan::hello) or return 0; + hook_add('on_ucjoin', 'HelloChan', \&M::HelloChan::hello) or return; return 1; } @@ -19,7 +19,7 @@ sub _init sub _void { # Delete the hook. - hook_del('on_ucjoin', 'HelloChan') or return 0; + hook_del('on_ucjoin', 'HelloChan') or return; return 1; } diff --git a/modules/IsItUp.pm b/modules/IsItUp.pm index 184a69f..0b9a6f4 100644 --- a/modules/IsItUp.pm +++ b/modules/IsItUp.pm @@ -12,7 +12,7 @@ use LWP::UserAgent; sub _init { # Create the ISITUP command. - cmd_add('ISITUP', 0, 0, \%M::IsItUp::HELP_ISITUP, \&M::IsItUp::check) or return 0; + cmd_add('ISITUP', 0, 0, \%M::IsItUp::HELP_ISITUP, \&M::IsItUp::check) or return; # Success. return 1; @@ -22,7 +22,7 @@ sub _init sub _void { # Delete the ISITUP command. - cmd_del('ISITUP') or return 0; + cmd_del('ISITUP') or return; # Success. return 1; @@ -45,7 +45,7 @@ sub check # Do we have enough parameters? if (!defined $argv[0]) { notice($src->{svr}, $src->{nick}, trans('Not enough parameters').q{.}); - return 0; + return; } my $curl = $argv[0]; # Does the URL start with http(s)? diff --git a/modules/Oper.pm b/modules/Oper.pm index 95b2971..dfbf165 100644 --- a/modules/Oper.pm +++ b/modules/Oper.pm @@ -11,9 +11,9 @@ use API::Log qw(alog); sub _init { # Add a hook for when we join a channel. - hook_add('on_connect', 'Oper.onconnect', \&M::Oper::on_connect) or return 0; + hook_add('on_connect', 'Oper.onconnect', \&M::Oper::on_connect) or return; # Add a hook for when we get numeric 491 (ERR_NOOPERHOST) - rchook_add('491', 'Oper.on381', \&M::Oper::on_num491) or return 0; + rchook_add('491', 'Oper.on381', \&M::Oper::on_num491) or return; return 1; } @@ -21,10 +21,10 @@ sub _init sub _void { # Delete the hooks. - hook_del('on_connect', 'Oper.onconnect') or return 0; - rchook_del('381', 'Oper.on381') or return 0; - rchook_del('313', 'Oper.on313') or return 0; - rchook_del('491', 'Oper.on491') or return 0; + hook_del('on_connect', 'Oper.onconnect') or return; + rchook_del('381', 'Oper.on381') or return; + rchook_del('313', 'Oper.on313') or return; + rchook_del('491', 'Oper.on491') or return; return 1; } @@ -55,7 +55,7 @@ sub on_num491 { sub is_opered { my ($svr) = @_; # Auto is not opered. - return 0 if $Proto::IRC::botinfo{$svr}{modes} !~ m/o/xsm; + return if $Proto::IRC::botinfo{$svr}{modes} !~ m/o/xsm; # Auto is opered. return 1 if $Proto::IRC::botinfo{$svr}{modes} =~ m/o/xsm; return; diff --git a/modules/Weather.pm b/modules/Weather.pm index e4240db..09ee1f6 100644 --- a/modules/Weather.pm +++ b/modules/Weather.pm @@ -13,7 +13,7 @@ use XML::Simple; sub _init { # Create the Weather command. - cmd_add('WEATHER', 0, 0, \%M::Weather::HELP_WEATHER, \&M::Weather::weather) or return 0; + cmd_add('WEATHER', 0, 0, \%M::Weather::HELP_WEATHER, \&M::Weather::weather) or return; # Success. return 1; @@ -23,7 +23,7 @@ sub _init sub _void { # Delete the Weather command. - cmd_del('WEATHER') or return 0; + cmd_del('WEATHER') or return; # Success. return 1; @@ -46,7 +46,7 @@ sub weather # Put together the call to the Wunderground API. if (!defined $args[0]) { notice($src->{svr}, $src->{nick}, trans('Not enough parameters')."."); - return 0; + return; } my $loc = join(' ', @args); $loc =~ s/ /%20/g;