[DEV] remove warning
This commit is contained in:
parent
6bb7f2e911
commit
cfc4d435b4
10
etk/Buffer.h
10
etk/Buffer.h
@ -121,7 +121,7 @@ namespace etk {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
uint32_t length = file.fileSize();
|
int64_t length = file.fileSize();
|
||||||
// error case ...
|
// error case ...
|
||||||
if (length > 2000000000) {
|
if (length > 2000000000) {
|
||||||
return false;
|
return false;
|
||||||
@ -204,19 +204,19 @@ namespace etk {
|
|||||||
tmpBuffer.clear();
|
tmpBuffer.clear();
|
||||||
if (_pos < m_gapStart) {
|
if (_pos < m_gapStart) {
|
||||||
if (_pos + _nbElement < 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]);
|
tmpBuffer.push_back(m_data[iii]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (size_t iii = _pos; iii<m_gapStart; ++iii) {
|
for (int32_t iii = _pos; iii<m_gapStart; ++iii) {
|
||||||
tmpBuffer.push_back(m_data[iii]);
|
tmpBuffer.push_back(m_data[iii]);
|
||||||
}
|
}
|
||||||
for (size_t iii = m_gapEnd; iii<m_gapEnd - (_nbElement - (m_gapStart - _pos)); ++iii) {
|
for (int32_t iii = m_gapEnd; iii<m_gapEnd - (_nbElement - (m_gapStart - _pos)); ++iii) {
|
||||||
tmpBuffer.push_back(m_data[iii]);
|
tmpBuffer.push_back(m_data[iii]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (size_t iii = _pos+(m_gapEnd-m_gapStart);
|
for (int32_t iii = _pos+(m_gapEnd-m_gapStart);
|
||||||
iii<_pos+(m_gapEnd-m_gapStart)+_nbElement;
|
iii<_pos+(m_gapEnd-m_gapStart)+_nbElement;
|
||||||
++iii) {
|
++iii) {
|
||||||
tmpBuffer.push_back(m_data[iii]);
|
tmpBuffer.push_back(m_data[iii]);
|
||||||
|
50
etk/RegExp.h
50
etk/RegExp.h
@ -237,7 +237,7 @@ template<class CLASS_TYPE> class RegExpNodeValue : public etk::RegExpNode<CLASS_
|
|||||||
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
||||||
TK_REG_EXP_DBG_MODE("Request Parse \"Value\" data=" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
TK_REG_EXP_DBG_MODE("Request Parse \"Value\" data=" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
for (int32_t i=0; i<RegExpNode<CLASS_TYPE>::m_RegExpData.size(); i++) {
|
for (int32_t i=0; i<(int64_t)RegExpNode<CLASS_TYPE>::m_RegExpData.size(); i++) {
|
||||||
m_data.push_back(RegExpNode<CLASS_TYPE>::m_RegExpData[i]);
|
m_data.push_back(RegExpNode<CLASS_TYPE>::m_RegExpData[i]);
|
||||||
}
|
}
|
||||||
return _data.size();
|
return _data.size();
|
||||||
@ -256,14 +256,14 @@ template<class CLASS_TYPE> class RegExpNodeValue : public etk::RegExpNode<CLASS_
|
|||||||
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind == true; jjj++) {
|
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind == true; jjj++) {
|
||||||
uint32_t ofset = 0;
|
uint32_t ofset = 0;
|
||||||
int64_t kkk;
|
int64_t kkk;
|
||||||
for (kkk=0; _findLen+kkk<_lenMax && kkk < m_data.size(); kkk++) {
|
for (kkk=0; _findLen+kkk<_lenMax && kkk < (int64_t)m_data.size(); kkk++) {
|
||||||
if (m_data[kkk] != _data[_currentPos+_findLen+kkk]) {
|
if (m_data[kkk] != (char32_t)_data[_currentPos+_findLen+kkk]) {
|
||||||
tmpFind=false;
|
tmpFind=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ofset++;
|
ofset++;
|
||||||
}
|
}
|
||||||
if (kkk != m_data.size()) {
|
if (kkk != (int64_t)m_data.size()) {
|
||||||
// parsing not ended ...
|
// parsing not ended ...
|
||||||
tmpFind=false;
|
tmpFind=false;
|
||||||
}
|
}
|
||||||
@ -320,7 +320,7 @@ template<class CLASS_TYPE> class RegExpNodeBracket : public etk::RegExpNode<CLAS
|
|||||||
char32_t lastElement = 'a';
|
char32_t lastElement = 'a';
|
||||||
bool multipleElement = false;
|
bool multipleElement = false;
|
||||||
//
|
//
|
||||||
for (int32_t kkk=0; kkk<RegExpNode<CLASS_TYPE>::m_RegExpData.size(); kkk++) {
|
for (int32_t kkk=0; kkk<(int64_t)RegExpNode<CLASS_TYPE>::m_RegExpData.size(); kkk++) {
|
||||||
if (RegExpNode<CLASS_TYPE>::m_RegExpData[kkk] == regexpOpcodeTo && multipleElement == true) {
|
if (RegExpNode<CLASS_TYPE>::m_RegExpData[kkk] == regexpOpcodeTo && multipleElement == true) {
|
||||||
TK_ERROR("Can not have 2 consecutive - in [...]");
|
TK_ERROR("Can not have 2 consecutive - in [...]");
|
||||||
return 0;
|
return 0;
|
||||||
@ -357,8 +357,8 @@ template<class CLASS_TYPE> class RegExpNodeBracket : public etk::RegExpNode<CLAS
|
|||||||
uint32_t jjj=0;
|
uint32_t jjj=0;
|
||||||
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind ==true && jjj < _lenMax; jjj++) {
|
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind ==true && jjj < _lenMax; jjj++) {
|
||||||
tmpFind=false;
|
tmpFind=false;
|
||||||
for (int64_t iii=0; iii<m_data.size(); iii++) {
|
for (int64_t iii=0; iii<(int64_t)m_data.size(); iii++) {
|
||||||
if (m_data[iii] == _data[_currentPos+jjj]) {
|
if (m_data[iii] == (char32_t)_data[_currentPos+jjj]) {
|
||||||
_findLen += 1;
|
_findLen += 1;
|
||||||
tmpFind=true;
|
tmpFind=true;
|
||||||
break;
|
break;
|
||||||
@ -935,7 +935,7 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public etk::RegExpNode<C
|
|||||||
int64_t pos = 0;
|
int64_t pos = 0;
|
||||||
int64_t elementSize = 0;
|
int64_t elementSize = 0;
|
||||||
std::vector<char32_t> tmpData;
|
std::vector<char32_t> tmpData;
|
||||||
while (pos < RegExpNode<CLASS_TYPE>::m_RegExpData.size()) {
|
while (pos < (int64_t)RegExpNode<CLASS_TYPE>::m_RegExpData.size()) {
|
||||||
tmpData.clear();
|
tmpData.clear();
|
||||||
switch (RegExpNode<CLASS_TYPE>::m_RegExpData[pos]) {
|
switch (RegExpNode<CLASS_TYPE>::m_RegExpData[pos]) {
|
||||||
case regexpOpcodePTheseIn:{
|
case regexpOpcodePTheseIn:{
|
||||||
@ -1064,7 +1064,7 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public etk::RegExpNode<C
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int64_t tmpCurrentPos = _currentPos;
|
int64_t tmpCurrentPos = _currentPos;
|
||||||
for (int64_t iii=0; iii<m_subNode.size(); iii++) {
|
for (int64_t iii=0; iii<(int64_t)m_subNode.size(); iii++) {
|
||||||
int64_t tmpFindLen;
|
int64_t tmpFindLen;
|
||||||
if (false == m_subNode[iii]->parse(_data, tmpCurrentPos, _lenMax, tmpFindLen)) {
|
if (false == m_subNode[iii]->parse(_data, tmpCurrentPos, _lenMax, tmpFindLen)) {
|
||||||
_findLen = 0;
|
_findLen = 0;
|
||||||
@ -1086,7 +1086,7 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public etk::RegExpNode<C
|
|||||||
<< RegExpNode<CLASS_TYPE>::m_multipleMin << ","
|
<< RegExpNode<CLASS_TYPE>::m_multipleMin << ","
|
||||||
<< RegExpNode<CLASS_TYPE>::m_multipleMax << "} subdata="
|
<< RegExpNode<CLASS_TYPE>::m_multipleMax << "} subdata="
|
||||||
/*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
/*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
||||||
for(int64_t iii=0; iii<m_subNode.size(); iii++) {
|
for(int64_t iii=0; iii<(int64_t)m_subNode.size(); iii++) {
|
||||||
m_subNode[iii]->display(_level+1);
|
m_subNode[iii]->display(_level+1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1169,7 +1169,7 @@ template<class CLASS_TYPE> class RegExpNodePThese : public etk::RegExpNode<CLASS
|
|||||||
int64_t jjj =0;
|
int64_t jjj =0;
|
||||||
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind == true ; jjj++) {
|
for (jjj=0; jjj<RegExpNode<CLASS_TYPE>::m_multipleMax && tmpFind == true ; jjj++) {
|
||||||
tmpFind = false;
|
tmpFind = false;
|
||||||
for (int64_t iii=0; iii<m_subNode.size(); iii++) {
|
for (int64_t iii=0; iii<(int64_t)m_subNode.size(); iii++) {
|
||||||
int64_t tmpFindLen;
|
int64_t tmpFindLen;
|
||||||
if (true == m_subNode[iii]->parse(_data, _currentPos+_findLen, _lenMax, tmpFindLen)) {
|
if (true == m_subNode[iii]->parse(_data, _currentPos+_findLen, _lenMax, tmpFindLen)) {
|
||||||
_findLen += tmpFindLen;
|
_findLen += tmpFindLen;
|
||||||
@ -1191,14 +1191,14 @@ template<class CLASS_TYPE> class RegExpNodePThese : public etk::RegExpNode<CLASS
|
|||||||
};
|
};
|
||||||
|
|
||||||
void display(uint32_t _level) {
|
void display(uint32_t _level) {
|
||||||
if (-1 == _level) {
|
if (9999 <= _level) {
|
||||||
TK_INFO("regExp :" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
TK_INFO("regExp :" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
||||||
} else {
|
} else {
|
||||||
TK_INFO("Find NODE : " << levelSpace(_level) << "@(...)@ {"
|
TK_INFO("Find NODE : " << levelSpace(_level) << "@(...)@ {"
|
||||||
<< RegExpNode<CLASS_TYPE>::m_multipleMin << ","
|
<< RegExpNode<CLASS_TYPE>::m_multipleMin << ","
|
||||||
<< RegExpNode<CLASS_TYPE>::m_multipleMax << "} subdata="
|
<< RegExpNode<CLASS_TYPE>::m_multipleMax << "} subdata="
|
||||||
/*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
/*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData) */);
|
||||||
for(int32_t i=0; i<m_subNode.size(); i++) {
|
for(int64_t i=0; i<(int64_t)m_subNode.size(); i++) {
|
||||||
m_subNode[i]->display(_level+1);
|
m_subNode[i]->display(_level+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1327,9 +1327,9 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
int32_t countPTheseOut = 0;
|
int32_t countPTheseOut = 0;
|
||||||
int32_t countBracketIn = 0;
|
int32_t countBracketIn = 0;
|
||||||
int32_t countBracketOut = 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 (_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");
|
TK_ERROR("Dangerous parse of the element pos " << iii << " \\ with nothing after");
|
||||||
// TODO : Generate Exeption ...
|
// TODO : Generate Exeption ...
|
||||||
return;
|
return;
|
||||||
@ -1338,7 +1338,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
// Find the element in the list...
|
// Find the element in the list...
|
||||||
for (jjj=0; jjj<constConvertionTableSize; jjj++) {
|
for (jjj=0; jjj<constConvertionTableSize; jjj++) {
|
||||||
if( true == constConvertionTable[jjj].haveBackSlash
|
if( true == constConvertionTable[jjj].haveBackSlash
|
||||||
&& _regexp[iii+1] == constConvertionTable[jjj].inputValue)
|
&& _regexp[iii+1] == (char32_t)constConvertionTable[jjj].inputValue)
|
||||||
{
|
{
|
||||||
if (constConvertionTable[jjj].newValue==0) {
|
if (constConvertionTable[jjj].newValue==0) {
|
||||||
tmpExp.push_back(constConvertionTable[jjj].specialChar);
|
tmpExp.push_back(constConvertionTable[jjj].specialChar);
|
||||||
@ -1374,7 +1374,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
// find the element in the list...
|
// find the element in the list...
|
||||||
for (jjj=0; jjj<constConvertionTableSize; jjj++) {
|
for (jjj=0; jjj<constConvertionTableSize; jjj++) {
|
||||||
if( false == constConvertionTable[jjj].haveBackSlash
|
if( false == constConvertionTable[jjj].haveBackSlash
|
||||||
&& _regexp[iii] == constConvertionTable[jjj].inputValue)
|
&& _regexp[iii] == (char32_t)constConvertionTable[jjj].inputValue)
|
||||||
{
|
{
|
||||||
if (constConvertionTable[jjj].newValue==0) {
|
if (constConvertionTable[jjj].newValue==0) {
|
||||||
tmpExp.push_back(constConvertionTable[jjj].specialChar);
|
tmpExp.push_back(constConvertionTable[jjj].specialChar);
|
||||||
@ -1430,7 +1430,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
tmpExp.erase(tmpExp.end()-1);
|
tmpExp.erase(tmpExp.end()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmpExp.size() != m_exprRootNode.generate(tmpExp) ) {
|
if ((int64_t)tmpExp.size() != (int64_t)m_exprRootNode.generate(tmpExp) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO : optimize node here ...
|
// TODO : optimize node here ...
|
||||||
@ -1509,7 +1509,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
if( _escapeChar != 0
|
if( _escapeChar != 0
|
||||||
&& iii>0)
|
&& iii>0)
|
||||||
{
|
{
|
||||||
if (_escapeChar == _SearchIn[iii-1]) {
|
if (_escapeChar == (char32_t)_SearchIn[iii-1]) {
|
||||||
//==> detected escape char ==> try find again ...
|
//==> detected escape char ==> try find again ...
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1585,14 +1585,14 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
if( _escapeChar != 0
|
if( _escapeChar != 0
|
||||||
&& _startPos>0)
|
&& _startPos>0)
|
||||||
{
|
{
|
||||||
if (_escapeChar == _SearchIn[_startPos-1]) {
|
if (_escapeChar == (char32_t)_SearchIn[_startPos-1]) {
|
||||||
//==> detected escape char ==> try find again ...
|
//==> detected escape char ==> try find again ...
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check end :
|
// Check end :
|
||||||
if (true == m_notEndWithChar) {
|
if (true == m_notEndWithChar) {
|
||||||
if (_startPos+findLen < _SearchIn.size() ) {
|
if (_startPos+findLen < (int64_t)_SearchIn.size() ) {
|
||||||
char32_t tmpVal = _SearchIn[_startPos+findLen];
|
char32_t tmpVal = _SearchIn[_startPos+findLen];
|
||||||
if( ( tmpVal >= 'a'
|
if( ( tmpVal >= 'a'
|
||||||
&& tmpVal <= 'z' )
|
&& tmpVal <= 'z' )
|
||||||
@ -1670,7 +1670,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
input = "{x,x}";
|
input = "{x,x}";
|
||||||
}
|
}
|
||||||
_pos++;
|
_pos++;
|
||||||
if (_pos >= _tmpExp.size()) {
|
if (_pos >= (int64_t)_tmpExp.size()) {
|
||||||
TK_ERROR("ended with: ( or { or [ ... not permited");
|
TK_ERROR("ended with: ( or { or [ ... not permited");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1678,7 +1678,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
// case dependent :
|
// case dependent :
|
||||||
if ( curentCode == regexpOpcodeBracketIn
|
if ( curentCode == regexpOpcodeBracketIn
|
||||||
|| curentCode == regexpOpcodeBracetIn) {
|
|| curentCode == regexpOpcodeBracetIn) {
|
||||||
while(_pos<_tmpExp.size()) {
|
while(_pos<(int64_t)_tmpExp.size()) {
|
||||||
//TK_DEBUG("check : " << tmpExp[pos]);
|
//TK_DEBUG("check : " << tmpExp[pos]);
|
||||||
// if we find the end :
|
// if we find the end :
|
||||||
if (endCode == _tmpExp[_pos]) {
|
if (endCode == _tmpExp[_pos]) {
|
||||||
@ -1720,7 +1720,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
_pos++;
|
_pos++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while(_pos< _tmpExp.size()) {
|
while(_pos< (int64_t)_tmpExp.size()) {
|
||||||
if (endCode == _tmpExp[_pos]) {
|
if (endCode == _tmpExp[_pos]) {
|
||||||
// find the last element
|
// find the last element
|
||||||
return true;
|
return true;
|
||||||
@ -1764,7 +1764,7 @@ template<class CLASS_TYPE> class RegExp {
|
|||||||
*/
|
*/
|
||||||
bool checkGoodPosition(const std::vector<char32_t>& _tmpExp) {
|
bool checkGoodPosition(const std::vector<char32_t>& _tmpExp) {
|
||||||
int64_t pos = 0;
|
int64_t pos = 0;
|
||||||
while (pos < _tmpExp.size()) {
|
while (pos < (int64_t)_tmpExp.size()) {
|
||||||
//TK_DEBUG("check : " << tmpExp[pos]);
|
//TK_DEBUG("check : " << tmpExp[pos]);
|
||||||
if( _tmpExp[pos] == regexpOpcodePTheseIn
|
if( _tmpExp[pos] == regexpOpcodePTheseIn
|
||||||
|| _tmpExp[pos] == regexpOpcodeBracketIn
|
|| _tmpExp[pos] == regexpOpcodeBracketIn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user