[DEV] remove compilation warning

This commit is contained in:
Edouard DUPIN 2014-06-02 21:04:35 +02:00
parent 3ec3fa00d9
commit c421bd5f90
11 changed files with 89 additions and 91 deletions

View File

@ -299,7 +299,7 @@ bool appl::Buffer::search(const appl::Buffer::Iterator& _pos,
for (Iterator it = _pos; for (Iterator it = _pos;
(bool)it == true; (bool)it == true;
++it) { ++it) {
if (tolower(*it) == firstElement) { if ((char32_t)tolower(*it) == firstElement) {
// find the first char ==> check next... // find the first char ==> check next...
bool find = true; bool find = true;
Iterator tmp = it; Iterator tmp = it;
@ -371,7 +371,7 @@ bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos,
(bool)it == true; (bool)it == true;
--it) { --it) {
//APPL_DEBUG("compare : " << *it << " ?= " << _search); //APPL_DEBUG("compare : " << *it << " ?= " << _search);
if (tolower(*it) == lastElement) { if ((char32_t)tolower(*it) == lastElement) {
// find the last char ==> check previous... // find the last char ==> check previous...
bool find = true; bool find = true;
_result = it; _result = it;
@ -759,12 +759,12 @@ void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64
} else { } else {
elemStart = startId+1; elemStart = startId+1;
} }
for (int64_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) { for (auto &it : m_HLDataPass1) {
//APPL_DEBUG("move element=" << i); //APPL_DEBUG("move element=" << i);
m_HLDataPass1[iii].beginStart += _nbAdded - _nbDeleted; it.beginStart += _nbAdded - _nbDeleted;
m_HLDataPass1[iii].beginStop += _nbAdded - _nbDeleted; it.beginStop += _nbAdded - _nbDeleted;
m_HLDataPass1[iii].endStart += _nbAdded - _nbDeleted; it.endStart += _nbAdded - _nbDeleted;
m_HLDataPass1[iii].endStop += _nbAdded - _nbDeleted; it.endStop += _nbAdded - _nbDeleted;
} }
//Regenerate Element inside range //Regenerate Element inside range
if ( startId == -1 if ( startId == -1
@ -827,7 +827,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
------------ ------------- ---------- ------------ ------------- ----------
S=-1 *************** E 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) { if (m_HLDataPass1[iii].endStop > _startPos) {
break; break;
} }
@ -848,7 +848,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
} else { } else {
elemStart = _startId+1; 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) { if (m_HLDataPass1[iii].beginStart > _endPos) {
_stopId = iii; _stopId = iii;
break; break;
@ -872,7 +872,7 @@ void appl::Buffer::cleanHighLight() {
appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) { appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) {
int32_t start = etk_max(0, _starPos-1); 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; _starPos = iii;
if ( m_HLDataPass1[iii].beginStart <= _pos if ( m_HLDataPass1[iii].beginStart <= _pos
&& m_HLDataPass1[iii].endStop > _pos) { && m_HLDataPass1[iii].endStop > _pos) {

View File

@ -248,7 +248,7 @@ namespace appl {
}; };
Iterator operator+ (const size_t _val) const { Iterator operator+ (const size_t _val) const {
Iterator tmpp(*this); Iterator tmpp(*this);
for (int64_t iii=0; iii<_val; ++iii) { for (int64_t iii=0; iii<(int64_t)_val; ++iii) {
++tmpp; ++tmpp;
} }
return tmpp; return tmpp;
@ -273,7 +273,7 @@ namespace appl {
}; };
Iterator operator- (const size_t _val) const { Iterator operator- (const size_t _val) const {
Iterator tmpp(*this); Iterator tmpp(*this);
for (int64_t iii=0; iii<_val; ++iii) { for (int64_t iii=0; iii<(int64_t)_val; ++iii) {
--tmpp; --tmpp;
} }
return tmpp; return tmpp;

View File

@ -88,7 +88,7 @@ void appl::BufferManager::onObjectRemove(const ewol::object::Shared<ewol::Object
ewol::object::Shared<appl::Buffer> appl::BufferManager::get(int32_t _id) { ewol::object::Shared<appl::Buffer> appl::BufferManager::get(int32_t _id) {
int32_t id = 0; int32_t id = 0;
for (auto it : m_list) { for (auto &it : m_list) {
if (id == _id) { if (id == _id) {
return it; return it;
} }
@ -98,7 +98,7 @@ ewol::object::Shared<appl::Buffer> appl::BufferManager::get(int32_t _id) {
} }
bool appl::BufferManager::exist(const std::string& _fileName) { bool appl::BufferManager::exist(const std::string& _fileName) {
for (auto it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == nullptr) {
continue; continue;
} }

View File

@ -47,7 +47,7 @@ void appl::GlyphPainting::reload() {
APPL_ERROR("Can not get basic array : 'ednColor'"); APPL_ERROR("Can not get basic array : 'ednColor'");
return; 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); ejson::Object* tmpObj = baseArray->getObject(iii);
if (tmpObj == NULL) { if (tmpObj == NULL) {
APPL_DEBUG(" can not get object in 'ednColor' id=" << iii); APPL_DEBUG(" can not get object in 'ednColor' id=" << iii);
@ -60,7 +60,7 @@ void appl::GlyphPainting::reload() {
bool bold = tmpObj->getBooleanValue("bold", false); bool bold = tmpObj->getBooleanValue("bold", false);
APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'"); APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'");
bool findElement = false; bool findElement = false;
for (int32_t jjj=0; jjj<m_list.size(); ++jjj) { for (size_t jjj=0; jjj<m_list.size(); ++jjj) {
if (m_list[jjj].getName() != name) { if (m_list[jjj].getName() != name) {
continue; continue;
} }
@ -84,7 +84,7 @@ void appl::GlyphPainting::reload() {
int32_t appl::GlyphPainting::request(const std::string& _name) { int32_t appl::GlyphPainting::request(const std::string& _name) {
for (int32_t iii=0; iii<m_list.size(); ++iii) { for (size_t iii=0; iii<m_list.size(); ++iii) {
if (m_list[iii].getName() == _name) { if (m_list[iii].getName() == _name) {
return iii; return iii;
} }

View File

@ -20,12 +20,12 @@
static void SortElementList(std::vector<appl::dataBufferStruct*>& _list) { static void SortElementList(std::vector<appl::dataBufferStruct*>& _list) {
std::vector<appl::dataBufferStruct *> tmpList = _list; std::vector<appl::dataBufferStruct *> tmpList = _list;
_list.clear(); _list.clear();
for(int32_t iii=0; iii<tmpList.size(); iii++) { for(size_t iii=0; iii<tmpList.size(); iii++) {
if (NULL == tmpList[iii]) { if (NULL == tmpList[iii]) {
continue; continue;
} }
int32_t findPos = 0; size_t findPos = 0;
for(int32_t jjj=0; jjj<_list.size(); jjj++) { for(size_t jjj=0; jjj<_list.size(); jjj++) {
//EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\""); //EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\"");
if (_list[jjj] == NULL) { if (_list[jjj] == NULL) {
continue; continue;
@ -68,11 +68,9 @@ BufferView::~BufferView() {
} }
void BufferView::removeAllElement() { void BufferView::removeAllElement() {
for(int32_t iii=0; iii<m_list.size(); iii++) { for(auto &it : m_list) {
if (NULL!=m_list[iii]) { delete(it);
delete(m_list[iii]); it = NULL;
m_list[iii] = NULL;
}
} }
m_list.clear(); m_list.clear();
} }
@ -140,7 +138,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
appl::dataBufferStruct* tmp = m_list[iii]; appl::dataBufferStruct* tmp = m_list[iii];
m_list[iii] = NULL; m_list[iii] = NULL;
m_list.erase(m_list.begin() + iii); m_list.erase(m_list.begin() + iii);
insertAlphabetic(tmp, (iii == m_selectedID)); insertAlphabetic(tmp, ((int64_t)iii == m_selectedID));
break; break;
} }
} }
@ -164,7 +162,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
tmpBuffer = m_bufferManager->getBufferSelected(); tmpBuffer = m_bufferManager->getBufferSelected();
} }
if (tmpBuffer != NULL) { if (tmpBuffer != NULL) {
for (int32_t iii=0; iii<m_list.size(); iii++) { for (size_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii] == NULL) { if (m_list[iii] == NULL) {
continue; continue;
} }
@ -182,8 +180,8 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
// clean The list // clean The list
removeAllElement(); removeAllElement();
// get all the buffer name and properties: // get all the buffer name and properties:
int32_t nbBufferOpen = 0; // BufferManager::size(); size_t nbBufferOpen = 0; // BufferManager::size();
for (int32_t iii=0; iii<nbBufferOpen; iii++) { for (size_t iii=0; iii<nbBufferOpen; iii++) {
/* /*
if (BufferManager::exist(iii)) { if (BufferManager::exist(iii)) {
BufferText* tmpBuffer = BufferManager::get(iii); BufferText* tmpBuffer = BufferManager::get(iii);
@ -209,9 +207,9 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
markToRedraw(); markToRedraw();
}else if (_msg.getMessage() == ednMsgBufferState) { }else if (_msg.getMessage() == ednMsgBufferState) {
// update list of modify section ... // update list of modify section ...
for (int32_t iii=0; iii<m_list.size(); iii++) { for (auto &it : m_list) {
if (NULL!=m_list[iii]) { if (it != nullptr) {
//m_list[iii]->m_isModify = BufferManager::get(m_list[iii]->m_bufferID)->isModify(); //it->m_isModify = BufferManager::get(it->m_bufferID)->isModify();
} }
} }
markToRedraw(); 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) { bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
if( _raw >= 0 if( _raw >= 0
&& _raw<m_list.size() && _raw<(int64_t)m_list.size()
&& NULL != m_list[_raw]) { && m_list[_raw] != nullptr) {
_myTextToWrite = m_list[_raw]->m_bufferName.getNameFile(); _myTextToWrite = m_list[_raw]->m_bufferName.getNameFile();
if ( m_list[_raw]->m_buffer != NULL 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) { if (1 == _IdInput && _typeEvent == ewol::key::statusSingle) {
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
if( _raw >= 0 if( _raw >= 0
&& _raw<m_list.size() && _raw<(int64_t)m_list.size()
&& NULL != m_list[_raw]) { && NULL != m_list[_raw]) {
if (m_list[_raw]->m_buffer != NULL) { if (m_list[_raw]->m_buffer != NULL) {
sendMultiCast(appl::MsgSelectNewFile, m_list[_raw]->m_buffer->getFileName()); sendMultiCast(appl::MsgSelectNewFile, m_list[_raw]->m_buffer->getFileName());

View File

@ -34,11 +34,10 @@ appl::TagFileList::TagFileList() {
appl::TagFileList::~TagFileList() { appl::TagFileList::~TagFileList() {
for (int32_t iii=0; iii<m_list.size(); iii++) { for (auto &it : m_list) {
delete(m_list[iii]); delete(it);
m_list[iii] = NULL; it = NULL;
} }
} }
etk::Color<> appl::TagFileList::getBasicBG() { etk::Color<> 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) { 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) { if (0 == _colomn) {
_myTextToWrite = std::to_string(m_list[_raw]->fileLine); _myTextToWrite = std::to_string(m_list[_raw]->fileLine);
} else { } 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 ); EWOL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
if (_IdInput == 1) { if (_IdInput == 1) {
int32_t previousRaw = m_selectedLine; int32_t previousRaw = m_selectedLine;
if (_raw > m_list.size() ) { if (_raw > (int64_t)m_list.size() ) {
m_selectedLine = -1; m_selectedLine = -1;
} else { } else {
m_selectedLine = _raw; m_selectedLine = _raw;
@ -96,7 +95,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty
event = applEventCtagsListSelect; event = applEventCtagsListSelect;
} }
if( m_selectedLine >= 0 if( m_selectedLine >= 0
&& m_selectedLine < m_list.size() && m_selectedLine < (int64_t)m_list.size()
&& NULL != m_list[m_selectedLine] ) { && NULL != m_list[m_selectedLine] ) {
generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename); generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
} else { } else {

View File

@ -28,7 +28,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() :
return; return;
} }
// List all current open file : // List all current open file :
for (size_t iii=0; iii<m_bufferManager->size(); ++iii) { for (int32_t iii=0; iii<m_bufferManager->size(); ++iii) {
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii); ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
if (tmpBuffer == NULL) { if (tmpBuffer == NULL) {
continue; continue;

View File

@ -56,7 +56,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
int32_t level1 = 0; int32_t level1 = 0;
int32_t level2 = 0; int32_t level2 = 0;
// parse all the elements : // 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); exml::Element* child = root->getElement(iii);
if (child == NULL) { if (child == NULL) {
// trash here all that is not element ... // 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") { } else if (child->getValue() == "pass1") {
// get sub Nodes ... // 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); exml::Element* passChild = child->getElement(jjj);
if (passChild == NULL) { if (passChild == NULL) {
continue; continue;
@ -83,7 +83,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
} }
} else if (child->getValue() == "pass2") { } else if (child->getValue() == "pass2") {
// get sub Nodes ... // 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); exml::Element* passChild = child->getElement(jjj);
if (passChild == NULL) { if (passChild == NULL) {
continue; continue;
@ -110,10 +110,10 @@ appl::Highlight::~Highlight() {
} }
bool appl::Highlight::hasExtention(const std::string& _ext) { bool appl::Highlight::hasExtention(const std::string& _ext) {
for (int32_t iii=0; iii<m_listExtentions.size(); iii++) { for (auto &it : m_listExtentions) {
APPL_VERBOSE(" check : " << m_listExtentions[iii] << "=?=" << _ext); APPL_VERBOSE(" check : " << it << "=?=" << _ext);
if ( m_listExtentions[iii] == "*." + _ext if ( it == "*." + _ext
|| m_listExtentions[iii] == _ext) { || it == _ext) {
return true; return true;
} }
} }
@ -131,8 +131,8 @@ bool appl::Highlight::fileNameCompatible(const std::string& _fileName) {
} }
APPL_DEBUG(" try to find : in \"" << file << "\" extention:\"" << extention << "\" "); APPL_DEBUG(" try to find : in \"" << file << "\" extention:\"" << extention << "\" ");
for (int32_t iii=0; iii<m_listExtentions.size(); iii++) { for (auto &it : m_listExtentions) {
if (extention == m_listExtentions[iii] ) { if (extention == it ) {
return true; return true;
} }
} }
@ -142,17 +142,17 @@ bool appl::Highlight::fileNameCompatible(const std::string& _fileName) {
void appl::Highlight::display() { void appl::Highlight::display() {
APPL_INFO("List of ALL Highlight : "); APPL_INFO("List of ALL Highlight : ");
for (int32_t iii=0; iii< m_listExtentions.size(); iii++) { for (auto &it : m_listExtentions) {
APPL_INFO(" Extention : " << iii << " : " << m_listExtentions[iii] ); APPL_INFO(" Extention : " << it );
} }
// display all elements // display all elements
for (int32_t iii=0; iii< m_listHighlightPass1.size(); iii++) { for (auto &it : m_listHighlightPass1) {
APPL_INFO(" " << iii << " Pass 1 : " << m_listHighlightPass1[iii]->getName() ); APPL_INFO(" Pass 1 : " << it->getName() );
//m_listHighlightPass1[iii]->display(); //m_listHighlightPass1[iii]->display();
} }
// display all elements // display all elements
for (int32_t iii=0; iii< m_listHighlightPass2.size(); iii++) { for (auto &it : m_listHighlightPass2) {
APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->getName() ); APPL_INFO(" pass 2 : " << it->getName() );
//m_listHighlightPass2[iii]->display(); //m_listHighlightPass2[iii]->display();
} }
} }
@ -175,7 +175,7 @@ void appl::Highlight::parse(int64_t _start,
while (elementStart <= elementStop) { while (elementStart <= elementStop) {
HL_DEBUG("Parse element in the buffer pos=" << elementStart); HL_DEBUG("Parse element in the buffer pos=" << elementStart);
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
for (int64_t jjj=0; jjj<m_listHighlightPass1.size(); jjj++){ for (int64_t jjj=0; jjj<(int64_t)m_listHighlightPass1.size(); jjj++){
enum resultFind ret = HLP_FIND_OK; enum resultFind ret = HLP_FIND_OK;
HL_DEBUG("Parse HL id=" << jjj << " position search: (" << elementStart << "," << _stop << ")" ); HL_DEBUG("Parse HL id=" << jjj << " position search: (" << elementStart << "," << _stop << ")" );
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
@ -184,13 +184,13 @@ void appl::Highlight::parse(int64_t _start,
HL_DEBUG("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); HL_DEBUG("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
// remove element in the current List where the current Element have a end inside the next... // remove element in the current List where the current Element have a end inside the next...
int64_t kkk=_addingPos; int64_t kkk=_addingPos;
while(kkk < _metaData.size() ) { while(kkk < (int64_t)_metaData.size() ) {
if (_metaData[kkk].beginStart <= resultat.endStop) { if (_metaData[kkk].beginStart <= resultat.endStop) {
// remove element // remove element
HL_DEBUG("Erase element=" << kkk); HL_DEBUG("Erase element=" << kkk);
_metaData.erase(_metaData.begin()+kkk, _metaData.begin()+kkk+1); _metaData.erase(_metaData.begin()+kkk, _metaData.begin()+kkk+1);
// Increase the end of search // Increase the end of search
if (kkk < _metaData.size()) { if (kkk < (int64_t)_metaData.size()) {
// just befor the end of the next element // just befor the end of the next element
elementStop = _metaData[kkk].beginStart-1; elementStop = _metaData[kkk].beginStart-1;
} else { } else {
@ -236,7 +236,7 @@ void appl::Highlight::parse2(int64_t _start,
while (elementStart < elementStop) { while (elementStart < elementStop) {
//HL2_DEBUG("Parse element in the buffer pos=" << elementStart << "," << _buffer.size() << ")" ); //HL2_DEBUG("Parse element in the buffer pos=" << elementStart << "," << _buffer.size() << ")" );
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
for (int64_t jjj=0; jjj<m_listHighlightPass2.size(); jjj++){ for (int64_t jjj=0; jjj<(int64_t)m_listHighlightPass2.size(); jjj++){
enum resultFind ret = HLP_FIND_OK; enum resultFind ret = HLP_FIND_OK;
HL2_DEBUG("Parse HL id=" << jjj << " position search: (" << HL2_DEBUG("Parse HL id=" << jjj << " position search: (" <<
_start << "," << _buffer.size() << ")" ); _start << "," << _buffer.size() << ")" );

View File

@ -15,6 +15,8 @@
#undef __class__ #undef __class__
#define __class__ "highlightManager" #define __class__ "highlightManager"
// TODO : Review this in a generic unique resource ...
static std::vector<ewol::object::Shared<appl::Highlight>>& s_list() { static std::vector<ewol::object::Shared<appl::Highlight>>& s_list() {
static std::vector<ewol::object::Shared<appl::Highlight>> list; static std::vector<ewol::object::Shared<appl::Highlight>> list;
return list; return list;
@ -31,14 +33,14 @@ void appl::highlightManager::init() {
etk::FSNode myFile("DATA:languages/"); etk::FSNode myFile("DATA:languages/");
// get the subfolder list : // get the subfolder list :
std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false); std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
for (int32_t iii = 0; iii < list.size(); ++iii) { for (auto &it : list) {
if (list[iii] == NULL) { if (it == NULL) {
continue; continue;
} }
if (list[iii]->getNodeType() != etk::FSN_FOLDER) { if (it->getNodeType() != etk::FSN_FOLDER) {
continue; continue;
} }
std::string filename = list[iii]->getName() + "/highlight.xml"; std::string filename = it->getName() + "/highlight.xml";
APPL_DEBUG("Load xml name : " << filename); APPL_DEBUG("Load xml name : " << filename);
ewol::object::Shared<appl::Highlight> myHightLine = appl::Highlight::keep(filename); ewol::object::Shared<appl::Highlight> myHightLine = appl::Highlight::keep(filename);
if (myHightLine != NULL) { if (myHightLine != NULL) {
@ -49,11 +51,11 @@ void appl::highlightManager::init() {
} }
// display : // display :
/* /*
for (int32_t iii = 0; iii < hlList.size(); ++iii) { for (auto &it : hlList) {
if (hlList[iii] == NULL) { if (it == NULL) {
continue; 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"); APPL_DEBUG("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list(); std::vector<ewol::object::Shared<Highlight>>& hlList = s_list();
for (int32_t iii = 0; iii < hlList.size(); ++iii) { for (auto &it : hlList) {
if (hlList[iii] == NULL) { if (it == NULL) {
continue; continue;
} }
APPL_DEBUG(" check : " << hlList[iii]->getTypeName()); APPL_DEBUG(" check : " << it->getTypeName());
if (hlList[iii]->hasExtention(_extention) == true) { if (it->hasExtention(_extention) == true) {
APPL_DEBUG("Find type for extention : " << _extention APPL_DEBUG("Find type for extention : " << _extention
<< " type : " << hlList[iii]->getTypeName()); << " type : " << it->getTypeName());
return hlList[iii]->getTypeName(); return it->getTypeName();
} }
} }
return ""; return "";
@ -92,13 +94,12 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type
if (_type.size() == 0) { if (_type.size() == 0) {
return ""; return "";
} }
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list(); for (auto &it : s_list()) {
for (int32_t iii = 0; iii < hlList.size(); ++iii) { if (it == NULL) {
if (hlList[iii] == NULL) {
continue; continue;
} }
if (hlList[iii]->getTypeName() == _type) { if (it->getTypeName() == _type) {
return hlList[iii]->getName(); return it->getName();
} }
} }
return ""; return "";

View File

@ -19,8 +19,8 @@
appl::TextPluginCtags::TextPluginCtags() : appl::TextPluginCtags::TextPluginCtags() :
m_tagFilename(""),
m_tagFolderBase(""), m_tagFolderBase(""),
m_tagFilename(""),
m_ctagFile(NULL) { m_ctagFile(NULL) {
m_activateOnReceiveMessage = true; m_activateOnReceiveMessage = true;
// load buffer manager: // load buffer manager:

View File

@ -48,22 +48,22 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
_textDrawer.copy(data, itStart, itStop); _textDrawer.copy(data, itStart, itStop);
// TODO : Change this ... // TODO : Change this ...
bool m_useTabs = true; bool m_useTabs = true;
int32_t m_tabDist = 4; size_t m_tabDist = 4;
if (true == _event.getSpecialKey().getShift() ) { if (true == _event.getSpecialKey().getShift() ) {
// un-indent // un-indent
data.insert(0, 1, u32char::Return); data.insert(0, 1, u32char::Return);
for (int32_t iii=1; iii<data.size(); ++iii) { for (size_t iii=1; iii<data.size(); ++iii) {
if (data[iii-1] != u32char::Return) { if ((char32_t)data[iii-1] != u32char::Return) {
continue; continue;
} }
if(data[iii] == u32char::Tabulation) { if((char32_t)data[iii] == u32char::Tabulation) {
data.erase(iii, 1); data.erase(iii, 1);
} else if(data[iii] == u32char::Space) { } else if((char32_t)data[iii] == u32char::Space) {
for (int32_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) { for (size_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
if(data[iii] == u32char::Space) { if((char32_t)data[iii] == u32char::Space) {
data.erase(iii, 1); data.erase(iii, 1);
} else if(data[iii] == u32char::Tabulation) { } else if((char32_t)data[iii] == u32char::Tabulation) {
data.erase(iii, 1); data.erase(iii, 1);
break; break;
} else { } else {
@ -76,8 +76,8 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
} else { } else {
// indent // indent
data.insert(0, 1, u32char::Return); data.insert(0, 1, u32char::Return);
for (int32_t iii=1; iii<data.size(); iii++) { for (size_t iii=1; iii<data.size(); iii++) {
if (data[iii-1] != u32char::Return) { if ((char32_t)data[iii-1] != u32char::Return) {
continue; continue;
} }
if (true == _event.getSpecialKey().getCtrl() ) { if (true == _event.getSpecialKey().getCtrl() ) {