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

Commit a411bf01 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 25818 into eclair

* changes:
  Clean up some debugging and add 2 math lib routines.
parents 6286f311 d342fd75
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -255,28 +255,24 @@ static void * SF_LoadFloat(JNIEnv *_env, jobject _obj, jfieldID _field, void *bu

static void * SF_SaveInt(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
    LOGE("Save Int");
    _env->SetIntField(_obj, _field, ((int32_t *)buffer)[0]);
    return ((uint8_t *)buffer) + 4;
}

static void * SF_SaveShort(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
    LOGE("Save Short");
    _env->SetShortField(_obj, _field, ((int16_t *)buffer)[0]);
    return ((uint8_t *)buffer) + 2;
}

static void * SF_SaveByte(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
    LOGE("Save Byte");
    _env->SetByteField(_obj, _field, ((int8_t *)buffer)[0]);
    return ((uint8_t *)buffer) + 1;
}

static void * SF_SaveFloat(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
    LOGE("Save Float");
    _env->SetFloatField(_obj, _field, ((float *)buffer)[0]);
    return ((uint8_t *)buffer) + 4;
}
@@ -601,11 +597,8 @@ nAllocationSubReadFromObject(JNIEnv *_env, jobject _this, jint alloc, jobject _t
    void * buf = bufAlloc;
    rsAllocationRead(con, (RsAllocation)alloc, bufAlloc);

    LOGE("size %i, ", tc->size);

    for (int ct=0; ct < tc->fieldCount; ct++) {
        const TypeFieldCache *tfc = &tc->fields[ct];
        LOGE("ct=%i, buf=%p", ct, buf);
        buf = tfc->readPtr(_env, _o, tfc->field, buf);
    }
    free(bufAlloc);
+14 −0
Original line number Diff line number Diff line
@@ -321,6 +321,16 @@ static int SC_sqr(int v)
    return v * v;
}

static float SC_fracf(float v)
{
    return v - floorf(v);
}

static float SC_roundf(float v)
{
    return floorf(v + 0.4999999999);
}

static float SC_distf2(float x1, float y1, float x2, float y2)
{
    float x = x2 - x1;
@@ -1014,8 +1024,12 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = {
        "float", "(float, float)" },
    { "floorf", (void *)&floorf,
        "float", "(float)" },
    { "fracf", (void *)&SC_fracf,
        "float", "(float)" },
    { "ceilf", (void *)&ceilf,
        "float", "(float)" },
    { "roundf", (void *)&SC_roundf,
        "float", "(float)" },
    { "expf", (void *)&expf,
        "float", "(float)" },
    { "logf", (void *)&logf,