Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d3f6073 authored by Stephen Hines's avatar Stephen Hines Committed by Android (Google) Code Review
Browse files

Merge "Support for unsigned long and unsigned long long."

parents 20b4cf8c 52d83633
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class Element extends BaseObj {
        UNSIGNED_8 (8, 1),
        UNSIGNED_16 (9, 2),
        UNSIGNED_32 (10, 4),
        //UNSIGNED_64 (11, 8),
        UNSIGNED_64 (11, 8),

        BOOLEAN(12, 1),

@@ -142,6 +142,13 @@ public class Element extends BaseObj {
        return rs.mElement_I32;
    }

    public static Element U64(RenderScript rs) {
        if(rs.mElement_U64 == null) {
            rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64);
        }
        return rs.mElement_U64;
    }

    public static Element I64(RenderScript rs) {
        if(rs.mElement_I64 == null) {
            rs.mElement_I64 = createUser(rs, DataType.SIGNED_64);
+1 −0
Original line number Diff line number Diff line
@@ -514,6 +514,7 @@ public class RenderScript {
    Element mElement_I16;
    Element mElement_U32;
    Element mElement_I32;
    Element mElement_U64;
    Element mElement_I64;
    Element mElement_F32;
    Element mElement_F64;
+13 −1
Original line number Diff line number Diff line
@@ -64,12 +64,24 @@ public class UT_primitives extends UnitTest {
        }
        s.set_longTest(17179869185l);

        long puL = s.get_ulongTest();
        if (puL != 4611686018427387904L) {
            return false;
        }
        s.set_ulongTest(4611686018427387903L);


        long pLL = s.get_longlongTest();
        if (pLL != 68719476736L) {
            return false;
        }
        s.set_longlongTest(68719476735L);
        //s.set_longlongTest(0);

        long pu64 = s.get_uint64_tTest();
        if (pu64 != 117179869184l) {
            return false;
        }
        s.set_uint64_tTest(117179869185l);

        return true;
    }
+4 −0
Original line number Diff line number Diff line
@@ -14,7 +14,9 @@ long long longlongTest = 68719476736l; // 1 << 36
uchar ucharTest = 8;
ushort ushortTest = 16;
uint uintTest = 32;
ulong ulongTest = 4611686018427387904L;
int64_t int64_tTest = -17179869184l; // - 1 << 34
uint64_t uint64_tTest = 117179869184l;

static bool test_primitive_types(uint32_t index) {
    bool failed = false;
@@ -31,7 +33,9 @@ static bool test_primitive_types(uint32_t index) {
    _RS_ASSERT(ucharTest == 8);
    _RS_ASSERT(ushortTest == 16);
    _RS_ASSERT(uintTest == 32);
    _RS_ASSERT(ulongTest == 4611686018427387903L);
    _RS_ASSERT(int64_tTest == -17179869184l);
    _RS_ASSERT(uint64_tTest == 117179869185l);

    float time = end(index);