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

Commit dd000905 authored by Colin Cross's avatar Colin Cross Committed by Android Git Automerger
Browse files

am e3aeefd1: am af29b77a: Merge "libGLES_android: fix 64-bit compile errors"

* commit 'e3aeefd1':
  libGLES_android: fix 64-bit compile errors
parents 03691218 e3aeefd1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -163,9 +163,9 @@ void Tokenizer::dump() const
{
{
    const run_t* ranges = mRanges.array();
    const run_t* ranges = mRanges.array();
    const size_t c = mRanges.size();
    const size_t c = mRanges.size();
    ALOGD("Tokenizer (%p, size = %u)\n", this, c);
    ALOGD("Tokenizer (%p, size = %zu)\n", this, c);
    for (size_t i=0 ; i<c ; i++) {
    for (size_t i=0 ; i<c ; i++) {
        ALOGD("%u: (%u, %u)\n", i, ranges[i].first, ranges[i].length);
        ALOGD("%zu: (%u, %u)\n", i, ranges[i].first, ranges[i].length);
    }
    }
}
}


+6 −2
Original line number Original line Diff line number Diff line
@@ -147,7 +147,11 @@ struct vertex_t {


    vec4_t          color;
    vec4_t          color;
    vec4_t          texture[GGL_TEXTURE_UNIT_COUNT];
    vec4_t          texture[GGL_TEXTURE_UNIT_COUNT];
#ifdef __LP64__
    uint32_t        reserved1[2];
#else
    uint32_t        reserved1[4];
    uint32_t        reserved1[4];
#endif


    inline void clear() {
    inline void clear() {
        flags = index = locked = mru = 0;
        flags = index = locked = mru = 0;
@@ -578,10 +582,10 @@ private:
#ifdef HAVE_ANDROID_OS
#ifdef HAVE_ANDROID_OS
    // We have a dedicated TLS slot in bionic
    // We have a dedicated TLS slot in bionic
    inline void setGlThreadSpecific(ogles_context_t *value) {
    inline void setGlThreadSpecific(ogles_context_t *value) {
        ((uint32_t *)__get_tls())[TLS_SLOT_OPENGL] = (uint32_t)value;
        __get_tls()[TLS_SLOT_OPENGL] = value;
    }
    }
    inline ogles_context_t* getGlThreadSpecific() {
    inline ogles_context_t* getGlThreadSpecific() {
        return (ogles_context_t *)(((unsigned *)__get_tls())[TLS_SLOT_OPENGL]);
        return static_cast<ogles_context_t*>(__get_tls()[TLS_SLOT_OPENGL]);
    }
    }
#else
#else
    extern pthread_key_t gGLKey;
    extern pthread_key_t gGLKey;
+6 −6
Original line number Original line Diff line number Diff line
@@ -78,20 +78,20 @@ static T setError(GLint error, T returnValue) {
            pthread_key_create(&gEGLErrorKey, NULL);
            pthread_key_create(&gEGLErrorKey, NULL);
        pthread_mutex_unlock(&gErrorKeyMutex);
        pthread_mutex_unlock(&gErrorKeyMutex);
    }
    }
    pthread_setspecific(gEGLErrorKey, (void*)error);
    pthread_setspecific(gEGLErrorKey, (void*)(uintptr_t)error);
    return returnValue;
    return returnValue;
}
}


static GLint getError() {
static GLint getError() {
    if (ggl_unlikely(gEGLErrorKey == -1))
    if (ggl_unlikely(gEGLErrorKey == -1))
        return EGL_SUCCESS;
        return EGL_SUCCESS;
    GLint error = (GLint)pthread_getspecific(gEGLErrorKey);
    GLint error = (GLint)(uintptr_t)pthread_getspecific(gEGLErrorKey);
    if (error == 0) {
    if (error == 0) {
        // The TLS key has been created by another thread, but the value for
        // The TLS key has been created by another thread, but the value for
        // this thread has not been initialized.
        // this thread has not been initialized.
        return EGL_SUCCESS;
        return EGL_SUCCESS;
    }
    }
    pthread_setspecific(gEGLErrorKey, (void*)EGL_SUCCESS);
    pthread_setspecific(gEGLErrorKey, (void*)(uintptr_t)EGL_SUCCESS);
    return error;
    return error;
}
}


@@ -1201,7 +1201,7 @@ static EGLBoolean getConfigAttrib(EGLDisplay dpy, EGLConfig config,
        EGLint attribute, EGLint *value)
        EGLint attribute, EGLint *value)
{
{
    size_t numConfigs =  NELEM(gConfigs);
    size_t numConfigs =  NELEM(gConfigs);
    int index = (int)config;
    int index = (int)(uintptr_t)config;
    if (uint32_t(index) >= numConfigs)
    if (uint32_t(index) >= numConfigs)
        return setError(EGL_BAD_CONFIG, EGL_FALSE);
        return setError(EGL_BAD_CONFIG, EGL_FALSE);


@@ -1448,7 +1448,7 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy,
    }
    }
    GLint i;
    GLint i;
    for (i=0 ; i<numConfigs && i<config_size ; i++) {
    for (i=0 ; i<numConfigs && i<config_size ; i++) {
        *configs++ = (EGLConfig)i;
        *configs++ = (EGLConfig)(uintptr_t)i;
    }
    }
    *num_config = i;
    *num_config = i;
    return EGL_TRUE;
    return EGL_TRUE;
@@ -1519,7 +1519,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list,
        if (configs) {
        if (configs) {
            for (int i=0 ; config_size && i<numConfigs ; i++) {
            for (int i=0 ; config_size && i<numConfigs ; i++) {
                if (possibleMatch & (1<<i)) {
                if (possibleMatch & (1<<i)) {
                    *configs++ = (EGLConfig)i;
                    *configs++ = (EGLConfig)(uintptr_t)i;
                    config_size--;
                    config_size--;
                    n++;
                    n++;
                }
                }