Commits

Michele Bini committed 0b70151

Fix bug introduced while removing dependency to a local library

  • Participants
  • Parent commits 33db3ec

Comments (0)

Files changed (1)

 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-use strict;
 package PhotoCrop;
+use strict;
+no integer;
 
 # Functional interface
 
 sub Math::Quat::new { my $p = shift; bless \@_, $p }
 sub Math::Quat::unit() { Math::Quat->new(1,0,0,0) }
 sub Math::Quat::mul {
-    my ($x, $y) = @_;
-    Math::Quat->new(
-	$$x[0] * $$y[0] - $$x[1] * $$y[1] - $$x[2] * $$y[2] - $$x[3] * $$y[3],
-	$$x[0] * $$y[1] + $$x[1] * $$y[0] + $$x[2] * $$y[3] - $$x[3] * $$y[2],
-	$$x[0] * $$y[2] - $$x[1] * $$y[3] + $$x[2] * $$y[0] + $$x[3] * $$y[1],
-	$$x[0] * $$y[3] + $$x[1] * $$y[2] - $$x[2] * $$y[1] + $$x[3] * $$y[0]
+  my ($x, $y) = @_;
+  @$x = (
+	 $$x[0] * $$y[0] - $$x[1] * $$y[1] - $$x[2] * $$y[2] - $$x[3] * $$y[3],
+	 $$x[0] * $$y[1] + $$x[1] * $$y[0] + $$x[2] * $$y[3] - $$x[3] * $$y[2],
+	 $$x[0] * $$y[2] - $$x[1] * $$y[3] + $$x[2] * $$y[0] + $$x[3] * $$y[1],
+	 $$x[0] * $$y[3] + $$x[1] * $$y[2] - $$x[2] * $$y[1] + $$x[3] * $$y[0]
 	);
+  $x
 }
-sub Math::Quat::sqr { shift->mul(shift()) }
-sub Math::Quat::real_mul {
-    my ($q, $r) = @_;
-    Math::Quat->new($q->[0] * $r, $q->[1] * $r, $q->[2] * $r, $q->[3] * $r)
-}
+sub Math::Quat::sqr { my $x = shift(); $x->mul($x) }
 
 sub rotation_by_axis {
     my ($a, $x, $y, $z) = @_; $a *= 0.5; my $s = sin($a);