[Title] Avoid prevent issues
authorHaegeun Park <haegeun.park@samsung.com>
Fri, 1 Nov 2013 08:24:38 +0000 (01:24 -0700)
committerHaegeun Park <haegeun.park@samsung.com>
Fri, 1 Nov 2013 08:24:38 +0000 (01:24 -0700)
[Issue#]
[Problem]
[Cause]
[Solution]
- Added casting code to macro 'FIND_OBJ_FROM_HASH_WITH_VERIFY'
- Removed assign NULL to tstate

src/modules/coregl_module.h
src/modules/fastpath/coregl_fastpath.c
src/modules/fastpath/coregl_fastpath_egl.c

index 08ea30f..b72749f 100644 (file)
@@ -17,9 +17,7 @@ typedef enum
 
 #define GET_MY_TSTATE(val, stmt) \
        if (stmt != NULL) \
-               val = ((MY_MODULE_TSTATE *)(stmt)->module_data[MY_MODULE_ID]); \
-       else \
-               val = NULL
+               val = ((MY_MODULE_TSTATE *)(stmt)->module_data[MY_MODULE_ID]);
 
 #define COREGL_INIT_ORIGINAL(orig_prefix, f) \
 { \
index 189573c..562d861 100644 (file)
@@ -840,10 +840,10 @@ finish:
 }
 
 #define FIND_OBJ_FROM_HASH_WITH_VERIFY(hash_base, hash, object) \
-       if ((hash) < 0) { ret = 0; goto finish; } \
+       if (((int)(hash)) < 0) { ret = 0; goto finish; } \
        { \
                GL_Object_Hash *object_hash = NULL; \
-               FIND_HASH((hash_base), (hash), object_hash); \
+               FIND_HASH((hash_base), (int)(hash), object_hash); \
                if (object_hash == NULL) { ret = 0; goto finish; } \
                (object) = object_hash->item; \
                if ((object) == NULL) { ret = 0; goto finish; } \
index 55a9d69..8e4e778 100644 (file)
@@ -822,8 +822,6 @@ fastpath_eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_con
                if (sostate_new == NULL)
                {
                        COREGL_ERR("\E[40;31;1mError creating a new GLGlueContext(Memory full 4)\E[0m\n");
-                       free(gctx);
-                       gctx = NULL;
                        goto finish;
                }
                fastpath_sostate_init(sostate_new);
@@ -845,8 +843,6 @@ fastpath_eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_con
                if (gctx_list_new == NULL)
                {
                        COREGL_ERR("\E[40;31;1mError creating a new GlGlueContext(Memory full 5)\E[0m\n");
-                       free(gctx);
-                       gctx = NULL;
                        goto finish;
                }