From dba96c0383699d3382b8d8234ad0af4395b1d36b Mon Sep 17 00:00:00 2001 From: Tobias Leich Date: Sat, 11 Sep 2010 16:39:20 +0200 Subject: [PATCH] fixed namespace for Carp::cluck --- Build.PL | 2 +- examples/GFX/script_roto.pl | 10 +++++----- examples/SDLx/SDLx_controller_two_squares.pl | 4 ++-- examples/SDLx/pong.pl | 4 ++-- examples/pixel_operations/sols/ch02.pl | 4 ++-- inc/My/Builder.pm | 2 +- t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm | 10 +++++----- t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm | 6 +++--- t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm | 8 ++++---- t_backcompat/Timer.pm | 4 ++-- t_backcompat/loopwave.pl | 8 ++++---- t_backcompat/testsprite.pl | 2 +- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Build.PL b/Build.PL index 6e02f593..cc177262 100644 --- a/Build.PL +++ b/Build.PL @@ -32,7 +32,7 @@ my %platforms = ( ); my $package = 'My::Builder::' . ( $platforms{$^O} || 'Unix' ); print "Gonna use '$package' class ...\n"; -eval "require $package" or confess "Require '$package' failed: $@\n"; +eval "require $package" or Carp::confess "Require '$package' failed: $@\n"; ### subsystems to build # diff --git a/examples/GFX/script_roto.pl b/examples/GFX/script_roto.pl index 52183259..000dad75 100644 --- a/examples/GFX/script_roto.pl +++ b/examples/GFX/script_roto.pl @@ -16,7 +16,7 @@ SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel ); -confess SDL::get_error if !$display; +Carp::confess SDL::get_error if !$display; my $src = SDL::Video::load_BMP('test/data/picture.bmp'); my $temp_surf; @@ -43,20 +43,20 @@ sub draw { foreach ( 1 .. 360 ) { $temp_surf = SDL::GFX::Rotozoom::surface( $src, $_, $_ / 180, 1 ); - confess SDL::get_error if !$temp_surf; + Carp::confess SDL::get_error if !$temp_surf; draw( $temp_surf, 2 ); } $temp_surf = SDL::GFX::Rotozoom::surface_xy( $src, 1, 1, 1, 1 ); -confess SDL::get_error if !$temp_surf; +Carp::confess SDL::get_error if !$temp_surf; draw( $temp_surf, 1000 ); $temp_surf = SDL::GFX::Rotozoom::zoom_surface( $src, 1, 1, 1 ); -confess SDL::get_error if !$temp_surf; +Carp::confess SDL::get_error if !$temp_surf; draw( $temp_surf, 1000 ); $temp_surf = SDL::GFX::Rotozoom::shrink_surface( $src, 1, 1 ); -confess SDL::get_error if !$temp_surf; +Carp::confess SDL::get_error if !$temp_surf; draw( $temp_surf, 1000 ); SDL::delay(1000); diff --git a/examples/SDLx/SDLx_controller_two_squares.pl b/examples/SDLx/SDLx_controller_two_squares.pl index 6f5958fa..69f88608 100644 --- a/examples/SDLx/SDLx_controller_two_squares.pl +++ b/examples/SDLx/SDLx_controller_two_squares.pl @@ -42,7 +42,7 @@ sub init { # Initing video # Die here if we cannot make video init - confess 'Cannot init ' . SDL::get_error() + Carp::confess 'Cannot init ' . SDL::get_error() if ( SDL::init(SDL_INIT_VIDEO) == -1 ); # Create our display window @@ -52,7 +52,7 @@ sub init { SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL ); - confess 'Cannot init video mode 800x600x32: ' . SDL::get_error() + Carp::confess 'Cannot init video mode 800x600x32: ' . SDL::get_error() unless $a; return $a; diff --git a/examples/SDLx/pong.pl b/examples/SDLx/pong.pl index 8b4653c4..f5cff05b 100644 --- a/examples/SDLx/pong.pl +++ b/examples/SDLx/pong.pl @@ -71,7 +71,7 @@ sub init { # Initing video # Die here if we cannot make video init - confess 'Cannot init ' . SDL::get_error() + Carp::confess 'Cannot init ' . SDL::get_error() if ( SDL::init(SDL_INIT_VIDEO) == -1 ); # Create our display window @@ -81,7 +81,7 @@ sub init { SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL ); - confess 'Cannot init video mode 800x600x32: ' . SDL::get_error() + Carp::confess 'Cannot init video mode 800x600x32: ' . SDL::get_error() unless $a; return $a; diff --git a/examples/pixel_operations/sols/ch02.pl b/examples/pixel_operations/sols/ch02.pl index 7e04e302..17f4cf19 100644 --- a/examples/pixel_operations/sols/ch02.pl +++ b/examples/pixel_operations/sols/ch02.pl @@ -44,12 +44,12 @@ sub render { } sub main { - cluck 'Unable to init SDL: ' . SDL::get_error() + Carp::cluck 'Unable to init SDL: ' . SDL::get_error() if ( SDL::init(SDL_INIT_VIDEO) < 0 ); $screen = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE ); - cluck 'Unable to set 640x480x32 video' . SDL::get_error() if ( !$screen ); + Carp::cluck 'Unable to set 640x480x32 video' . SDL::get_error() if ( !$screen ); while (1) { diff --git a/inc/My/Builder.pm b/inc/My/Builder.pm index 58c16a9a..fa901bea 100644 --- a/inc/My/Builder.pm +++ b/inc/My/Builder.pm @@ -65,7 +65,7 @@ sub find_subsystems { my $param; for my $library ( @{ $subsystem->{libraries} } ) { my $lib = $libraries->{$library} - or confess "Unknown library '$library' for '$name'\n"; + or Carp::confess "Unknown library '$library' for '$name'\n"; my $h = ref( $lib->{header} ) eq 'ARRAY' ? $lib->{header} diff --git a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm index dcaf509a..57fce4ed 100644 --- a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm +++ b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm @@ -28,7 +28,7 @@ my $tile_size = 10; my $path = module_file( 'SDL::Tutorial::MoP', 'data/tiles.bmp' ); my $tiles = SDL::Video::load_BMP($path); -confess 'Error: ' . SDL::get_error() if ( !$tiles ); +Carp::confess 'Error: ' . SDL::get_error() if ( !$tiles ); my $map_surface; # the image(s) of the current map are here my $is_up_to_date = 0; @@ -49,7 +49,7 @@ sub new { sub init { my ( $self, %params ) = @_; - $self->load_map() || cluck("load_map() failed"); + $self->load_map() || Carp::cluck("load_map() failed"); $self->x(0); $self->y(0); $self->w( $self->surface()->w() ); @@ -61,7 +61,7 @@ sub init { sub notify { my ( $self, $event ) = (@_); - print cluck( sprintf( "Notify '%s'in Map", $event->{name} ) ) + print Carp::cluck( sprintf( "Notify '%s'in Map", $event->{name} ) ) if $self->{EDEBUG}; my %event_action = ( @@ -94,7 +94,7 @@ sub load_map { $_surface = undef; return 1; } else { - cluck("Could not load bitmap $_path."); + Carp::cluck("Could not load bitmap $_path."); return -1; } } @@ -111,7 +111,7 @@ sub get_tile_by_index { my $self = shift; my $index = shift || 0; - cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles ); + Carp::cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles ); my $x = ( $index * $tile_size ) % $tiles->w; my $y = int( ( $index * $tile_size ) / $tiles->w ) * $tile_size; diff --git a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm index 6f9efd54..8fb408a6 100644 --- a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm +++ b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm @@ -122,8 +122,8 @@ sub map_move { sub draw_map { my $self = shift; - cluck('There is no surface to draw to') unless $self->{app}; - cluck('There are no tiles to draw') unless $map->tiles; + Carp::cluck('There is no surface to draw to') unless $self->{app}; + Carp::cluck('There are no tiles to draw') unless $map->tiles; # blitting the whole map-surface to app-surface my $srect = SDL::Rect->new( 0, 0, $map->w(), $map->h() ); #we want all of map; @@ -143,7 +143,7 @@ sub draw_scene { $self->draw_map(); - cluck('There is no surface to draw to') unless $self->{app}; + Carp::cluck('There is no surface to draw to') unless $self->{app}; $self->{count} = $self->{count} + 1; diff --git a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm index fce495fc..2e597888 100644 --- a/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm +++ b/t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm @@ -41,15 +41,15 @@ my $diff = 'MoP/../../'; $diff = '../' if ( $^O =~ /linux/ ); my $path = catpath( $volume, catfile( $dirs, $diff . 'tiles.bmp' ) ); my $tiles = SDL::Video::load_BMP($path); -confess 'Error: ' . SDL::get_error() if ( !$tiles ); +Carp::confess 'Error: ' . SDL::get_error() if ( !$tiles ); sub draw_map { - cluck 'Unable to init SDL: ' . SDL::get_error() + Carp::cluck 'Unable to init SDL: ' . SDL::get_error() if ( SDL::init(SDL_INIT_VIDEO) < 0 ); $screen = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE ); - cluck 'Unable to set 640x480x32 video ' . SDL::get_error() if ( !$screen ); + Carp::cluck 'Unable to set 640x480x32 video ' . SDL::get_error() if ( !$screen ); move_map(MOP_LEFT); @@ -92,7 +92,7 @@ sub move_map { sub get_tile { my $index = shift || 0; - cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles ); + Carp::cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles ); my $x = ( $index * $tile_size ) % $tiles->w; my $y = int( ( $index * $tile_size ) / $tiles->w ) * $tile_size; diff --git a/t_backcompat/Timer.pm b/t_backcompat/Timer.pm index e80f02b3..2a21dc30 100644 --- a/t_backcompat/Timer.pm +++ b/t_backcompat/Timer.pm @@ -42,7 +42,7 @@ sub new { my $func = shift; my (%options) = @_; - confess "SDL::Timer::new no delay specified\n" + Carp::confess "SDL::Timer::new no delay specified\n" unless ( $options{-delay} ); $$self{-delay} = $options{-delay} || $options{-d} || 0; $$self{-times} = $options{-times} || $options{-t} || 0; @@ -52,7 +52,7 @@ sub new { $$self{-routine} = sub { &$func; $$self{-delay} }; } $$self{-timer} = SDL::NewTimer( $$self{-delay}, $$self{-routine} ); - confess "Could not create timer, ", SDL::get_error(), "\n" + Carp::confess "Could not create timer, ", SDL::get_error(), "\n" unless ( $self->{-timer} ); bless $self, $class; return $self; diff --git a/t_backcompat/loopwave.pl b/t_backcompat/loopwave.pl index 6a72fbe3..1ccf90d6 100644 --- a/t_backcompat/loopwave.pl +++ b/t_backcompat/loopwave.pl @@ -4,12 +4,12 @@ use SDL::Event; use Carp; -confess "Could not initialize SDL: ", SDL::GetError() +Carp::confess "Could not initialize SDL: ", SDL::GetError() if ( 0 > SDL::Init(SDL_INIT_AUDIO) ); $ARGV[0] ||= 'data/sample.wav'; -confess "usage: $0 [wavefile]\n" +Carp::confess "usage: $0 [wavefile]\n" if ( in $ARGV[0], qw/ -h --help -? / ); my ( $wav_spec, $wav_buffer, $wav_len, $wav_pos ) = ( 0, 0, 0, 0 ); @@ -49,10 +49,10 @@ ( $wav_spec, $wav_buffer, $wav_len ) = @$wave; -confess "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n" +Carp::confess "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n" unless ($wav_len); -confess "Could not open audio ", SDL::GetError() +Carp::confess "Could not open audio ", SDL::GetError() if ( 0 > SDL::OpenAudio( $wav_spec, $fillerup ) ); SDL::PauseAudio(0); diff --git a/t_backcompat/testsprite.pl b/t_backcompat/testsprite.pl index ad5c4791..0ca511e8 100644 --- a/t_backcompat/testsprite.pl +++ b/t_backcompat/testsprite.pl @@ -77,7 +77,7 @@ sub init_game_context { $sprite = SDL::Video::load_BMP("data/icon.bmp"); - confess 'Cannot make sprite:' . SDL::get_error() if !$sprite; + Carp::confess 'Cannot make sprite:' . SDL::get_error() if !$sprite; # Set transparent pixel as the pixel at (0,0)