Fix MCD score 63/239463/2
authorXuelian <xuelian.bai@samsung.com>
Mon, 27 Jul 2020 11:55:39 +0000 (19:55 +0800)
committerXuelian <xuelian.bai@samsung.com>
Tue, 11 Aug 2020 16:28:47 +0000 (00:28 +0800)
There are circle dependency between modules/fastpath/tracepath,
move fastpath/tracepath/appopt to modules directory, this will
fix MCD score to 4.99

Change-Id: Iceacb2a87085ab1b737e26f2f310a51321ce22d0
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
15 files changed:
CMakeLists.txt
src/modules/coregl_appopt.c [moved from src/modules/appopt/coregl_appopt.c with 88% similarity]
src/modules/coregl_appopt.h [moved from src/modules/appopt/coregl_appopt.h with 87% similarity]
src/modules/coregl_appopt_egl.c [moved from src/modules/appopt/coregl_appopt_egl.c with 100% similarity]
src/modules/coregl_appopt_gl.c [moved from src/modules/appopt/coregl_appopt_gl.c with 100% similarity]
src/modules/coregl_fastpath.c [moved from src/modules/fastpath/coregl_fastpath.c with 99% similarity]
src/modules/coregl_fastpath.h [moved from src/modules/fastpath/coregl_fastpath.h with 97% similarity]
src/modules/coregl_fastpath_egl.c [moved from src/modules/fastpath/coregl_fastpath_egl.c with 99% similarity]
src/modules/coregl_fastpath_gl.c [moved from src/modules/fastpath/coregl_fastpath_gl.c with 99% similarity]
src/modules/coregl_fastpath_state.h [moved from src/modules/fastpath/coregl_fastpath_state.h with 100% similarity]
src/modules/coregl_module.c
src/modules/coregl_tracepath.c [moved from src/modules/tracepath/coregl_tracepath.c with 98% similarity]
src/modules/coregl_tracepath.h [moved from src/modules/tracepath/coregl_tracepath.h with 93% similarity]
src/modules/coregl_tracepath_egl.c [moved from src/modules/tracepath/coregl_tracepath_egl.c with 99% similarity]
src/modules/coregl_tracepath_gl.c [moved from src/modules/tracepath/coregl_tracepath_gl.c with 100% similarity]

index dbe8273..0924354 100644 (file)
@@ -80,17 +80,17 @@ SET(SRCS_common
                src/coregl_export_egl.c
                src/coregl_export_gl.c
                src/modules/coregl_module.c
-               src/modules/tracepath/coregl_tracepath.c
-               src/modules/tracepath/coregl_tracepath_egl.c
-               src/modules/tracepath/coregl_tracepath_gl.c
+               src/modules/coregl_tracepath.c
+               src/modules/coregl_tracepath_egl.c
+               src/modules/coregl_tracepath_gl.c
 
-               src/modules/fastpath/coregl_fastpath.c
-               src/modules/fastpath/coregl_fastpath_egl.c
-               src/modules/fastpath/coregl_fastpath_gl.c
+               src/modules/coregl_fastpath.c
+               src/modules/coregl_fastpath_egl.c
+               src/modules/coregl_fastpath_gl.c
 
-               src/modules/appopt/coregl_appopt.c
-               src/modules/appopt/coregl_appopt_egl.c
-               src/modules/appopt/coregl_appopt_gl.c
+               src/modules/coregl_appopt.c
+               src/modules/coregl_appopt_egl.c
+               src/modules/coregl_appopt_gl.c
 )
 #################################################################
 # Build egl Library
similarity index 88%
rename from src/modules/appopt/coregl_appopt.c
rename to src/modules/coregl_appopt.c
index 2f0e453..b9c3fa0 100644 (file)
@@ -6,7 +6,7 @@
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*_orig_appopt_##FUNC_NAME) PARAM_LIST = NULL;
 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
-# include "../../headers/sym.h"
+# include "../headers/sym.h"
 #undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 
@@ -52,7 +52,7 @@ appopt_apply_overrides_egl(int enable)
 {
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_INIT_ORIGINAL(_orig_appopt_, FUNC_NAME);
 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 }
@@ -62,12 +62,9 @@ appopt_apply_overrides_gl(int enable)
 {
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_INIT_ORIGINAL(_orig_appopt_, FUNC_NAME);
 #define _COREGL_EXT_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_EXT_SYMBOL
 #undef _COREGL_SYMBOL
 }
-
-#undef A_ORD
-
similarity index 87%
rename from src/modules/appopt/coregl_appopt.h
rename to src/modules/coregl_appopt.h
index 69dd68d..5f61cd9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef COREGL_APPOPT_H
 #define COREGL_APPOPT_H
 
