Changeset 15026


Ignore:
Timestamp:
06/01/17 06:45:31 (6 years ago)
Author:
Mark Evenson
Message:

Support bignum argument for FILE-POSITION

(Olof-Joachim Frahm)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/FileStream.java

    r13444 r15026  
    234234    {
    235235        try {
    236             long pos;
     236            long pos = 0;
    237237            if (arg == Keyword.START)
    238238                pos = 0;
    239239            else if (arg == Keyword.END)
    240240                pos = racf.length();
    241             else {
    242                 long n = Fixnum.getValue(arg); // FIXME arg might be a bignum
    243                 pos = n * bytesPerUnit;
    244             }
     241            else if (arg instanceof Fixnum)
     242                pos = ((Fixnum) arg).value * bytesPerUnit;
     243            else if (arg instanceof Bignum)
     244                pos = ((Bignum) arg).longValue() * bytesPerUnit;
     245            else
     246                type_error(arg, Symbol.INTEGER);
    245247            racf.position(pos);
    246248        }
Note: See TracChangeset for help on using the changeset viewer.