[DEV] add extra compilation flags & correct warning

This commit is contained in:
Edouard DUPIN 2013-11-27 21:33:34 +01:00
parent c24b20b9d2
commit 0cfb9c2130
11 changed files with 54 additions and 51 deletions

View File

@ -35,8 +35,8 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
EXML_VERBOSE("start parse : 'attribute'"); EXML_VERBOSE("start parse : 'attribute'");
m_pos = _filePos; m_pos = _filePos;
// search end of the comment : // search end of the comment :
int32_t lastElementName = _pos; size_t lastElementName = _pos;
for (int32_t iii=_pos; iii<_data.size(); iii++) { for (size_t iii=_pos; iii<_data.size(); iii++) {
_filePos.check(_data[iii]); _filePos.check(_data[iii]);
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
@ -73,8 +73,8 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
if (_data[lastElementName+white+2] != '"') { if (_data[lastElementName+white+2] != '"') {
// parse with no element " == > direct value separate with space ... // parse with no element " == > direct value separate with space ...
++_filePos; ++_filePos;
int32_t lastAttributePos = lastElementName+white+2; size_t lastAttributePos = lastElementName+white+2;
for (int32_t iii=lastElementName+white+2; iii<_data.size(); iii++) { for (size_t iii=lastElementName+white+2; iii<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif
@ -98,8 +98,8 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
_pos = lastAttributePos-1; _pos = lastAttributePos-1;
return true; return true;
} }
int32_t lastAttributePos = lastElementName+white+3; size_t lastAttributePos = lastElementName+white+3;
for (int32_t iii=lastElementName+white+3; iii<_data.size(); iii++) { for (size_t iii=lastElementName+white+3; iii<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif

View File

@ -13,7 +13,7 @@
#define __class__ "AttributeList" #define __class__ "AttributeList"
exml::AttributeList::~AttributeList(void) { exml::AttributeList::~AttributeList(void) {
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if (NULL!=m_listAttribute[iii]) { if (NULL!=m_listAttribute[iii]) {
delete(m_listAttribute[iii]); delete(m_listAttribute[iii]);
m_listAttribute[iii]=NULL; m_listAttribute[iii]=NULL;
@ -23,14 +23,14 @@ exml::AttributeList::~AttributeList(void) {
} }
exml::Attribute* exml::AttributeList::getAttr(int32_t _id) { exml::Attribute* exml::AttributeList::getAttr(int32_t _id) {
if (_id <0 || _id>m_listAttribute.size()) { if (_id <0 || (size_t)_id>m_listAttribute.size()) {
return NULL; return NULL;
} }
return m_listAttribute[_id]; return m_listAttribute[_id];
} }
const exml::Attribute* exml::AttributeList::getAttr(int32_t _id) const { const exml::Attribute* exml::AttributeList::getAttr(int32_t _id) const {
if (_id <0 || _id>m_listAttribute.size()) { if (_id <0 || (size_t)_id>m_listAttribute.size()) {
return NULL; return NULL;
} }
return m_listAttribute[_id]; return m_listAttribute[_id];
@ -41,7 +41,7 @@ void exml::AttributeList::appendAttribute(exml::Attribute* _attr) {
EXML_ERROR("Try to set an empty node"); EXML_ERROR("Try to set an empty node");
return; return;
} }
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if (m_listAttribute[iii] == _attr) { if (m_listAttribute[iii] == _attr) {
EXML_ERROR("Try to add a node that is already added befor !!!"); EXML_ERROR("Try to add a node that is already added befor !!!");
return; return;
@ -55,7 +55,7 @@ const std::string& exml::AttributeList::getAttribute(const std::string& _name) c
if (_name.size() == 0) { if (_name.size() == 0) {
return errorReturn; return errorReturn;
} }
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
return m_listAttribute[iii]->getValue(); return m_listAttribute[iii]->getValue();
@ -69,7 +69,7 @@ std::u32string exml::AttributeList::getAttribute(const std::u32string& _name) co
if (_name.size() == 0) { if (_name.size() == 0) {
return errorReturn; return errorReturn;
} }
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getUName() == _name) { && m_listAttribute[iii]->getUName() == _name) {
return m_listAttribute[iii]->getUValue(); return m_listAttribute[iii]->getUValue();
@ -82,7 +82,7 @@ bool exml::AttributeList::existAttribute(const std::string& _name) const {
if (_name.size() == 0) { if (_name.size() == 0) {
return false; return false;
} }
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
return true; return true;
@ -95,7 +95,7 @@ bool exml::AttributeList::existAttribute(const std::u32string& _name) const {
if (_name.size() == 0) { if (_name.size() == 0) {
return false; return false;
} }
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getUName() == _name) { && m_listAttribute[iii]->getUName() == _name) {
return true; return true;
@ -106,7 +106,7 @@ bool exml::AttributeList::existAttribute(const std::u32string& _name) const {
void exml::AttributeList::setAttribute(const std::string& _name, const std::string& _value) { void exml::AttributeList::setAttribute(const std::string& _name, const std::string& _value) {
// check if attribute already det : // check if attribute already det :
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
// update the value : // update the value :
@ -123,7 +123,7 @@ void exml::AttributeList::setAttribute(const std::string& _name, const std::stri
void exml::AttributeList::setAttribute(const std::u32string& _name, const std::u32string& _value) { void exml::AttributeList::setAttribute(const std::u32string& _name, const std::u32string& _value) {
// check if attribute already det : // check if attribute already det :
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( NULL != m_listAttribute[iii] if( NULL != m_listAttribute[iii]
&& m_listAttribute[iii]->getUName() == _name) { && m_listAttribute[iii]->getUName() == _name) {
// update the value : // update the value :
@ -139,7 +139,7 @@ void exml::AttributeList::setAttribute(const std::u32string& _name, const std::u
} }
bool exml::AttributeList::iGenerate(std::string& _data, int32_t _indent) const { bool exml::AttributeList::iGenerate(std::string& _data, int32_t _indent) const {
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if (NULL!=m_listAttribute[iii]) { if (NULL!=m_listAttribute[iii]) {
m_listAttribute[iii]->iGenerate(_data, _indent); m_listAttribute[iii]->iGenerate(_data, _indent);
} }
@ -149,7 +149,7 @@ bool exml::AttributeList::iGenerate(std::string& _data, int32_t _indent) const {
void exml::AttributeList::clear(void) { void exml::AttributeList::clear(void) {
exml::Node::clear(); exml::Node::clear();
for (int32_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if (NULL!=m_listAttribute[iii]) { if (NULL!=m_listAttribute[iii]) {
delete(m_listAttribute[iii]); delete(m_listAttribute[iii]);
m_listAttribute[iii]=NULL; m_listAttribute[iii]=NULL;

View File

@ -43,7 +43,7 @@ namespace exml {
* @brief get the number of attribute in the Node * @brief get the number of attribute in the Node
* @return Nulber of attribute >=0 * @return Nulber of attribute >=0
*/ */
int32_t sizeAttribute(void) const { size_t sizeAttribute(void) const {
return m_listAttribute.size(); return m_listAttribute.size();
}; };
/** /**

View File

@ -20,7 +20,7 @@ bool exml::Comment::iParse(const std::string& _data, int32_t& _pos, bool _caseSe
int32_t white = countWhiteChar(_data, _pos, tmpPos); int32_t white = countWhiteChar(_data, _pos, tmpPos);
_filePos += tmpPos; _filePos += tmpPos;
// search end of the comment : // search end of the comment :
for (int32_t iii=_pos+white; iii+2<_data.size(); iii++) { for (size_t iii=_pos+white; iii+2<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif

View File

@ -69,7 +69,7 @@ bool exml::Declaration::iParse(const std::string& _data, int32_t& _pos, bool _ca
EXML_VERBOSE("start parse : 'declaration' : '" << m_value << "'"); EXML_VERBOSE("start parse : 'declaration' : '" << m_value << "'");
m_pos = _filePos; m_pos = _filePos;
// search end of the comment : // search end of the comment :
for (int32_t iii=_pos; iii+1<_data.size(); iii++) { for (size_t iii=_pos; iii+1<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif

View File

@ -25,7 +25,7 @@ exml::Document::Document(void) :
bool exml::Document::iGenerate(std::string& _data, int32_t _indent) const { bool exml::Document::iGenerate(std::string& _data, int32_t _indent) const {
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (NULL!=m_listSub[iii]) { if (NULL!=m_listSub[iii]) {
m_listSub[iii]->iGenerate(_data, _indent); m_listSub[iii]->iGenerate(_data, _indent);
} }
@ -116,7 +116,7 @@ bool exml::Document::store(const std::string& _file) {
EXML_ERROR("Can not open (w) the file : " << _file); EXML_ERROR("Can not open (w) the file : " << _file);
return false; return false;
} }
if (tmpFile.fileWrite((char*)createData.c_str(), sizeof(char), createData.size()) != createData.size()) { if (tmpFile.fileWrite((char*)createData.c_str(), sizeof(char), createData.size()) != (int64_t)createData.size()) {
EXML_ERROR("Error while writing output XML file : " << _file); EXML_ERROR("Error while writing output XML file : " << _file);
tmpFile.fileClose(); tmpFile.fileClose();
return false; return false;
@ -133,15 +133,15 @@ void exml::Document::display(void) {
std::string createPosPointer(const std::string& _line, int32_t _pos) { std::string createPosPointer(const std::string& _line, int32_t _pos) {
std::string out; std::string out;
int32_t iii; size_t iii;
for (iii=0; iii<_pos && iii<_line.size(); iii++) { for (iii=0; (int64_t)iii<_pos && iii<_line.size(); iii++) {
if (_line[iii] == '\t') { if (_line[iii] == '\t') {
out += "\t"; out += "\t";
} else { } else {
out += " "; out += " ";
} }
} }
for (; iii<_pos; iii++) { for (; (int64_t)iii<_pos; iii++) {
out += " "; out += " ";
} }
out += "^"; out += "^";

View File

@ -19,7 +19,7 @@
exml::Element::~Element(void) { exml::Element::~Element(void) {
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (NULL!=m_listSub[iii]) { if (NULL!=m_listSub[iii]) {
delete(m_listSub[iii]); delete(m_listSub[iii]);
m_listSub[iii]=NULL; m_listSub[iii]=NULL;
@ -44,14 +44,14 @@ const enum exml::nodeType exml::Element::getType(int32_t _id) const {
} }
exml::Node* exml::Element::getNode(int32_t _id) { exml::Node* exml::Element::getNode(int32_t _id) {
if (_id <0 || _id>m_listSub.size()) { if (_id <0 || (size_t)_id>m_listSub.size()) {
return NULL; return NULL;
} }
return m_listSub[_id]; return m_listSub[_id];
} }
const exml::Node* exml::Element::getNode(int32_t _id) const { const exml::Node* exml::Element::getNode(int32_t _id) const {
if (_id <0 || _id>m_listSub.size()) { if (_id <0 || (size_t)_id>m_listSub.size()) {
return NULL; return NULL;
} }
return m_listSub[_id]; return m_listSub[_id];
@ -78,7 +78,7 @@ exml::Element* exml::Element::getNamed(const std::string& _name) {
if (_name.size() == 0) { if (_name.size() == 0) {
return NULL; return NULL;
} }
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if( NULL != m_listSub[iii] if( NULL != m_listSub[iii]
&& m_listSub[iii]->getType() == exml::typeElement && m_listSub[iii]->getType() == exml::typeElement
&& m_listSub[iii]->getValue() == _name) { && m_listSub[iii]->getValue() == _name) {
@ -98,7 +98,7 @@ const exml::Element* exml::Element::getNamed(const std::string& _name) const {
if (_name.size() == 0) { if (_name.size() == 0) {
return NULL; return NULL;
} }
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if( NULL != m_listSub[iii] if( NULL != m_listSub[iii]
&& m_listSub[iii]->getType() == exml::typeElement && m_listSub[iii]->getType() == exml::typeElement
&& m_listSub[iii]->getValue() == _name) { && m_listSub[iii]->getValue() == _name) {
@ -123,7 +123,7 @@ void exml::Element::append(exml::Node* _node) {
appendAttribute(_node->toAttribute()); appendAttribute(_node->toAttribute());
return; return;
} }
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (m_listSub[iii] == _node) { if (m_listSub[iii] == _node) {
EXML_ERROR("Try to add a node that is already added before !!!"); EXML_ERROR("Try to add a node that is already added before !!!");
return; return;
@ -135,7 +135,7 @@ void exml::Element::append(exml::Node* _node) {
std::string exml::Element::getText(void) { std::string exml::Element::getText(void) {
// TODO : add more capabilities ... // TODO : add more capabilities ...
std::string res; std::string res;
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (NULL!=m_listSub[iii]) { if (NULL!=m_listSub[iii]) {
m_listSub[iii]->iGenerate(res, 0); m_listSub[iii]->iGenerate(res, 0);
} }
@ -159,7 +159,7 @@ bool exml::Element::iGenerate(std::string& _data, int32_t _indent) const {
} else { } else {
_data += ">\n"; _data += ">\n";
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (NULL!=m_listSub[iii]) { if (NULL!=m_listSub[iii]) {
m_listSub[iii]->iGenerate(_data, _indent+1); m_listSub[iii]->iGenerate(_data, _indent+1);
} }
@ -178,7 +178,7 @@ bool exml::Element::iGenerate(std::string& _data, int32_t _indent) const {
bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _caseSensitive, exml::filePos& _filePos, exml::Document& _doc, bool _mainNode) { bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _caseSensitive, exml::filePos& _filePos, exml::Document& _doc, bool _mainNode) {
EXML_PARSE_ELEMENT(" start subParse ... " << _pos << " " << _filePos); EXML_PARSE_ELEMENT(" start subParse ... " << _pos << " " << _filePos);
for (int32_t iii=_pos; iii<_data.size(); iii++) { for (size_t iii=_pos; iii<_data.size(); iii++) {
_filePos.check(_data[iii]); _filePos.check(_data[iii]);
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
@ -208,9 +208,9 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
return false; return false;
} }
//EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'"); //EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'");
int32_t endPosName = iii+white+1; size_t endPosName = iii+white+1;
// generate element name ... // generate element name ...
for (int32_t jjj=iii+white+2; jjj<_data.size(); jjj++) { for (size_t jjj=iii+white+2; jjj<_data.size(); jjj++) {
if(true == checkAvaillable(_data[jjj], false) ) { if(true == checkAvaillable(_data[jjj], false) ) {
// we find the end ... // we find the end ...
endPosName = jjj; endPosName = jjj;
@ -311,9 +311,9 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
if(_data[iii+white+1] == '/') { if(_data[iii+white+1] == '/') {
++tmpPos; ++tmpPos;
//EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'"); //EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'");
int32_t endPosName = iii+white+1; size_t endPosName = iii+white+1;
// generate element name ... // generate element name ...
for (int32_t jjj=iii+white+2; jjj<_data.size(); jjj++) { for (size_t jjj=iii+white+2; jjj<_data.size(); jjj++) {
if(true == checkAvaillable(_data[jjj], false) ) { if(true == checkAvaillable(_data[jjj], false) ) {
// we find the end ... // we find the end ...
endPosName = jjj; endPosName = jjj;
@ -329,7 +329,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
if( tmpname == m_value) { if( tmpname == m_value) {
// find end of node : // find end of node :
// find > element ... // find > element ...
for (int32_t jjj=endPosName+1; jjj<_data.size(); jjj++) { for (size_t jjj=endPosName+1; jjj<_data.size(); jjj++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[jjj], _filePos); drawElementParsed(_data[jjj], _filePos);
#endif #endif
@ -362,9 +362,9 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
if (checkAvaillable(_data[iii+white+1], true) == true) { if (checkAvaillable(_data[iii+white+1], true) == true) {
++tmpPos; ++tmpPos;
//EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'"); //EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'");
int32_t endPosName = iii+white+1; size_t endPosName = iii+white+1;
// generate element name ... // generate element name ...
for (int32_t jjj=iii+white+2; jjj<_data.size(); jjj++) { for (size_t jjj=iii+white+2; jjj<_data.size(); jjj++) {
if(checkAvaillable(_data[jjj], false) == true) { if(checkAvaillable(_data[jjj], false) == true) {
// we find the end ... // we find the end ...
endPosName = jjj; endPosName = jjj;
@ -439,7 +439,7 @@ bool exml::Element::iParse(const std::string& _data, int32_t& _pos, bool _caseSe
// note : When start parsing the upper element must have set the value of the element and set the position after this one // note : When start parsing the upper element must have set the value of the element and set the position after this one
m_pos=_filePos; m_pos=_filePos;
// find a normal node ... // find a normal node ...
for (int32_t iii=_pos; iii<_data.size(); iii++) { for (size_t iii=_pos; iii<_data.size(); iii++) {
_filePos.check(_data[iii]); _filePos.check(_data[iii]);
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
@ -491,7 +491,7 @@ bool exml::Element::iParse(const std::string& _data, int32_t& _pos, bool _caseSe
void exml::Element::clear(void) { void exml::Element::clear(void) {
exml::AttributeList::clear(); exml::AttributeList::clear();
for (int32_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (NULL!=m_listSub[iii]) { if (NULL!=m_listSub[iii]) {
delete(m_listSub[iii]); delete(m_listSub[iii]);
m_listSub[iii]=NULL; m_listSub[iii]=NULL;

View File

@ -43,7 +43,7 @@ namespace exml {
* @brief get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::Declaration). * @brief get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::Declaration).
* @return a number >=0. * @return a number >=0.
*/ */
int32_t size(void) const { size_t size(void) const {
return m_listSub.size(); return m_listSub.size();
}; };
/** /**

View File

@ -99,7 +99,7 @@ bool exml::Node::checkAvaillable(char32_t _val, bool _firstChar) const {
int32_t exml::Node::countWhiteChar(const std::string& _data, int32_t _pos, exml::filePos& _filePos) const { int32_t exml::Node::countWhiteChar(const std::string& _data, int32_t _pos, exml::filePos& _filePos) const {
_filePos.clear(); _filePos.clear();
int32_t white=0; int32_t white=0;
for (int32_t iii=_pos; iii<_data.size(); iii++) { for (size_t iii=_pos; iii<_data.size(); iii++) {
_filePos.check(_data[iii]); _filePos.check(_data[iii]);
if(true == etk::isWhiteChar(_data[iii])) { if(true == etk::isWhiteChar(_data[iii])) {
white++; white++;

View File

@ -20,7 +20,7 @@ bool exml::Text::iGenerate(std::string& _data, int32_t _indent) const {
int32_t exml::Text::countLines(void) const { int32_t exml::Text::countLines(void) const {
int32_t count = 1; int32_t count = 1;
for (int32_t iii=0; iii<m_value.size(); iii++) { for (size_t iii=0; iii<m_value.size(); iii++) {
if(m_value[iii] == '\n') { if(m_value[iii] == '\n') {
count++; count++;
} }
@ -32,7 +32,7 @@ bool exml::Text::iParse(const std::string& _data, int32_t& _pos, bool _caseSensi
EXML_VERBOSE("start parse : 'text'"); EXML_VERBOSE("start parse : 'text'");
m_pos = _filePos; m_pos = _filePos;
// search end of the comment : // search end of the comment :
for (int32_t iii=_pos; iii<_data.size(); iii++) { for (size_t iii=_pos; iii<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif
@ -42,8 +42,8 @@ bool exml::Text::iParse(const std::string& _data, int32_t& _pos, bool _caseSensi
if( _data[iii] == '>' if( _data[iii] == '>'
|| _data[iii] == '<') { || _data[iii] == '<') {
// search whitespace : // search whitespace :
int32_t newEnd=iii; size_t newEnd=iii;
for( int32_t jjj=iii-1; jjj>_pos; jjj--) { for (int64_t jjj=(int64_t)iii-1; jjj>(int64_t)_pos; --jjj) {
if(true == etk::isWhiteChar(_data[jjj])) { if(true == etk::isWhiteChar(_data[jjj])) {
newEnd = jjj; newEnd = jjj;
} else { } else {
@ -66,7 +66,7 @@ bool exml::TextCDATA::iParse(const std::string& _data, int32_t& _pos, bool _case
EXML_VERBOSE("start parse : 'text::CDATA'"); EXML_VERBOSE("start parse : 'text::CDATA'");
m_pos = _filePos; m_pos = _filePos;
// search end of the comment : // search end of the comment :
for (int32_t iii=_pos; iii+2<_data.size(); iii++) { for (size_t iii=_pos; iii+2<_data.size(); iii++) {
#ifdef ENABLE_DISPLAY_PARSED_ELEMENT #ifdef ENABLE_DISPLAY_PARSED_ELEMENT
drawElementParsed(_data[iii], _filePos); drawElementParsed(_data[iii], _filePos);
#endif #endif

View File

@ -7,6 +7,9 @@ def Create(target):
myModule.AddModuleDepend(['etk']) myModule.AddModuleDepend(['etk'])
# add extra compilation flags :
myModule.add_extra_compile_flags()
# add sources files
myModule.AddSrcFile([ myModule.AddSrcFile([
'exml/debug.cpp', 'exml/debug.cpp',
'exml/Attribute.cpp', 'exml/Attribute.cpp',