From 586cd62f44592d007051e1098c9a9b06feece987 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Mon, 23 Apr 2012 13:03:55 +0200 Subject: [PATCH] Some change in the organisation files --- jni/appl/Buffer/Buffer.h | 1 - jni/appl/Buffer/BufferText.cpp | 1 - jni/appl/Gui/BufferView.cpp | 1 - jni/appl/Gui/BufferView.h | 1 - jni/appl/Gui/CodeView.cpp | 1 - jni/appl/Gui/CodeView.h | 1 - jni/appl/init.cpp | 3 +- jni/appl/tools/Display/Display.cpp | 45 --------- jni/appl/tools/Display/Display.h | 43 --------- jni/appl/tools/EdnTemplate/EdnVectorBuf.cpp | 13 ++- jni/appl/tools/EdnTemplate/EdnVectorBuf.h | 1 - .../tools/{MsgBroadcast => }/MsgBroadcast.cpp | 0 .../tools/{MsgBroadcast => }/MsgBroadcast.h | 0 jni/appl/tools/memory/toolsMemory.cpp | 0 jni/appl/tools/memory/toolsMemory.h | 92 ------------------- .../tools/{globals => }/tools_globals.cpp | 0 jni/appl/tools/{globals => }/tools_globals.h | 0 jni/file.mk | 6 +- 18 files changed, 9 insertions(+), 200 deletions(-) delete mode 100644 jni/appl/tools/Display/Display.cpp delete mode 100644 jni/appl/tools/Display/Display.h rename jni/appl/tools/{MsgBroadcast => }/MsgBroadcast.cpp (100%) rename jni/appl/tools/{MsgBroadcast => }/MsgBroadcast.h (100%) delete mode 100644 jni/appl/tools/memory/toolsMemory.cpp delete mode 100644 jni/appl/tools/memory/toolsMemory.h rename jni/appl/tools/{globals => }/tools_globals.cpp (100%) rename jni/appl/tools/{globals => }/tools_globals.h (100%) diff --git a/jni/appl/Buffer/Buffer.h b/jni/appl/Buffer/Buffer.h index cc1ab9c..43b8260 100644 --- a/jni/appl/Buffer/Buffer.h +++ b/jni/appl/Buffer/Buffer.h @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/jni/appl/Buffer/BufferText.cpp b/jni/appl/Buffer/BufferText.cpp index 2e683ec..1167662 100644 --- a/jni/appl/Buffer/BufferText.cpp +++ b/jni/appl/Buffer/BufferText.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/jni/appl/Gui/BufferView.cpp b/jni/appl/Gui/BufferView.cpp index e11b0b6..208ba20 100644 --- a/jni/appl/Gui/BufferView.cpp +++ b/jni/appl/Gui/BufferView.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/jni/appl/Gui/BufferView.h b/jni/appl/Gui/BufferView.h index e5c3406..12bac11 100644 --- a/jni/appl/Gui/BufferView.h +++ b/jni/appl/Gui/BufferView.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/jni/appl/Gui/CodeView.cpp b/jni/appl/Gui/CodeView.cpp index 295d4ec..49b7639 100644 --- a/jni/appl/Gui/CodeView.cpp +++ b/jni/appl/Gui/CodeView.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/jni/appl/Gui/CodeView.h b/jni/appl/Gui/CodeView.h index 0e229de..156bac2 100644 --- a/jni/appl/Gui/CodeView.h +++ b/jni/appl/Gui/CodeView.h @@ -29,7 +29,6 @@ #include #include #include -#include #include #include diff --git a/jni/appl/init.cpp b/jni/appl/init.cpp index c52b35c..2425a3f 100644 --- a/jni/appl/init.cpp +++ b/jni/appl/init.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -39,7 +38,7 @@ #include #include #include -#include +#include MainWindows * basicWindows = NULL; diff --git a/jni/appl/tools/Display/Display.cpp b/jni/appl/tools/Display/Display.cpp deleted file mode 100644 index 300a605..0000000 --- a/jni/appl/tools/Display/Display.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - ******************************************************************************* - * @file Display.cpp - * @brief Editeur De N'ours : Basic Pixbuf display function - * @author Edouard DUPIN - * @date 21/01/2010 - * @par Project - * Edn - * - * @par Copyright - * Copyright 2010 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * You can not earn money with this Software (if the source extract from Edn - * represent less than 50% of original Sources) - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - -#include -#include -#include -#include - -#undef __class__ -#define __class__ "Display" - -int32_t Display::GetFontHeight(void) -{ - int32_t fontId = ewol::GetDefaultFontId(); - return ewol::GetHeight(fontId); -} - -int32_t Display::GetFontWidth(void) -{ - int32_t fontId = ewol::GetDefaultFontId(); - return ewol::GetWidth(fontId, "A"); -} - diff --git a/jni/appl/tools/Display/Display.h b/jni/appl/tools/Display/Display.h deleted file mode 100644 index 4877ce7..0000000 --- a/jni/appl/tools/Display/Display.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - ******************************************************************************* - * @file Display.h - * @brief Editeur De N'ours : Basic Pixbuf display function (header) - * @author Edouard DUPIN - * @date 21/01/2010 - * @par Project - * Edn - * - * @par Copyright - * Copyright 2010 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * You can not earn money with this Software (if the source extract from Edn - * represent less than 50% of original Sources) - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - -#ifndef __TOOLS_DISPLAY_H__ -#define __TOOLS_DISPLAY_H__ - -#include - - -/** - * Basic namespace for the font display system - */ -namespace Display -{ - int32_t GetFontHeight(void); - int32_t GetFontWidth(void); -}; - - -#endif - diff --git a/jni/appl/tools/EdnTemplate/EdnVectorBuf.cpp b/jni/appl/tools/EdnTemplate/EdnVectorBuf.cpp index 3cb0390..dfd96ac 100644 --- a/jni/appl/tools/EdnTemplate/EdnVectorBuf.cpp +++ b/jni/appl/tools/EdnTemplate/EdnVectorBuf.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #undef __class__ @@ -66,7 +65,7 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb) m_gapEnd = Evb.m_gapEnd; // allocate all same data - APPL_MALLOC(m_data, m_allocated, int8_t); + m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) ); APPL_ASSERT(NULL!=m_data, "Error in data allocation"); // Copy all data ... memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) ); @@ -84,7 +83,7 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb) EdnVectorBuf::~EdnVectorBuf() { if (NULL!=m_data) { - APPL_FREE(m_data); + free(m_data); m_data = NULL; m_allocated = 0; m_gapStart = 0; @@ -173,7 +172,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb) if( this != &Evb ) // avoid copy to itself { if (NULL!=m_data) { - APPL_FREE(m_data); + free(m_data); m_data = NULL; } // Set the new value @@ -181,7 +180,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb) m_gapStart = Evb.m_gapStart; m_gapEnd = Evb.m_gapEnd; // allocate all same data - APPL_MALLOC(m_data, m_allocated, int8_t); + m_data = (int8_t *)malloc( m_allocated * sizeof(int8_t) ); APPL_ASSERT(NULL!=m_data, "Error in data allocation"); // Copy all data ... memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) ); @@ -340,10 +339,10 @@ void EdnVectorBuf::ChangeAllocation(int32_t newSize) // check if something is allocated : if (NULL == m_data) { // no data allocated ==> request an allocation (might be the first) - APPL_MALLOC(m_data, newSize, int8_t); + m_data = (int8_t *)malloc( newSize * sizeof(int8_t) ); } else { // move datas - APPL_REALLOC(m_data, newSize, int8_t); + m_data = (int8_t *)realloc( m_data, newSize* sizeof(int8_t) ); } // Check result with assert : APPL_ASSERT(NULL!=m_data, "Error in data allocation"); diff --git a/jni/appl/tools/EdnTemplate/EdnVectorBuf.h b/jni/appl/tools/EdnTemplate/EdnVectorBuf.h index cac6d6d..3cfbba8 100644 --- a/jni/appl/tools/EdnTemplate/EdnVectorBuf.h +++ b/jni/appl/tools/EdnTemplate/EdnVectorBuf.h @@ -26,7 +26,6 @@ #ifndef __EDN_VECTOR_BUF_H__ #define __EDN_VECTOR_BUF_H__ -#include #include #undef __class__ diff --git a/jni/appl/tools/MsgBroadcast/MsgBroadcast.cpp b/jni/appl/tools/MsgBroadcast.cpp similarity index 100% rename from jni/appl/tools/MsgBroadcast/MsgBroadcast.cpp rename to jni/appl/tools/MsgBroadcast.cpp diff --git a/jni/appl/tools/MsgBroadcast/MsgBroadcast.h b/jni/appl/tools/MsgBroadcast.h similarity index 100% rename from jni/appl/tools/MsgBroadcast/MsgBroadcast.h rename to jni/appl/tools/MsgBroadcast.h diff --git a/jni/appl/tools/memory/toolsMemory.cpp b/jni/appl/tools/memory/toolsMemory.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/jni/appl/tools/memory/toolsMemory.h b/jni/appl/tools/memory/toolsMemory.h deleted file mode 100644 index d2cea62..0000000 --- a/jni/appl/tools/memory/toolsMemory.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - ******************************************************************************* - * @file toolsMemory.h - * @brief Editeur De N'ours : Memory implementation (headers) - * @author Edouard DUPIN - * @date 12/01/2011 - * @par Project - * Edn - * - * @par Copyright - * Copyright 2010 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * You can not earn money with this Software (if the source extract from Edn - * represent less than 50% of original Sources) - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - -#ifndef __TOOLS_MEMORY_H__ -#define __TOOLS_MEMORY_H__ - - -// General -#ifdef APPL_MEMORY_CHECKER - void APPL_MemFree( void * pointerData, const char * variableName, const char * functionName, int32_t line, const char * fileName ); - void * APPL_MemMalloc( size_t num, size_t size, uint8_t init, const char * variableName, const char * functionName, int32_t line, const char * fileName ); - void APPL_MemShowLogs( void ); -# define APPL_MALLOC(pointerData, nbElements, dataType) do { \ - pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \ - }while(0) -# define APPL_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ - pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \ - }while(0) -# define APPL_CALLOC(pointerData, nbElements, dataType) do { \ - pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \ - }while(0) -# define APPL_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ - pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \ - }while(0) -# define APPL_FREE(pointerData) do { \ - APPL_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \ - (pointerData) = NULL; \ - }while(0) -# define APPL_MEM_SHOW_LOG() do { \ - APPL_MemShowLogs(); \ - }while(0) -#else - -# define APPL_MALLOC(pointerData, nbElements, dataType) do { \ - (pointerData) = (dataType *)malloc( (nbElements) * sizeof(dataType) ); \ - }while(0) - -# define APPL_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ - (pointerData) = (cast)malloc( (nbElements) * sizeof(dataType) ); \ - }while(0) - -# define APPL_CALLOC(pointerData, nbElements, dataType) do { \ - (pointerData) = (dataType *)calloc( (nbElements), sizeof(dataType) ); \ - }while(0) - -# define APPL_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ - (pointerData) = (cast)calloc( (nbElements), sizeof(dataType) ); \ - }while(0) - -# define APPL_REALLOC(pointerData, nbElements, dataType) do { \ - (pointerData) = (dataType *)realloc( (pointerData), (nbElements)* sizeof(dataType) ); \ - }while(0) - -# define APPL_REALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ - (pointerData) = (cast)realloc( (pointerData), (nbElements) * sizeof(dataType) ); \ - }while(0) - -# define APPL_FREE(pointerData) do { \ - free( pointerData ); \ - (pointerData) = NULL; \ - }while(0) - -# define APPL_MEM_SHOW_LOG() do { \ - sup_system_diag("No Memory check availlable"); \ - }while(0) -#endif - - -#endif - diff --git a/jni/appl/tools/globals/tools_globals.cpp b/jni/appl/tools/tools_globals.cpp similarity index 100% rename from jni/appl/tools/globals/tools_globals.cpp rename to jni/appl/tools/tools_globals.cpp diff --git a/jni/appl/tools/globals/tools_globals.h b/jni/appl/tools/tools_globals.h similarity index 100% rename from jni/appl/tools/globals/tools_globals.h rename to jni/appl/tools/tools_globals.h diff --git a/jni/file.mk b/jni/file.mk index 7c78688..3e894f0 100644 --- a/jni/file.mk +++ b/jni/file.mk @@ -11,8 +11,7 @@ FILE_LIST+= appl/ctags/readtags.cpp \ # Globals debug tool: FILE_LIST+= appl/Debug.cpp \ - appl/tools/globals/tools_globals.cpp \ - appl/tools/memory/toolsMemory.cpp + appl/tools/tools_globals.cpp # Buffers internal: FILE_LIST+= appl/tools/EdnTemplate/EdnVectorBuf.cpp \ @@ -24,8 +23,7 @@ FILE_LIST+= appl/tools/EdnTemplate/EdnVectorBuf.cpp \ # Tools internal: -FILE_LIST+= appl/tools/Display/Display.cpp \ - appl/tools/MsgBroadcast/MsgBroadcast.cpp +FILE_LIST+= appl/tools/MsgBroadcast.cpp # Gui: FILE_LIST+= appl/Gui/BufferView.cpp \