Make libEGL build cleanly under 64-bit

Change-Id: I255dfb70b166b7469d59352b1acfc7aececa07de
This commit is contained in:
Dan Stoza 2014-01-17 11:38:34 -08:00 committed by Colin Cross
parent 55f0668ffd
commit 4864e85430
2 changed files with 8 additions and 7 deletions

View File

@ -27,7 +27,6 @@
#include <cutils/log.h> #include <cutils/log.h>
#include <cutils/atomic.h> #include <cutils/atomic.h>
#include <cutils/properties.h> #include <cutils/properties.h>
#include <cutils/memory.h>
#include <utils/CallStack.h> #include <utils/CallStack.h>
#include <utils/String8.h> #include <utils/String8.h>
@ -42,6 +41,8 @@
#include "egl_display.h" #include "egl_display.h"
#include "egl_object.h" #include "egl_object.h"
typedef __eglMustCastToProperFunctionPointerType EGLFuncPointer;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
namespace android { namespace android {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -234,11 +235,11 @@ static void early_egl_init(void)
pthread_key_create(&gGLTraceKey, NULL); pthread_key_create(&gGLTraceKey, NULL);
initEglTraceLevel(); initEglTraceLevel();
#endif #endif
uint32_t addr = (uint32_t)((void*)gl_no_context); int numHooks = sizeof(gHooksNoContext) / sizeof(EGLFuncPointer);
android_memset32( EGLFuncPointer *iter = reinterpret_cast<EGLFuncPointer*>(&gHooksNoContext);
(uint32_t*)(void*)&gHooksNoContext, for (int hook = 0; hook < numHooks; ++hook) {
addr, *(iter++) = reinterpret_cast<EGLFuncPointer>(gl_no_context);
sizeof(gHooksNoContext)); }
setGLHooksThreadSpecific(&gHooksNoContext); setGLHooksThreadSpecific(&gHooksNoContext);
} }

View File

@ -204,7 +204,7 @@ EGLDisplay eglGetDisplay(EGLNativeDisplayType display)
{ {
clearError(); clearError();
uint32_t index = uint32_t(display); uintptr_t index = reinterpret_cast<uintptr_t>(display);
if (index >= NUM_DISPLAYS) { if (index >= NUM_DISPLAYS) {
return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY); return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
} }