diff --git a/sources/appl/Buffer.cpp b/sources/appl/Buffer.cpp index 57e6c5a..850f5f0 100644 --- a/sources/appl/Buffer.cpp +++ b/sources/appl/Buffer.cpp @@ -299,7 +299,7 @@ bool appl::Buffer::search(const appl::Buffer::Iterator& _pos, for (Iterator it = _pos; (bool)it == true; ++it) { - if (tolower(*it) == firstElement) { + if ((char32_t)tolower(*it) == firstElement) { // find the first char ==> check next... bool find = true; Iterator tmp = it; @@ -371,7 +371,7 @@ bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos, (bool)it == true; --it) { //APPL_DEBUG("compare : " << *it << " ?= " << _search); - if (tolower(*it) == lastElement) { + if ((char32_t)tolower(*it) == lastElement) { // find the last char ==> check previous... bool find = true; _result = it; @@ -759,12 +759,12 @@ void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64 } else { elemStart = startId+1; } - for (int64_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) { + for (auto &it : m_HLDataPass1) { //APPL_DEBUG("move element=" << i); - m_HLDataPass1[iii].beginStart += _nbAdded - _nbDeleted; - m_HLDataPass1[iii].beginStop += _nbAdded - _nbDeleted; - m_HLDataPass1[iii].endStart += _nbAdded - _nbDeleted; - m_HLDataPass1[iii].endStop += _nbAdded - _nbDeleted; + it.beginStart += _nbAdded - _nbDeleted; + it.beginStop += _nbAdded - _nbDeleted; + it.endStart += _nbAdded - _nbDeleted; + it.endStop += _nbAdded - _nbDeleted; } //Regenerate Element inside range if ( startId == -1 @@ -827,7 +827,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos, ------------ ------------- ---------- S=-1 *************** E */ - for (int32_t iii = 0; iii < m_HLDataPass1.size(); ++iii) { + for (size_t iii = 0; iii < m_HLDataPass1.size(); ++iii) { if (m_HLDataPass1[iii].endStop > _startPos) { break; } @@ -848,7 +848,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos, } else { elemStart = _startId+1; } - for (int32_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) { + for (size_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) { if (m_HLDataPass1[iii].beginStart > _endPos) { _stopId = iii; break; @@ -872,7 +872,7 @@ void appl::Buffer::cleanHighLight() { appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) { int32_t start = etk_max(0, _starPos-1); - for (int32_t iii = start; iii < m_HLDataPass1.size(); ++iii) { + for (size_t iii = start; iii < m_HLDataPass1.size(); ++iii) { _starPos = iii; if ( m_HLDataPass1[iii].beginStart <= _pos && m_HLDataPass1[iii].endStop > _pos) { diff --git a/sources/appl/Buffer.h b/sources/appl/Buffer.h index 0d471db..4dd1042 100644 --- a/sources/appl/Buffer.h +++ b/sources/appl/Buffer.h @@ -248,7 +248,7 @@ namespace appl { }; Iterator operator+ (const size_t _val) const { Iterator tmpp(*this); - for (int64_t iii=0; iii<_val; ++iii) { + for (int64_t iii=0; iii<(int64_t)_val; ++iii) { ++tmpp; } return tmpp; @@ -273,7 +273,7 @@ namespace appl { }; Iterator operator- (const size_t _val) const { Iterator tmpp(*this); - for (int64_t iii=0; iii<_val; ++iii) { + for (int64_t iii=0; iii<(int64_t)_val; ++iii) { --tmpp; } return tmpp; diff --git a/sources/appl/BufferManager.cpp b/sources/appl/BufferManager.cpp index c4f86a3..86a2295 100644 --- a/sources/appl/BufferManager.cpp +++ b/sources/appl/BufferManager.cpp @@ -88,7 +88,7 @@ void appl::BufferManager::onObjectRemove(const ewol::object::Shared appl::BufferManager::get(int32_t _id) { int32_t id = 0; - for (auto it : m_list) { + for (auto &it : m_list) { if (id == _id) { return it; } @@ -98,7 +98,7 @@ ewol::object::Shared appl::BufferManager::get(int32_t _id) { } bool appl::BufferManager::exist(const std::string& _fileName) { - for (auto it : m_list) { + for (auto &it : m_list) { if (it == nullptr) { continue; } diff --git a/sources/appl/GlyphPainting.cpp b/sources/appl/GlyphPainting.cpp index 3ddf213..981b1c1 100644 --- a/sources/appl/GlyphPainting.cpp +++ b/sources/appl/GlyphPainting.cpp @@ -47,7 +47,7 @@ void appl::GlyphPainting::reload() { APPL_ERROR("Can not get basic array : 'ednColor'"); return; } - for (int32_t iii = 0; iii < baseArray->size(); ++iii) { + for (size_t iii = 0; iii < baseArray->size(); ++iii) { ejson::Object* tmpObj = baseArray->getObject(iii); if (tmpObj == NULL) { APPL_DEBUG(" can not get object in 'ednColor' id=" << iii); @@ -60,7 +60,7 @@ void appl::GlyphPainting::reload() { bool bold = tmpObj->getBooleanValue("bold", false); APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'"); bool findElement = false; - for (int32_t jjj=0; jjj& _list) { std::vector tmpList = _list; _list.clear(); - for(int32_t iii=0; iiigetBufferSelected(); } if (tmpBuffer != NULL) { - for (int32_t iii=0; iiim_isModify = BufferManager::get(m_list[iii]->m_bufferID)->isModify(); + for (auto &it : m_list) { + if (it != nullptr) { + //it->m_isModify = BufferManager::get(it->m_bufferID)->isModify(); } } markToRedraw(); @@ -256,8 +254,8 @@ uint32_t BufferView::getNuberOfRaw() { bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { if( _raw >= 0 - && _rawm_bufferName.getNameFile(); if ( m_list[_raw]->m_buffer != NULL @@ -286,7 +284,7 @@ bool BufferView::onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent if (1 == _IdInput && _typeEvent == ewol::key::statusSingle) { APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); if( _raw >= 0 - && _rawm_buffer != NULL) { sendMultiCast(appl::MsgSelectNewFile, m_list[_raw]->m_buffer->getFileName()); diff --git a/sources/appl/Gui/TagFileList.cpp b/sources/appl/Gui/TagFileList.cpp index 14ef8a2..de72afd 100644 --- a/sources/appl/Gui/TagFileList.cpp +++ b/sources/appl/Gui/TagFileList.cpp @@ -34,11 +34,10 @@ appl::TagFileList::TagFileList() { appl::TagFileList::~TagFileList() { - for (int32_t iii=0; iii appl::TagFileList::getBasicBG() { @@ -59,7 +58,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() { } bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { - if (_raw >= 0 && _raw < m_list.size() && NULL != m_list[_raw]) { + if (_raw >= 0 && (size_t)_raw < m_list.size() && NULL != m_list[_raw]) { if (0 == _colomn) { _myTextToWrite = std::to_string(m_list[_raw]->fileLine); } else { @@ -86,7 +85,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty EWOL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); if (_IdInput == 1) { int32_t previousRaw = m_selectedLine; - if (_raw > m_list.size() ) { + if (_raw > (int64_t)m_list.size() ) { m_selectedLine = -1; } else { m_selectedLine = _raw; @@ -96,7 +95,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty event = applEventCtagsListSelect; } if( m_selectedLine >= 0 - && m_selectedLine < m_list.size() + && m_selectedLine < (int64_t)m_list.size() && NULL != m_list[m_selectedLine] ) { generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename); } else { diff --git a/sources/appl/Gui/WorkerSaveAllFile.cpp b/sources/appl/Gui/WorkerSaveAllFile.cpp index 9bc1b05..5350729 100644 --- a/sources/appl/Gui/WorkerSaveAllFile.cpp +++ b/sources/appl/Gui/WorkerSaveAllFile.cpp @@ -28,7 +28,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() : return; } // List all current open file : - for (size_t iii=0; iiisize(); ++iii) { + for (int32_t iii=0; iiisize(); ++iii) { ewol::object::Shared tmpBuffer = m_bufferManager->get(iii); if (tmpBuffer == NULL) { continue; diff --git a/sources/appl/Highlight.cpp b/sources/appl/Highlight.cpp index bcf53ec..eff62d9 100644 --- a/sources/appl/Highlight.cpp +++ b/sources/appl/Highlight.cpp @@ -56,7 +56,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _ int32_t level1 = 0; int32_t level2 = 0; // parse all the elements : - for(int32_t iii = 0; iii < root->size(); ++iii) { + for(size_t iii = 0; iii < root->size(); ++iii) { exml::Element* child = root->getElement(iii); if (child == NULL) { // trash here all that is not element ... @@ -70,7 +70,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _ } } else if (child->getValue() == "pass1") { // get sub Nodes ... - for(int32_t jjj=0; jjj< child->size(); jjj++) { + for(size_t jjj=0; jjj< child->size(); jjj++) { exml::Element* passChild = child->getElement(jjj); if (passChild == NULL) { continue; @@ -83,7 +83,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _ } } else if (child->getValue() == "pass2") { // get sub Nodes ... - for(int32_t jjj=0; jjj< child->size(); jjj++) { + for(size_t jjj=0; jjj< child->size(); jjj++) { exml::Element* passChild = child->getElement(jjj); if (passChild == NULL) { continue; @@ -110,10 +110,10 @@ appl::Highlight::~Highlight() { } bool appl::Highlight::hasExtention(const std::string& _ext) { - for (int32_t iii=0; iiigetName() ); + for (auto &it : m_listHighlightPass1) { + APPL_INFO(" Pass 1 : " << it->getName() ); //m_listHighlightPass1[iii]->display(); } // display all elements - for (int32_t iii=0; iii< m_listHighlightPass2.size(); iii++) { - APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->getName() ); + for (auto &it : m_listHighlightPass2) { + APPL_INFO(" pass 2 : " << it->getName() ); //m_listHighlightPass2[iii]->display(); } } @@ -175,7 +175,7 @@ void appl::Highlight::parse(int64_t _start, while (elementStart <= elementStop) { HL_DEBUG("Parse element in the buffer pos=" << elementStart); //try to fond the HL in ALL of we have - for (int64_t jjj=0; jjj>& s_list() { static std::vector> list; return list; @@ -31,14 +33,14 @@ void appl::highlightManager::init() { etk::FSNode myFile("DATA:languages/"); // get the subfolder list : std::vector list = myFile.folderGetSubList(false, true, false,false); - for (int32_t iii = 0; iii < list.size(); ++iii) { - if (list[iii] == NULL) { + for (auto &it : list) { + if (it == NULL) { continue; } - if (list[iii]->getNodeType() != etk::FSN_FOLDER) { + if (it->getNodeType() != etk::FSN_FOLDER) { continue; } - std::string filename = list[iii]->getName() + "/highlight.xml"; + std::string filename = it->getName() + "/highlight.xml"; APPL_DEBUG("Load xml name : " << filename); ewol::object::Shared myHightLine = appl::Highlight::keep(filename); if (myHightLine != NULL) { @@ -49,11 +51,11 @@ void appl::highlightManager::init() { } // display : /* - for (int32_t iii = 0; iii < hlList.size(); ++iii) { - if (hlList[iii] == NULL) { + for (auto &it : hlList) { + if (it == NULL) { continue; } - hlList[iii]->display(); + it->display(); } */ } @@ -74,15 +76,15 @@ std::string appl::highlightManager::getTypeExtention(const std::string& _extenti } APPL_DEBUG("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types"); std::vector>& hlList = s_list(); - for (int32_t iii = 0; iii < hlList.size(); ++iii) { - if (hlList[iii] == NULL) { + for (auto &it : hlList) { + if (it == NULL) { continue; } - APPL_DEBUG(" check : " << hlList[iii]->getTypeName()); - if (hlList[iii]->hasExtention(_extention) == true) { + APPL_DEBUG(" check : " << it->getTypeName()); + if (it->hasExtention(_extention) == true) { APPL_DEBUG("Find type for extention : " << _extention - << " type : " << hlList[iii]->getTypeName()); - return hlList[iii]->getTypeName(); + << " type : " << it->getTypeName()); + return it->getTypeName(); } } return ""; @@ -92,13 +94,12 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type if (_type.size() == 0) { return ""; } - std::vector>& hlList = s_list(); - for (int32_t iii = 0; iii < hlList.size(); ++iii) { - if (hlList[iii] == NULL) { + for (auto &it : s_list()) { + if (it == NULL) { continue; } - if (hlList[iii]->getTypeName() == _type) { - return hlList[iii]->getName(); + if (it->getTypeName() == _type) { + return it->getName(); } } return ""; diff --git a/sources/appl/TextPluginCtags.cpp b/sources/appl/TextPluginCtags.cpp index 32867e4..9ad1d6a 100644 --- a/sources/appl/TextPluginCtags.cpp +++ b/sources/appl/TextPluginCtags.cpp @@ -19,8 +19,8 @@ appl::TextPluginCtags::TextPluginCtags() : - m_tagFilename(""), m_tagFolderBase(""), + m_tagFilename(""), m_ctagFile(NULL) { m_activateOnReceiveMessage = true; // load buffer manager: diff --git a/sources/appl/TextPluginMultiLineTab.cpp b/sources/appl/TextPluginMultiLineTab.cpp index fd1de98..ed1e322 100644 --- a/sources/appl/TextPluginMultiLineTab.cpp +++ b/sources/appl/TextPluginMultiLineTab.cpp @@ -48,22 +48,22 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer, _textDrawer.copy(data, itStart, itStop); // TODO : Change this ... bool m_useTabs = true; - int32_t m_tabDist = 4; + size_t m_tabDist = 4; if (true == _event.getSpecialKey().getShift() ) { // un-indent data.insert(0, 1, u32char::Return); - for (int32_t iii=1; iii