summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2014-01-28 02:27:41 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-01-28 02:27:41 +0000
commit689a7f30ccd2e57eaadecedbe30690e2a44ce23a (patch)
treeccc2000f87aa37ae7e0469a04ddcdfe51b8e053e
parenta21ba5856b6d3bdfcef183e09aa658e69ddb4786 (diff)
parent851b2cb18c329e0d19f9f56f68425b714007a274 (diff)
am 851b2cb1: Merge "Make libEGL build cleanly under 64-bit"
* commit '851b2cb18c329e0d19f9f56f68425b714007a274': Make libEGL build cleanly under 64-bit
-rw-r--r--opengl/libs/EGL/egl.cpp13
-rw-r--r--opengl/libs/EGL/eglApi.cpp2
2 files changed, 8 insertions, 7 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index f759e6b6e6..67fbae5dd0 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -27,7 +27,6 @@
#include <cutils/log.h>
#include <cutils/atomic.h>
#include <cutils/properties.h>
-#include <cutils/memory.h>
#include <utils/CallStack.h>
#include <utils/String8.h>
@@ -42,6 +41,8 @@
#include "egl_display.h"
#include "egl_object.h"
+typedef __eglMustCastToProperFunctionPointerType EGLFuncPointer;
+
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
@@ -234,11 +235,11 @@ static void early_egl_init(void)
pthread_key_create(&gGLTraceKey, NULL);
initEglTraceLevel();
#endif
- uint32_t addr = (uint32_t)((void*)gl_no_context);
- android_memset32(
- (uint32_t*)(void*)&gHooksNoContext,
- addr,
- sizeof(gHooksNoContext));
+ int numHooks = sizeof(gHooksNoContext) / sizeof(EGLFuncPointer);
+ EGLFuncPointer *iter = reinterpret_cast<EGLFuncPointer*>(&gHooksNoContext);
+ for (int hook = 0; hook < numHooks; ++hook) {
+ *(iter++) = reinterpret_cast<EGLFuncPointer>(gl_no_context);
+ }
setGLHooksThreadSpecific(&gHooksNoContext);
}
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 0cc5265af2..d96b54f3c2 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -204,7 +204,7 @@ EGLDisplay eglGetDisplay(EGLNativeDisplayType display)
{
clearError();
- uint32_t index = uint32_t(display);
+ uintptr_t index = reinterpret_cast<uintptr_t>(display);
if (index >= NUM_DISPLAYS) {
return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY);
}