From: Vincent Pit Date: Sun, 17 May 2009 19:21:04 +0000 (+0200) Subject: This is 0.06 X-Git-Tag: v0.06^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScalar-Vec-Util.git;a=commitdiff_plain;h=5287145983fdaeadb8adadd96292e05e2cda239a This is 0.06 --- diff --git a/Changes b/Changes index dcd2e95..3bf0dfc 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,13 @@ Revision history for Scalar-Vec-Util +0.06 2009-05-17 19:20 UTC + + Add : The vshift() and vrot() functions. + + Chg : All functions now have prototypes. + + Chg : undef is no longer an invalid argument to the functions, but + offsets and lengths are now checked to be positive. + + Fix : Erroneous edge cases when copying bits in place. + + Upd : META.yml spec to 1.4. + 0.05 2008-06-03 11:40 UTC + Fix : make cover choked on t/02-pp.t. diff --git a/META.yml b/META.yml index 57abb8f..85d54fa 100644 --- a/META.yml +++ b/META.yml @@ -1,21 +1,34 @@ --- #YAML:1.0 -name: Scalar-Vec-Util -version: 0.05 -abstract: Utility routines for vec strings. -license: perl -author: +name: Scalar-Vec-Util +version: 0.06 +abstract: Utility routines for vec strings. +author: - Vincent Pit -generated_by: ExtUtils::MakeMaker version 6.44 -distribution_type: module -requires: - Carp: 0 - Exporter: 0 - XSLoader: 0 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.3.html - version: 1.3 +license: perl +distribution_type: module +configure_requires: + Config: 0 + ExtUtils::MakeMaker: 0 + File::Spec: 0 build_requires: - Config: 0 - ExtUtils::MakeMaker: 0 - File::Spec: 0 - Test::More: 0 + Config: 0 + ExtUtils::MakeMaker: 0 + Test::More: 0 +requires: + Carp: 0 + Exporter: 0 + perl: 5.006 + XSLoader: 0 +resources: + bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Scalar-Vec-Util + homepage: http://search.cpan.org/dist/Scalar-Vec-Util/ + license: http://dev.perl.org/licenses/ + repository: http://git.profvince.com/?p=perl%2Fmodules%2FScalar-Vec-Util.git +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.50 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff --git a/README b/README index f466c4d..f638403 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Scalar::Vec::Util - Utility routines for vec strings. VERSION - Version 0.05 + Version 0.06 SYNOPSIS use Scalar::Vec::Util qw/vfill vcopy veq/; @@ -42,7 +42,21 @@ FUNCTIONS "vcopy $from => $from_start, $to => $to_start, $length" Copies $length bits starting at $from_start in $from to $to_start in $to. If "$from_start + $length" is too long for $from, zeros are copied - past $length. Grows $to if necessary. + past $length. Grows $to if necessary. Doesn't need to allocate any extra + memory. + + "vshift $v, $start, $length => $bits [, $insert ]" + In the area starting at $start and of length $length in $v, shift bits + "abs $bits" positions left if "$bits > 0" and right otherwise. If + $insert is defined, also fills the resulting gap with ones if $insert is + true and zeros if it's false. Bits outside of the specified area are + left untouched. Doesn't need to allocate any extra memory. + + "vrot $v, $start, $length, $bits" + In the area starting at $start and of length $length in $v, rotates bits + "abs $bits" positions left if "$bits > 0" and right otherwise. Bits + outside of the specified area are left untouched. Currently allocates an + extra buffer of size "O($bits)". "veq $v1 => $v1_start, $v2 => $v2_start, $length" Returns true if the $length bits starting at $v1_start in $v1 and @@ -50,15 +64,16 @@ FUNCTIONS decreased to fit inside $v1 and $v2 boundaries. EXPORT - The functions "vfill", "vcopy" and "veq" are only exported on request. - All of them are exported by the tags ':funcs' and ':all'. + The functions "vfill", "vcopy", "vshift", "vrot" and "veq" are only + exported on request. All of them are exported by the tags ':funcs' and + ':all'. The constants "SVU_PP" and "SVU_SIZE" are also only exported on request. They are all exported by the tags ':consts' and ':all'. BENCHMARKS The following timings were obtained by running the "samples/bench.pl" - script. The "_pp" entries are the pure Perl versions, while "_bv" are + script. The "_pp" entries are the pure Perl versions, whereas "_bv" are Bit::Vector versions. This is for perl 5.8.8 on a Core 2 Duo 2.66GHz machine (unit is 64 @@ -142,8 +157,7 @@ SEE ALSO AUTHOR Vincent Pit, "", . - You can contact me by mail or on #perl @ FreeNode (vincent or - Prof_Vince). + You can contact me by mail or on "irc.perl.org" (vincent). BUGS Please report any bugs or feature requests to "bug-scalar-vec-util at @@ -161,7 +175,7 @@ SUPPORT . COPYRIGHT & LICENSE - Copyright 2008 Vincent Pit, all rights reserved. + Copyright 2008-2009 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Scalar/Vec/Util.pm b/lib/Scalar/Vec/Util.pm index b6e381f..5fa5fa2 100644 --- a/lib/Scalar/Vec/Util.pm +++ b/lib/Scalar/Vec/Util.pm @@ -11,13 +11,13 @@ Scalar::Vec::Util - Utility routines for vec strings. =head1 VERSION -Version 0.05 +Version 0.06 =cut our $VERSION; BEGIN { - $VERSION = '0.05'; + $VERSION = '0.06'; eval { require XSLoader; XSLoader::load(__PACKAGE__, $VERSION);