cvsuser     04/10/12 01:35:14

  Modified:    classes  perlint.pmc
               t/pmc    perlint.t
  Log:
  Fix for a minor problem
  
  Courtesy of Sam Ruby <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.80      +2 -3      parrot/classes/perlint.pmc
  
  Index: perlint.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/perlint.pmc,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -w -r1.79 -r1.80
  --- perlint.pmc       25 Aug 2004 08:03:18 -0000      1.79
  +++ perlint.pmc       12 Oct 2004 08:35:13 -0000      1.80
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: perlint.pmc,v 1.79 2004/08/25 08:03:18 leo Exp $
  +$Id: perlint.pmc,v 1.80 2004/10/12 08:35:13 leo Exp $
   
   =head1 NAME
   
  @@ -507,7 +507,6 @@
   MMD_DEFAULT: {
   
           FLOATVAL valf = VTABLE_get_number(INTERP, value);
  -        INTVAL   vali = VTABLE_get_integer(INTERP, value);
           FLOATVAL d;
           INTVAL i;
           if (valf == 0.0) {
  @@ -515,7 +514,7 @@
               return;
           }
           d = PMC_int_val(SELF)/valf;
  -        i = PMC_int_val(SELF)/vali;
  +        i = (INTVAL) d;
           if ((FLOATVAL)(i) == d)
               VTABLE_set_integer_native(INTERP, dest, i);
           else
  
  
  
  1.20      +19 -4     parrot/t/pmc/perlint.t
  
  Index: perlint.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/perlint.t,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -w -r1.19 -r1.20
  --- perlint.t 1 Oct 2004 21:16:52 -0000       1.19
  +++ perlint.t 12 Oct 2004 08:35:14 -0000      1.20
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: perlint.t,v 1.19 2004/10/01 21:16:52 jrieks Exp $
  +# $Id: perlint.t,v 1.20 2004/10/12 08:35:14 leo Exp $
   
   =head1 NAME
   
  @@ -16,7 +16,7 @@
   
   =cut
   
  -use Parrot::Test tests => 29;
  +use Parrot::Test tests => 30;
   use Parrot::PMC '%pmc_types';
   my $perlint = $pmc_types{'PerlInt'};
   my $ok = '"ok 1\n"';
  @@ -989,3 +989,18 @@
   0
   OUTPUT
   
  +output_is(<< 'CODE', << 'OUTPUT', "Fix for a minor problem");
  +##PIR##
  +.sub main @MAIN
  +    $P1 = new PerlInt
  +    $P1 = 5
  +    $P2 = new PerlNum
  +    $P2 = 0.2
  +    $P3 = new PerlNum
  +    $P3 = $P1 / $P2
  +    print $P3
  +    print "\n"
  +.end
  +CODE
  +25
  +OUTPUT
  
  
  

Reply via email to