diff --git a/etk/Buffer.h b/etk/Buffer.h index 93ac50b..dd49f1d 100644 --- a/etk/Buffer.h +++ b/etk/Buffer.h @@ -121,7 +121,7 @@ namespace etk { return false; } bool ret = true; - uint32_t length = file.fileSize(); + int64_t length = file.fileSize(); // error case ... if (length > 2000000000) { return false; @@ -204,19 +204,19 @@ namespace etk { tmpBuffer.clear(); if (_pos < m_gapStart) { if (_pos + _nbElement < m_gapStart) { - for (size_t iii = _pos; iii<_pos+_nbElement; ++iii) { + for (int32_t iii = _pos; iii<_pos+_nbElement; ++iii) { tmpBuffer.push_back(m_data[iii]); } } else { - for (size_t iii = _pos; iii class RegExpNodeValue : public etk::RegExpNode::m_RegExpData = _data; TK_REG_EXP_DBG_MODE("Request Parse \"Value\" data=" /*<< etk::displayElem(RegExpNode::m_RegExpData)*/ ); m_data.clear(); - for (int32_t i=0; i::m_RegExpData.size(); i++) { + for (int32_t i=0; i<(int64_t)RegExpNode::m_RegExpData.size(); i++) { m_data.push_back(RegExpNode::m_RegExpData[i]); } return _data.size(); @@ -256,14 +256,14 @@ template class RegExpNodeValue : public etk::RegExpNode::m_multipleMax && tmpFind == true; jjj++) { uint32_t ofset = 0; int64_t kkk; - for (kkk=0; _findLen+kkk<_lenMax && kkk < m_data.size(); kkk++) { - if (m_data[kkk] != _data[_currentPos+_findLen+kkk]) { + for (kkk=0; _findLen+kkk<_lenMax && kkk < (int64_t)m_data.size(); kkk++) { + if (m_data[kkk] != (char32_t)_data[_currentPos+_findLen+kkk]) { tmpFind=false; break; } ofset++; } - if (kkk != m_data.size()) { + if (kkk != (int64_t)m_data.size()) { // parsing not ended ... tmpFind=false; } @@ -320,7 +320,7 @@ template class RegExpNodeBracket : public etk::RegExpNode::m_RegExpData.size(); kkk++) { + for (int32_t kkk=0; kkk<(int64_t)RegExpNode::m_RegExpData.size(); kkk++) { if (RegExpNode::m_RegExpData[kkk] == regexpOpcodeTo && multipleElement == true) { TK_ERROR("Can not have 2 consecutive - in [...]"); return 0; @@ -357,8 +357,8 @@ template class RegExpNodeBracket : public etk::RegExpNode::m_multipleMax && tmpFind ==true && jjj < _lenMax; jjj++) { tmpFind=false; - for (int64_t iii=0; iii class RegExpNodePTheseElem : public etk::RegExpNode tmpData; - while (pos < RegExpNode::m_RegExpData.size()) { + while (pos < (int64_t)RegExpNode::m_RegExpData.size()) { tmpData.clear(); switch (RegExpNode::m_RegExpData[pos]) { case regexpOpcodePTheseIn:{ @@ -1064,7 +1064,7 @@ template class RegExpNodePTheseElem : public etk::RegExpNodeparse(_data, tmpCurrentPos, _lenMax, tmpFindLen)) { _findLen = 0; @@ -1086,7 +1086,7 @@ template class RegExpNodePTheseElem : public etk::RegExpNode::m_multipleMin << "," << RegExpNode::m_multipleMax << "} subdata=" /*<< etk::displayElem(RegExpNode::m_RegExpData) */); - for(int64_t iii=0; iiidisplay(_level+1); } }; @@ -1169,7 +1169,7 @@ template class RegExpNodePThese : public etk::RegExpNode::m_multipleMax && tmpFind == true ; jjj++) { tmpFind = false; - for (int64_t iii=0; iiiparse(_data, _currentPos+_findLen, _lenMax, tmpFindLen)) { _findLen += tmpFindLen; @@ -1191,14 +1191,14 @@ template class RegExpNodePThese : public etk::RegExpNode::m_RegExpData) */); } else { TK_INFO("Find NODE : " << levelSpace(_level) << "@(...)@ {" << RegExpNode::m_multipleMin << "," << RegExpNode::m_multipleMax << "} subdata=" /*<< etk::displayElem(RegExpNode::m_RegExpData) */); - for(int32_t i=0; idisplay(_level+1); } } @@ -1327,9 +1327,9 @@ template class RegExp { int32_t countPTheseOut = 0; int32_t countBracketIn = 0; int32_t countBracketOut = 0; - for (int64_t iii=0; iii<_regexp.size(); iii++) { + for (int64_t iii=0; iii<(int64_t)_regexp.size(); iii++) { if (_regexp[iii] == '\\') { - if(iii+1>=_regexp.size()) { + if(iii+1>=(int64_t)_regexp.size()) { TK_ERROR("Dangerous parse of the element pos " << iii << " \\ with nothing after"); // TODO : Generate Exeption ... return; @@ -1338,7 +1338,7 @@ template class RegExp { // Find the element in the list... for (jjj=0; jjj class RegExp { // find the element in the list... for (jjj=0; jjj class RegExp { tmpExp.erase(tmpExp.end()-1); } - if (tmpExp.size() != m_exprRootNode.generate(tmpExp) ) { + if ((int64_t)tmpExp.size() != (int64_t)m_exprRootNode.generate(tmpExp) ) { return; } // TODO : optimize node here ... @@ -1509,7 +1509,7 @@ template class RegExp { if( _escapeChar != 0 && iii>0) { - if (_escapeChar == _SearchIn[iii-1]) { + if (_escapeChar == (char32_t)_SearchIn[iii-1]) { //==> detected escape char ==> try find again ... continue; } @@ -1585,14 +1585,14 @@ template class RegExp { if( _escapeChar != 0 && _startPos>0) { - if (_escapeChar == _SearchIn[_startPos-1]) { + if (_escapeChar == (char32_t)_SearchIn[_startPos-1]) { //==> detected escape char ==> try find again ... return false; } } // Check end : if (true == m_notEndWithChar) { - if (_startPos+findLen < _SearchIn.size() ) { + if (_startPos+findLen < (int64_t)_SearchIn.size() ) { char32_t tmpVal = _SearchIn[_startPos+findLen]; if( ( tmpVal >= 'a' && tmpVal <= 'z' ) @@ -1670,7 +1670,7 @@ template class RegExp { input = "{x,x}"; } _pos++; - if (_pos >= _tmpExp.size()) { + if (_pos >= (int64_t)_tmpExp.size()) { TK_ERROR("ended with: ( or { or [ ... not permited"); return false; } @@ -1678,7 +1678,7 @@ template class RegExp { // case dependent : if ( curentCode == regexpOpcodeBracketIn || curentCode == regexpOpcodeBracetIn) { - while(_pos<_tmpExp.size()) { + while(_pos<(int64_t)_tmpExp.size()) { //TK_DEBUG("check : " << tmpExp[pos]); // if we find the end : if (endCode == _tmpExp[_pos]) { @@ -1720,7 +1720,7 @@ template class RegExp { _pos++; } } else { - while(_pos< _tmpExp.size()) { + while(_pos< (int64_t)_tmpExp.size()) { if (endCode == _tmpExp[_pos]) { // find the last element return true; @@ -1764,7 +1764,7 @@ template class RegExp { */ bool checkGoodPosition(const std::vector& _tmpExp) { int64_t pos = 0; - while (pos < _tmpExp.size()) { + while (pos < (int64_t)_tmpExp.size()) { //TK_DEBUG("check : " << tmpExp[pos]); if( _tmpExp[pos] == regexpOpcodePTheseIn || _tmpExp[pos] == regexpOpcodeBracketIn