-#include "../coregl_module.h"
+#include "./coregl_module.h"
 
 #ifndef COREGL_USE_MODULE_APPOPT
 #error "COREGL_USE_MODULE_APPOPT must defined!!!"
 #define MY_MODULE_ID              COREGL_MODULE_APPOPT
 #define MY_MODULE_TSTATE         Appopt_ThreadState
 
-#include "../../coregl_internal.h"
-#include "../../coregl_export.h"
+#include "../coregl_internal.h"
+#include "../coregl_export.h"
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (*_orig_appopt_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym.h"
+# include "../headers/sym.h"
 #undef _COREGL_SYMBOL
 
 // Symbol definition for appopt
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (appopt_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym.h"
+# include "../headers/sym.h"
 #undef _COREGL_SYMBOL
 
 typedef struct _Appopt_ThreadState {
similarity index 99%
rename from src/modules/fastpath/coregl_fastpath.c
rename to src/modules/coregl_fastpath.c
index 581089a..bea6f51 100644 (file)
@@ -9,10 +9,10 @@
 
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*_orig_fastpath_##FUNC_NAME) PARAM_LIST = NULL;
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
 Fastpath_Opt_Flag   fp_opt = FP_UNKNOWN_PATH;
@@ -329,7 +329,7 @@ void
 fastpath_apply_overrides_egl(int enable)
 {
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_INIT_ORIGINAL(_orig_fastpath_, FUNC_NAME);
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
        COREGL_OVERRIDE(fastpath_, eglGetProcAddress);
@@ -358,9 +358,9 @@ fastpath_apply_overrides_gl(int enable)
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     \
    if(api_gl_version <= driver_gl_version) COREGL_INIT_ORIGINAL(_orig_fastpath_, FUNC_NAME);
 
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 #undef _COREGL_START_API
 #undef _COREGL_END_API
similarity index 97%
rename from src/modules/fastpath/coregl_fastpath.h
rename to src/modules/coregl_fastpath.h
index 1e970db..a44fca8 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef COREGL_FASTPATH_H
 #define COREGL_FASTPATH_H
 
-#include "../coregl_module.h"
+#include "./coregl_module.h"
 
 #ifndef COREGL_USE_MODULE_FASTPATH
 #error "COREGL_USE_MODULE_FASTPATH must defined!!!"
 #define MY_MODULE_ID              COREGL_MODULE_FASTPATH
 #define MY_MODULE_TSTATE         Fastpath_ThreadState
 
-#include "../../coregl_internal.h"
-#include "../../coregl_export.h"
+#include "../coregl_internal.h"
+#include "../coregl_export.h"
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (*_orig_fastpath_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
 // Symbol definition for fastpath
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (fastpath_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
 #define COREGL_FASTPATH_TRACE_ALL
similarity index 99%
rename from src/modules/fastpath/coregl_fastpath_egl.c
rename to src/modules/coregl_fastpath_egl.c
index ab95892..ccb0933 100644 (file)
@@ -9,7 +9,7 @@
 #include <unistd.h>
 #include <signal.h>
 #include <assert.h>
-#include "../../../include_KHR/EGL/eglext.h"
+#include "../../include_KHR/EGL/eglext.h"
 
 #ifdef COREGL_FASTPATH_TRACE_CONTEXT_INFO
 
@@ -1508,10 +1508,10 @@ fastpath_eglGetProcAddress(const char *procname)
                goto finish; \
        }
 
-#include "../../headers/sym_egl.h"
-#include "../../headers/sym_gl1.h"
-#include "../../headers/sym_gl2.h"
-#include "../../headers/sym_gl_common.h"
+#include "../headers/sym_egl.h"
+#include "../headers/sym_gl1.h"
+#include "../headers/sym_gl2.h"
+#include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 #undef _COREGL_EXT_SYMBOL_ALIAS
 
@@ -1529,10 +1529,10 @@ fastpath_eglGetProcAddress(const char *procname)
                goto finish; \
        }
 
-#include "../../headers/sym_egl.h"
-#include "../../headers/sym_gl1.h"
-#include "../../headers/sym_gl2.h"
-#include "../../headers/sym_gl_common.h"
+#include "../headers/sym_egl.h"
+#include "../headers/sym_gl1.h"
+#include "../headers/sym_gl2.h"
+#include "../headers/sym_gl_common.h"
 
 #undef _COREGL_EXT_SYMBOL_FASTPATH_PASS
 #undef _COREGL_EXT_SYMBOL_FASTPATH_BLOCK
similarity index 99%
rename from src/modules/fastpath/coregl_fastpath_gl.c
rename to src/modules/coregl_fastpath_gl.c
index 1a13e87..c571789 100644 (file)
@@ -334,9 +334,9 @@ _valid_extension_string()
                                                        gl_extension_count++; \
                                                }
 
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 
 #undef _COREGL_FASTPATH_SUPPORTED_EXTENSION
 #undef _COREGL_SYMBOL
index 40f8119..9528ffd 100644 (file)
@@ -1,17 +1,17 @@
 #include "../coregl_internal.h"
 
 // TRACEPATH module
-#include "tracepath/coregl_tracepath.h"
+#include "coregl_tracepath.h"
 #undef MY_MODULE_ID
 #undef MY_MODULE_TSTATE
 
 // FASTPATH module
-#include "fastpath/coregl_fastpath.h"
+#include "coregl_fastpath.h"
 #undef MY_MODULE_ID
 #undef MY_MODULE_TSTATE
 
 // APIOPT module
-#include "appopt/coregl_appopt.h"
+#include "coregl_appopt.h"
 #undef MY_MODULE_ID
 #undef MY_MODULE_TSTATE
 
similarity index 98%
rename from src/modules/tracepath/coregl_tracepath.c
rename to src/modules/coregl_tracepath.c
index 8f70c9c..8024e8f 100644 (file)
@@ -13,10 +13,10 @@ static int         api_gl_version;
 
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     RET_TYPE (*_orig_tracepath_##FUNC_NAME) PARAM_LIST = NULL;
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
 #define TIMEVAL_INIT            { 0, 0 }
@@ -509,11 +509,11 @@ void
 tracepath_apply_overrides_egl(int enable)
 {
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_INIT_ORIGINAL(_orig_tracepath_, FUNC_NAME);
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     COREGL_OVERRIDE(tracepath_, FUNC_NAME);
-# include "../../headers/sym_egl.h"
+# include "../headers/sym_egl.h"
 #undef _COREGL_SYMBOL
 }
 
@@ -524,16 +524,16 @@ tracepath_apply_overrides_gl(int enable)
 #define _COREGL_END_API(version) api_gl_version = COREGL_GLAPI_2;
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     \
        if(api_gl_version <= driver_gl_version) COREGL_INIT_ORIGINAL(_orig_tracepath_, FUNC_NAME);
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST) \
        if(api_gl_version <= driver_gl_version) COREGL_OVERRIDE(tracepath_, FUNC_NAME);
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 #undef _COREGL_START_API
 #undef _COREGL_END_API
@@ -612,7 +612,7 @@ tracepath_dump_context_states(int force_output)
       } \
       TRACE(" \E[40;37;1m)\E[0m\n"); \
    }
-# include "../fastpath/coregl_fastpath_state.h"
+# include "./coregl_fastpath_state.h"
 #undef GLUE_STATE
 
        TRACE("\E[0;40;34m===================================================================================================================\E[0m\n");
similarity index 93%
rename from src/modules/tracepath/coregl_tracepath.h
rename to src/modules/coregl_tracepath.h
index bcb3735..643e743 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef COREGL_TRACEPATH_H
 #define COREGL_TRACEPATH_H
 
-#include "../coregl_module.h"
+#include "./coregl_module.h"
 
 #ifndef COREGL_USE_MODULE_TRACEPATH
 #error "COREGL_USE_MODULE_TRACEPATH must defined!!!"
 #define MY_MODULE_ID              COREGL_MODULE_TRACEPATH
 #define MY_MODULE_TSTATE         Tracepath_ThreadState
 
-#include "../../coregl_internal.h"
-#include "../../coregl_export.h"
+#include "../coregl_internal.h"
+#include "../coregl_export.h"
 
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (*_orig_tracepath_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym_egl.h"
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 
 // Symbol definition for tracepath
 #define _COREGL_SYMBOL(RET_TYPE, FUNC_NAME, PARAM_LIST)     extern RET_TYPE (tracepath_##FUNC_NAME) PARAM_LIST;
-# include "../../headers/sym_egl.h"
-# include "../../headers/sym_gl1.h"
-# include "../../headers/sym_gl2.h"
-# include "../../headers/sym_gl_common.h"
+# include "../headers/sym_egl.h"
+# include "../headers/sym_gl1.h"
+# include "../headers/sym_gl2.h"
+# include "../headers/sym_gl_common.h"
 #undef _COREGL_SYMBOL
 
 #define MAX_TRACE_NAME_LENGTH  256
similarity index 99%
rename from src/modules/tracepath/coregl_tracepath_egl.c
rename to src/modules/coregl_tracepath_egl.c
index 7c4817a..9dd4602 100644 (file)
@@ -930,9 +930,9 @@ tracepath_eglGetProcAddress(const char *procname)
                goto finish; \
    }
 
-#include "../../headers/sym_egl.h"
-#include "../../headers/sym_gl1.h"
-#include "../../headers/sym_gl2.h"
+#include "../headers/sym_egl.h"
+#include "../headers/sym_gl1.h"
+#include "../headers/sym_gl2.h"
 #undef _COREGL_SYMBOL
 #undef _COREGL_EXT_SYMBOL_ALIAS