From 01ac898911810ec0900bbf79db0518d77457c82b Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Tue, 15 Mar 2016 20:53:04 +0900 Subject: [PATCH] Fix int to pointer typecasting build warnings on 64bit environment. Change-Id: I7b4a66bf3af8086447e07be21e248ca703674c51 --- src/coregl_internal.h | 3 ++- src/coregl_trace.c | 2 +- src/modules/fastpath/coregl_fastpath_egl.c | 17 +++++++++-------- src/modules/tracepath/coregl_tracepath.c | 12 ++++++------ 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/coregl_internal.h b/src/coregl_internal.h index ffb366d..099fc9e 100644 --- a/src/coregl_internal.h +++ b/src/coregl_internal.h @@ -2,6 +2,7 @@ #define COREGL_INTERNAL_H #include +#include #include "coregl.h" @@ -122,7 +123,7 @@ extern int trace_surface_sequence_sort_flag; extern int trace_surface_filter_period_begin; extern int trace_surface_filter_period_end; extern int trace_surface_filter_type; -extern int trace_surface_filter_handle; +extern uintptr_t trace_surface_filter_handle; extern int trace_surface_filter_size_w; extern int trace_surface_filter_size_h; extern int trace_surface_print_only_flag; diff --git a/src/coregl_trace.c b/src/coregl_trace.c index 4f681d5..fbb4254 100644 --- a/src/coregl_trace.c +++ b/src/coregl_trace.c @@ -18,7 +18,7 @@ int trace_surface_sequence_sort_flag = 0; int trace_surface_filter_period_begin = 0; int trace_surface_filter_period_end = 0; int trace_surface_filter_type = 0; -int trace_surface_filter_handle = 0; +uintptr_t trace_surface_filter_handle = 0; int trace_surface_filter_size_w = 0; int trace_surface_filter_size_h = 0; int trace_surface_print_only_flag = 0; diff --git a/src/modules/fastpath/coregl_fastpath_egl.c b/src/modules/fastpath/coregl_fastpath_egl.c index 44a413e..e4c4904 100644 --- a/src/modules/fastpath/coregl_fastpath_egl.c +++ b/src/modules/fastpath/coregl_fastpath_egl.c @@ -1327,7 +1327,7 @@ fastpath_eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, { void *ret = NULL; EGLContext real_ctx = EGL_NO_CONTEXT; - GLuint real_obj = 0; + EGLClientBuffer real_obj; _COREGL_FASTPATH_FUNC_BEGIN(); @@ -1351,12 +1351,13 @@ fastpath_eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR: case EGL_GL_TEXTURE_3D_KHR: case EGL_GL_RENDERBUFFER_KHR: - if ((GLuint )buffer == 0) { + if (buffer == NULL) { COREGL_ERR("\E[40;31;1m fastpath_eglCreateImageKHR buffer object NULL \E[0m\n"); - real_obj = 0; + real_obj = NULL; } else { - real_obj = fastpath_ostate_get_object(&gctx->ostate, GL_OBJECT_TYPE_TEXTURE, - (GLuint )buffer); + real_obj = (EGLClientBuffer)(uintptr_t)fastpath_ostate_get_object(&gctx->ostate, + GL_OBJECT_TYPE_TEXTURE, + (GLuint)(uintptr_t)buffer); } break; default: @@ -1365,11 +1366,11 @@ fastpath_eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, } } else { - real_obj = (GLuint )buffer; + real_obj = buffer; } - ret = _orig_fastpath_eglCreateImageKHR(dpy, real_ctx, target, - (EGLClientBuffer)real_obj, attrib_list); + ret = _orig_fastpath_eglCreateImageKHR(dpy, real_ctx, target, real_obj, + attrib_list); goto finish; diff --git a/src/modules/tracepath/coregl_tracepath.c b/src/modules/tracepath/coregl_tracepath.c index a112b17..94dd60d 100644 --- a/src/modules/tracepath/coregl_tracepath.c +++ b/src/modules/tracepath/coregl_tracepath.c @@ -301,7 +301,7 @@ init_modules_tracepath() } } } else { - trace_surface_filter_handle = atoi(tmp); + trace_surface_filter_handle = (uintptr_t)atol(tmp); } } @@ -361,8 +361,8 @@ init_modules_tracepath() if (trace_surface_filter_type == 2) COREGL_LOG("\E[40;36;1m(SURFACE-TYPE:FBO)\E[0m "); if (trace_surface_filter_handle != 0) - COREGL_LOG("\E[40;36;1m(SURFACE-HANDLE:0x%x(%d))\E[0m ", - trace_surface_filter_handle, trace_surface_filter_handle); + COREGL_LOG("\E[40;36;1m(SURFACE-HANDLE:%p(%ld))\E[0m ", + (void *)trace_surface_filter_handle, (long int)trace_surface_filter_handle); if (trace_surface_filter_size_w > 0 && trace_surface_filter_size_h > 0) COREGL_LOG("\E[40;36;1m(SURFACE-SIZE:%dx%d)\E[0m ", trace_surface_filter_size_w, trace_surface_filter_size_h); @@ -1236,7 +1236,7 @@ _dump_surface(int force_output, int type, const char *position, trace_surface_filter_type != 1) goto finish;; if (trace_surface_filter_handle != 0 && - trace_surface_filter_handle != (int)sdata->surface) goto finish; + trace_surface_filter_handle != (uintptr_t)sdata->surface) goto finish; EGLConfig eglconfig; GLint asize, rsize, gsize, bsize; @@ -1318,8 +1318,8 @@ _dump_surface(int force_output, int type, const char *position, trace_surface_filter_type != 2) goto finish; if (trace_surface_filter_handle != 0 && - trace_surface_filter_handle != sdata->tex && - trace_surface_filter_handle != sdata->rb) goto finish; + trace_surface_filter_handle != (uintptr_t)sdata->tex && + trace_surface_filter_handle != (uintptr_t)sdata->rb) goto finish; GLint oldfb; _orig_tracepath_glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldfb); -- 2.7.4