[DEV] add extra compilation flags & correct warning

This commit is contained in:
2013-11-27 21:33:34 +01:00
parent cb20c0af2d
commit 357a8baa9a
15 changed files with 191 additions and 59 deletions

View File

@@ -248,7 +248,7 @@ bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos, const char32_t
--it) {
//APPL_DEBUG("compare : " << *it << " ?= " << _search);
if (*it == _search) {
//APPL_DEBUG("find : " << (esize_t)it);
//APPL_DEBUG("find : " << (int32_t)it);
_result = it;
return true;
}
@@ -525,7 +525,7 @@ static const char *ControlCodeTable[32] = {
"NUL", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "np", "cr", "so", "si",
"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us"};
void appl::Buffer::expand(esize_t& _indent, const char32_t& _value, std::u32string& _out) const {
void appl::Buffer::expand(int32_t& _indent, const char32_t& _value, std::u32string& _out) const {
_out.clear();
int32_t tabDist = 4;
if (_value == etk::UChar::Tabulation) {
@@ -609,8 +609,8 @@ appl::Buffer::Iterator appl::Buffer::countBackwardNLines(const appl::Buffer::Ite
bool appl::Buffer::copy(std::string& _data) {
_data.clear();
if (hasTextSelected() == true) {
esize_t startPos = getStartSelectionPos();
esize_t endPos = getStopSelectionPos();
int32_t startPos = getStartSelectionPos();
int32_t endPos = getStopSelectionPos();
for (Iterator it = position(startPos);
it != position(endPos) &&
(bool)it == true;
@@ -830,7 +830,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
------------ ------------- ----------
S=-1 *************** E
*/
for (esize_t iii = 0; iii < m_HLDataPass1.size(); ++iii) {
for (int32_t iii = 0; iii < m_HLDataPass1.size(); ++iii) {
if (m_HLDataPass1[iii].endStop > _startPos) {
break;
}
@@ -851,7 +851,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
} else {
elemStart = _startId+1;
}
for (esize_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) {
for (int32_t iii = elemStart; iii < m_HLDataPass1.size(); ++iii) {
if (m_HLDataPass1[iii].beginStart > _endPos) {
_stopId = iii;
break;
@@ -875,7 +875,7 @@ void appl::Buffer::cleanHighLight(void) {
appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) {
int32_t start = etk_max(0, _starPos-1);
for (esize_t iii = start; iii < m_HLDataPass1.size(); ++iii) {
for (int32_t iii = start; iii < m_HLDataPass1.size(); ++iii) {
_starPos = iii;
if ( m_HLDataPass1[iii].beginStart <= _pos
&& m_HLDataPass1[iii].endStop > _pos) {
@@ -897,7 +897,7 @@ void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, int64_t
}
//GTimeVal timeStart;
//g_get_current_time(&timeStart);
_HLStart = (esize_t)getStartLine(position(_HLStart));
_HLStart = (int32_t)getStartLine(position(_HLStart));
_MData.HLData.clear();
int64_t HLStop = countForwardNLines(position(_HLStart), _nbLines);
int64_t startId = 0;

View File

@@ -440,7 +440,7 @@ namespace appl {
* @param[in] _value Current value to transform
* @param[out] _out String that represent the curent value to display
*/
void expand(esize_t& _indent, const char32_t& _value, std::u32string& _out) const;
void expand(int32_t& _indent, const char32_t& _value, std::u32string& _out) const;
/**
* @brief get the start of a line with the position in the buffer.
* @param[in] _pos position in the buffer.
@@ -567,13 +567,13 @@ namespace appl {
*/
Iterator selectStop(void);
protected:
esize_t m_nbLines; //!< number of line in the buffer
int32_t m_nbLines; //!< number of line in the buffer
public:
/**
* @brief Get the number of line in the buffer.
* @return number of line in the Buffer.
*/
esize_t getNumberOfLines(void) {
int32_t getNumberOfLines(void) {
return m_nbLines;
}
/**

View File

@@ -22,8 +22,8 @@ appl::BufferManager::BufferManager(void) :
}
appl::BufferManager::~BufferManager(void) {
esize_t previousCount = m_list.size();
for (esize_t iii = m_list.size()-1; iii >= 0 ; --iii) {
int32_t previousCount = m_list.size();
for (int32_t iii = m_list.size()-1; iii >= 0 ; --iii) {
if (m_list[iii] == NULL) {
continue;
}
@@ -49,7 +49,7 @@ appl::Buffer* appl::BufferManager::createNewBuffer(void) {
}
appl::Buffer* appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
for (int32_t iii = 0; iii < m_list.size(); ++iii) {
if (m_list[iii] == NULL) {
continue;
}
@@ -82,7 +82,7 @@ void appl::BufferManager::onObjectRemove(ewol::EObject * _removeObject) {
if (m_bufferSelected == _removeObject) {
setBufferSelected(NULL);
}
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
for (int32_t iii = 0; iii < m_list.size(); ++iii) {
if (m_list[iii] != _removeObject) {
continue;
}
@@ -93,7 +93,7 @@ void appl::BufferManager::onObjectRemove(ewol::EObject * _removeObject) {
}
bool appl::BufferManager::exist(const std::string& _fileName) {
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
for (int32_t iii = 0; iii < m_list.size(); ++iii) {
if (m_list[iii] == NULL) {
continue;
}

View File

@@ -44,7 +44,7 @@ namespace appl {
* @brief Get count of all buffer availlable.
* @return Number of buffer
*/
esize_t size(void) const {
int32_t size(void) const {
return m_list.size();
}
/**
@@ -52,7 +52,7 @@ namespace appl {
* @param[in] _id Number of buffer
* @return pointer on the buffer
*/
appl::Buffer* get(esize_t _id) {
appl::Buffer* get(int32_t _id) {
return m_list[_id];
}
/**

View File

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

View File

@@ -31,13 +31,13 @@ namespace appl {
* @param[in] _name Name of the deco.
* @return id of the deco.
*/
esize_t request(const std::string& _name);
int32_t request(const std::string& _name);
/**
* @brief Get Decoration handle.
* @param[in] _id Id of the decoration.
* @return reference on deco.
*/
const appl::GlyphDecoration& get(esize_t _id) const {
const appl::GlyphDecoration& get(int32_t _id) const {
return m_list[_id];
};
/**
@@ -45,7 +45,7 @@ namespace appl {
* @param[in] _pos Id of the decoration.
* @return reference on deco.
*/
const appl::GlyphDecoration& operator[] (esize_t _pos) const {
const appl::GlyphDecoration& operator[] (int32_t _pos) const {
return m_list[_pos];
}
public:

View File

@@ -167,7 +167,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
tmpBuffer = m_bufferManager->getBufferSelected();
}
if (tmpBuffer != NULL) {
for (esize_t iii=0; iii<m_list.size(); iii++) {
for (int32_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii] == NULL) {
continue;
}
@@ -223,7 +223,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
void BufferView::onObjectRemove(ewol::EObject* _removeObject) {
widget::List::onObjectRemove(_removeObject);
for (esize_t iii=0; iii<m_list.size(); iii++) {
for (int32_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii] == NULL) {
continue;
}

View File

@@ -37,11 +37,11 @@ class BufferView : public widget::List
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
private:
appl::GlyphPainting* m_paintingProperties; //!< element painting property
esize_t m_colorBackground1;
esize_t m_colorBackground2;
esize_t m_colorBackgroundSelect;
esize_t m_colorTextNormal;
esize_t m_colorTextModify;
int32_t m_colorBackground1;
int32_t m_colorBackground2;
int32_t m_colorBackgroundSelect;
int32_t m_colorTextNormal;
int32_t m_colorTextModify;
private:
int32_t m_selectedIdRequested;
int32_t m_selectedID;

View File

@@ -24,13 +24,13 @@ namespace appl {
class TextViewer : public widget::WidgetScrooled {
private:
appl::GlyphPainting* m_paintingProperties; //!< element painting property
esize_t m_colorBackground;
esize_t m_colorSpace;
esize_t m_colorTabulation;
esize_t m_colorCursor;
esize_t m_colorLineNumber;
esize_t m_colorSelection;
esize_t m_colorNormal;
int32_t m_colorBackground;
int32_t m_colorSpace;
int32_t m_colorTabulation;
int32_t m_colorCursor;
int32_t m_colorLineNumber;
int32_t m_colorSelection;
int32_t m_colorNormal;
private:
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
appl::ViewerManager* m_viewerManager; //!< handle on the buffer manager

View File

@@ -95,7 +95,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
appl::Highlight::~Highlight(void) {
int32_t i;
// clean all Element
for (esize_t iii = 0; iii < m_listHighlightPass1.size(); ++iii) {
for (int32_t iii = 0; iii < m_listHighlightPass1.size(); ++iii) {
if (m_listHighlightPass1[iii] != NULL) {
delete(m_listHighlightPass1[iii]);
m_listHighlightPass1[iii] = NULL;

View File

@@ -30,7 +30,7 @@ void appl::highlightManager::init(void) {
etk::FSNode myFile("DATA:languages/");
// get the subfolder list :
std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
for (esize_t iii = 0; iii < list.size(); ++iii) {
for (int32_t iii = 0; iii < list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -48,7 +48,7 @@ void appl::highlightManager::init(void) {
}
// display :
/*
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
if (hlList[iii] == NULL) {
continue;
}
@@ -64,7 +64,7 @@ void appl::highlightManager::unInit(void) {
hlList.clear();
return;
}
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
if (hlList[iii] == NULL) {
continue;
}
@@ -80,7 +80,7 @@ std::string appl::highlightManager::getTypeExtention(const std::string& _extenti
}
APPL_VERBOSE("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
std::vector<Highlight*>& hlList = s_list();
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
if (hlList[iii] == NULL) {
continue;
}
@@ -99,7 +99,7 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type
return "";
}
std::vector<Highlight*>& hlList = s_list();
for (esize_t iii = 0; iii < hlList.size(); ++iii) {
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
if (hlList[iii] == NULL) {
continue;
}

View File

@@ -53,7 +53,7 @@ namespace appl {
void setPaternStop(std::string& _regExp);
private:
std::string m_colorName; //!< Current color name
esize_t m_colorId; //!< Id of the the glyph painting
int32_t m_colorId; //!< Id of the the glyph painting
public:
void setColorGlyph(std::string& _colorName);
const appl::GlyphDecoration& getColorGlyph(void) {

View File

@@ -66,7 +66,7 @@ void appl::textPluginManager::unInit(void) {
getListOnReceiveMessage().clear();
getListOnCursorMove().clear();
// remove all plugin:
for (esize_t iii=0; iii<getList().size(); ++iii) {
for (int32_t iii=0; iii<getList().size(); ++iii) {
if (getList()[iii] == NULL) {
continue;
}
@@ -115,7 +115,7 @@ void appl::textPluginManager::addPlugin(appl::TextViewerPlugin* _plugin) {
}
void appl::textPluginManager::connect(appl::TextViewer& _widget) {
for (esize_t iii=0; iii<getList().size(); ++iii) {
for (int32_t iii=0; iii<getList().size(); ++iii) {
if (getList()[iii] == NULL) {
continue;
}
@@ -124,7 +124,7 @@ void appl::textPluginManager::connect(appl::TextViewer& _widget) {
}
void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
for (esize_t iii=0; iii<getList().size(); ++iii) {
for (int32_t iii=0; iii<getList().size(); ++iii) {
if (getList()[iii] == NULL) {
continue;
}
@@ -135,7 +135,7 @@ void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
const ewol::EventEntry& _event) {
std::vector<appl::TextViewerPlugin *>& list = getListOnEventEntry();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -149,7 +149,7 @@ bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
const ewol::EventInput& _event) {
std::vector<appl::TextViewerPlugin *>& list = getListOnEventInput();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -164,7 +164,7 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data) {
std::vector<appl::TextViewerPlugin *>& list = getListOnWrite();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -180,7 +180,7 @@ bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
const std::string& _data,
const appl::Buffer::Iterator& _posEnd) {
std::vector<appl::TextViewerPlugin *>& list = getListOnReplace();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -195,7 +195,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const appl::Buffer::Iterator& _posEnd) {
std::vector<appl::TextViewerPlugin *>& list = getListOnRemove();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -209,7 +209,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onReceiveMessage(appl::TextViewer& _textDrawer,
const ewol::EMessage& _msg) {
std::vector<appl::TextViewerPlugin *>& list = getListOnReceiveMessage();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}
@@ -223,7 +223,7 @@ bool appl::textPluginManager::onReceiveMessage(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos) {
std::vector<appl::TextViewerPlugin *>& list = getListOnCursorMove();
for (esize_t iii=0; iii<list.size(); ++iii) {
for (int32_t iii=0; iii<list.size(); ++iii) {
if (list[iii] == NULL) {
continue;
}

View File

@@ -52,14 +52,14 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
if (true == _event.getSpecialKey().isSetShift() ) {
// un-indent
data.insert(0, 1, etk::UChar::Return);
for (esize_t iii=1; iii<data.size(); ++iii) {
for (int32_t iii=1; iii<data.size(); ++iii) {
if (data[iii-1] != etk::UChar::Return) {
continue;
}
if(data[iii] == etk::UChar::Tabulation) {
data.erase(iii, 1);
} else if(data[iii] == etk::UChar::Space) {
for (esize_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
for (int32_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
if(data[iii] == etk::UChar::Space) {
data.erase(iii, 1);
} else if(data[iii] == etk::UChar::Tabulation) {
@@ -75,7 +75,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
} else {
// indent
data.insert(0, 1, etk::UChar::Return);
for (esize_t iii=1; iii<data.size(); iii++) {
for (int32_t iii=1; iii<data.size(); iii++) {
if (data[iii-1] != etk::UChar::Return) {
continue;
}