Changeset 16538 for trunk


Ignore:
Timestamp:
06/01/13 12:04:31 (11 years ago)
Author:
tbretz
Message:
Improved a bit the interpretation of a int64, now it is interpreted as signed... we cannot access the single bits easily anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r16102 r16538  
    11581158    case 'X':
    11591159        {
    1160             const uint64_t val = *reinterpret_cast<const uint64_t*>(ptr);
     1160            const int64_t val = *reinterpret_cast<const int64_t*>(ptr);
    11611161            ptr += 8;
    1162             if (val>UINT32_MAX)
    1163                 return Number::New(val);
    1164             return Integer::NewFromUnsigned(val);
     1162            if (val>=0 && val<=UINT32_MAX)
     1163                return Integer::NewFromUnsigned(val);
     1164            if (val>=INT32_MIN && val<0)
     1165                return Integer::New(val);
     1166            return Number::New(val);
    11651167        }
    11661168    case 'S':  { Handle<Value> v=Integer::NewFromUnsigned(*reinterpret_cast<const uint16_t*>(ptr)); ptr += 2; return v; }
Note: See TracChangeset for help on using the changeset viewer.