Fix int to pointer typecasting build warnings on 64bit environment. 46/62346/1 accepted/tizen/common/20160316.160300 accepted/tizen/ivi/20160318.111435 accepted/tizen/mobile/20160318.111019 accepted/tizen/tv/20160318.111138 accepted/tizen/wearable/20160318.111206 submit/tizen/20160315.123740
authorMun, Gwan-gyeong <kk.moon@samsung.com>
Tue, 15 Mar 2016 11:53:04 +0000 (20:53 +0900)
committerMun, Gwan-gyeong <kk.moon@samsung.com>
Tue, 15 Mar 2016 11:53:04 +0000 (20:53 +0900)
Change-Id: I7b4a66bf3af8086447e07be21e248ca703674c51

src/coregl_internal.h
src/coregl_trace.c
src/modules/fastpath/coregl_fastpath_egl.c
src/modules/tracepath/coregl_tracepath.c

index ffb366d..099fc9e 100644 (file)
@@ -2,6 +2,7 @@
 #define COREGL_INTERNAL_H
 
 #include <stdio.h>
+#include <stdint.h>
 
 #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;
index 4f681d5..fbb4254 100644 (file)
@@ -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;
index 44a413e..e4c4904 100644 (file)
@@ -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;
index a112b17..94dd60d 100644 (file)
@@ -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);