diff --git a/sources/appl/Buffer.cpp b/sources/appl/Buffer.cpp index fa39bb3..71e907c 100644 --- a/sources/appl/Buffer.cpp +++ b/sources/appl/Buffer.cpp @@ -16,7 +16,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () { m_current = 0; return *this; } - if (m_data != nullptr) { + if (m_data != null) { if (m_current < (int64_t)m_data->m_data.size() ) { int8_t nbChar = utf8::length(m_data->m_data[m_current]); if (nbChar != 0) { @@ -34,7 +34,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () { appl::Buffer::Iterator& appl::Buffer::Iterator::operator-- () { m_value = u32char::Null; - if (m_data != nullptr) { + if (m_data != null) { if (m_current > 0) { int32_t iii = -1; while( utf8::first(m_data->m_data[m_current+iii]) == false @@ -57,7 +57,7 @@ char32_t appl::Buffer::Iterator::operator* () { if (m_value != u32char::Null) { return m_value; } - if (m_data == nullptr) { + if (m_data == null) { APPL_ERROR("request an element that iterator not link"); return m_value; } @@ -119,7 +119,7 @@ appl::Buffer::Buffer() : m_cursorSelectPos(-1), m_cursorPreferredCol(-1), m_nbLines(1), - m_highlight(nullptr) { + m_highlight(null) { addObjectType("appl::Buffer"); static int32_t bufferBaseId = 0; m_fileName = "No Name " + etk::toString(bufferBaseId); @@ -700,7 +700,7 @@ void appl::Buffer::setHighlightType(const etk::String& _type) { void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64_t _nbAdded) { // prevent ERROR... - if (m_highlight == nullptr) { + if (m_highlight == null) { return; } // prevent No data Call @@ -874,7 +874,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos, } void appl::Buffer::generateHighLightAt(int64_t _pos, int64_t _endPos, int64_t _addingPos) { - if (m_highlight == nullptr) { + if (m_highlight == null) { return; } //APPL_DEBUG("area : (" << _pos << "," << _endPos << ") insert at : " << _addingPos); @@ -896,17 +896,17 @@ appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64 return &m_HLDataPass1[iii]; } if(m_HLDataPass1[iii].start > _pos) { - return nullptr; + return null; } } - return nullptr; + return null; } void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const appl::Buffer::Iterator& _HLStart, int64_t _nbLines) { _MData.posHLPass1 = 0; _MData.posHLPass2 = 0; - if (m_highlight == nullptr) { + if (m_highlight == null) { return; } //int64_t timeStart = ewol::getTime(); @@ -1012,7 +1012,7 @@ uint32_t appl::Buffer::getCursorLinesId() { namespace etk { template<> etk::String toString>(const ememory::SharedPtr& _obj) { - if (_obj != nullptr) { + if (_obj != null) { return _obj->getFileName(); } return ""; @@ -1022,7 +1022,7 @@ namespace etk { } template<> bool from_string>(ememory::SharedPtr& _variableRet, const etk::String& _value) { - if (_variableRet != nullptr) { + if (_variableRet != null) { _variableRet->loadFile(_value); return true; } diff --git a/sources/appl/Buffer.hpp b/sources/appl/Buffer.hpp index ce327e1..faabc55 100644 --- a/sources/appl/Buffer.hpp +++ b/sources/appl/Buffer.hpp @@ -40,7 +40,7 @@ namespace appl { */ Iterator(): m_current(0), - m_data(nullptr), + m_data(null), m_value(u32char::Null) { // nothing to do ... }; @@ -70,7 +70,7 @@ namespace appl { */ virtual ~Iterator() { m_current = 0; - m_data = nullptr; + m_data = null; m_value = u32char::Null; }; /** @@ -78,7 +78,7 @@ namespace appl { * @return true if the element is present in buffer */ operator bool () const { - if (m_data == nullptr) { + if (m_data == null) { return false; } if (m_current >= (int64_t)m_data->m_data.size()) { @@ -94,7 +94,7 @@ namespace appl { * @return true if the element is present in buffer */ operator int64_t () const { - if (m_data == nullptr) { + if (m_data == null) { return 0; } if (m_current < 0) { @@ -217,7 +217,7 @@ namespace appl { * @return The requested position. */ int64_t getPos() const { - if (m_data == nullptr) { + if (m_data == null) { return 0; } if (m_current < 0) { diff --git a/sources/appl/BufferManager.cpp b/sources/appl/BufferManager.cpp index b889811..720cd67 100644 --- a/sources/appl/BufferManager.cpp +++ b/sources/appl/BufferManager.cpp @@ -28,9 +28,9 @@ appl::BufferManager::~BufferManager() { ememory::SharedPtr appl::BufferManager::createNewBuffer() { ememory::SharedPtr tmp = appl::Buffer::create(); - if (tmp == nullptr) { + if (tmp == null) { APPL_ERROR("Can not allocate the Buffer (empty)."); - return nullptr; + return null; } tmp->setParent(ewol::Object::sharedFromThis()); m_list.pushBack(tmp); @@ -46,7 +46,7 @@ ememory::SharedPtr appl::BufferManager::createNewBuffer() { ememory::SharedPtr appl::BufferManager::get(const etk::String& _fileName, bool _createIfNeeded) { APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")"); for (auto &it : m_list) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getFileName() == _fileName) { @@ -57,12 +57,12 @@ ememory::SharedPtr appl::BufferManager::get(const etk::String& _fi if (etk::FSNodeGetType(_fileName) == etk::typeNode_folder) { APPL_WARNING("try open a folder : " << _fileName); APPL_CRITICAL("plop"); - return nullptr; + return null; } ememory::SharedPtr tmp = appl::Buffer::create(); - if (tmp == nullptr) { + if (tmp == null) { APPL_ERROR("Can not allocate the Buffer class : " << _fileName); - return nullptr; + return null; } tmp->setParent(ewol::Object::sharedFromThis()); tmp->loadFile(_fileName); @@ -72,12 +72,12 @@ ememory::SharedPtr appl::BufferManager::get(const etk::String& _fi APPL_INFO("Creata a open Buffer (done)"); return tmp; } - return nullptr; + return null; } void appl::BufferManager::setBufferSelected(ememory::SharedPtr _bufferSelected) { m_bufferSelected = _bufferSelected; - if (m_bufferSelected == nullptr) { + if (m_bufferSelected == null) { APPL_ERROR("select a NULL buffer ..."); propertySetOnWidgetNamed("appl-widget-display-name", "value", "---"); return; @@ -101,7 +101,7 @@ ememory::SharedPtr appl::BufferManager::get(int32_t _id) { bool appl::BufferManager::exist(const etk::String& _fileName) { for (auto &it : m_list) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getFileName() == _fileName) { @@ -120,7 +120,7 @@ void appl::BufferManager::open(const etk::String& _fileName) { propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(fileName)); return; } - if (get(fileName, true) == nullptr) { + if (get(fileName, true) == null) { APPL_ERROR("Error get '" << fileName << "' ... "); return; } @@ -134,7 +134,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtrgetFileName()); propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName((*it)->getFileName())); @@ -159,7 +159,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtrgetFileName()); propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(m_list.back()->getFileName())); @@ -168,7 +168,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtr get(int32_t _id); /** * @brief Create a new buffer empty. - * @return Created buffer or nullptr. + * @return Created buffer or null. */ ememory::SharedPtr createNewBuffer(); private: diff --git a/sources/appl/Gui/BufferView.cpp b/sources/appl/Gui/BufferView.cpp index fad48f1..210edc8 100644 --- a/sources/appl/Gui/BufferView.cpp +++ b/sources/appl/Gui/BufferView.cpp @@ -49,7 +49,7 @@ void BufferView::init() { ewol::widget::List::init(); propertyHide.set(true); propertyCanFocus.set(true); - if (m_bufferManager != nullptr) { + if (m_bufferManager != null) { m_bufferManager->signalNewBuffer.connect(sharedFromThis(), &BufferView::onCallbackNewBuffer); m_bufferManager->signalSelectFile.connect(sharedFromThis(), &BufferView::onCallbackselectNewFile); m_bufferManager->signalRemoveBuffer.connect(sharedFromThis(), &BufferView::onCallbackBufferRemoved); @@ -94,7 +94,7 @@ void BufferView::insertAlphabetic(const appl::dataBufferStruct& _dataStruct, boo void BufferView::onCallbackNewBuffer(const etk::String& _value) { ememory::SharedPtr buffer = m_bufferManager->get(_value); - if (buffer == nullptr) { + if (buffer == null) { APPL_ERROR("event on element nor exist : " << _value); return; } @@ -121,7 +121,7 @@ void BufferView::onCallbackNewBuffer(const etk::String& _value) { void BufferView::onCallbackselectNewFile(const etk::String& _value) { m_selectedID = -1; for (size_t iii=0; iiigetFileName() != _value) { @@ -196,7 +196,7 @@ bool BufferView::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextT && _raw<(int64_t)m_list.size() ) { _myTextToWrite = m_list[_raw].m_bufferName.getNameFile(); - if ( m_list[_raw].m_buffer != nullptr + if ( m_list[_raw].m_buffer != null && m_list[_raw].m_buffer->isModify() == false) { _fg = (*m_paintingProperties)[m_colorTextNormal].getForeground(); } else { @@ -222,8 +222,8 @@ bool BufferView::onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); if( _raw >= 0 && _raw<(int64_t)m_list.size()) { - if (m_list[_raw].m_buffer != nullptr) { - if (m_bufferManager != nullptr) { + if (m_list[_raw].m_buffer != null) { + if (m_bufferManager != null) { APPL_INFO("Select file :" << m_list[_raw].m_buffer->getFileName() << " in list"); m_bufferManager->open(m_list[_raw].m_buffer->getFileName()); } diff --git a/sources/appl/Gui/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index f688cd3..580d050 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -53,7 +53,7 @@ class ParameterAboutGui : public ewol::widget::Sizer { ememory::SharedPtr mySpacer; mySpacer = ewol::widget::Spacer::create(); - if (mySpacer == nullptr) { + if (mySpacer == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->propertyExpand.set(bvec2(true,true)); @@ -72,7 +72,7 @@ class ParameterAboutGui : public ewol::widget::Sizer { tmpLabel += " tinyXml, freetype, agg2.4, etk
"; tmpLabel += ""; ememory::SharedPtr myLabel = ewol::widget::Label::create(); - if (myLabel == nullptr) { + if (myLabel == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { myLabel->propertyValue.set(tmpLabel); @@ -251,7 +251,7 @@ void MainWindows::onCallbackShortCut(const etk::String& _value) { void MainWindows::onCallbackMenuEvent(const etk::String& _value) { APPL_WARNING("Event from Menu : " << _value); if (_value == "menu:new") { - if (m_bufferManager != nullptr) { + if (m_bufferManager != null) { m_bufferManager->createNewBuffer(); } } else if (_value == "menu:exit") { @@ -272,7 +272,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { } else if (_value == "menu:property") { displayProperty(); } else if (_value == "menu:search") { - if (m_widgetSearch == nullptr) { + if (m_widgetSearch == null) { return; } if (m_widgetSearch->propertyHide.get() == true) { @@ -281,9 +281,9 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { } else { if (m_widgetSearch->isSelectSearch()) { m_widgetSearch->propertyHide.set(true); - if (m_viewerManager != nullptr) { + if (m_viewerManager != null) { ememory::SharedPtr tmp = m_viewerManager->getViewerSelected(); - if (tmp != nullptr) { + if (tmp != null) { tmp->keepFocus(); } } @@ -292,7 +292,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { } } } else if (_value == "menu:replace") { - if (m_widgetSearch == nullptr) { + if (m_widgetSearch == null) { return; } if (m_widgetSearch->propertyHide.get() == true) { @@ -301,9 +301,9 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { } else { if (m_widgetSearch->isSelectReplace()) { m_widgetSearch->propertyHide.set(true); - if (m_viewerManager != nullptr) { + if (m_viewerManager != null) { ememory::SharedPtr tmp = m_viewerManager->getViewerSelected(); - if (tmp != nullptr) { + if (tmp != null) { tmp->keepFocus(); } } @@ -360,7 +360,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { return; } ememory::SharedPtr tmpBuffer = m_bufferManager->get(_msg.getData()); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { APPL_ERROR("Error to get the buffer : " << _msg.getData()); return; } @@ -379,7 +379,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { return; } ememory::SharedPtr tmpBuffer = m_bufferManager->get(_msg.getData()); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { APPL_ERROR("Error to get the buffer : " << _msg.getData()); return; } @@ -390,7 +390,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { return; } ememory::SharedPtr tmpBuffer = m_bufferManager->get(_msg.getData()); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { APPL_ERROR("Error to get the buffer : " << _msg.getData()); return; } @@ -402,19 +402,19 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) { void MainWindows::displayOpen() { ememory::SharedPtr tmpWidget = ewol::widget::FileChooser::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not open File chooser !!! "); return; } tmpWidget->propertyLabelTitle.set("_T{Open files ...}"); tmpWidget->propertyLabelValidate.set("_T{Open}"); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); return; } // Get a ref on the buffer selected (if null, no buffer was selected ...) ememory::SharedPtr tmpBuffer = m_bufferManager->getBufferSelected(); - if (tmpBuffer != nullptr) { + if (tmpBuffer != null) { etk::FSNode tmpFile = tmpBuffer->getFileName(); tmpWidget->propertyPath.set(tmpFile.getNameFolder()); } @@ -426,7 +426,7 @@ void MainWindows::displayOpen() { void MainWindows::displayProperty() { // Request the parameter GUI ememory::SharedPtr tmpWidget = ewol::widget::Parameter::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); return; } @@ -448,10 +448,10 @@ void MainWindows::displayProperty() { tmpWidget->menuAddGroup("_T{Editor}"); ememory::SharedPtr tmpSubWidget = globals::ParameterGlobalsGui::create(); tmpWidget->menuAdd("_T{Editor}", "", tmpSubWidget); - tmpWidget->menuAdd("_T{Font & Color}", "", nullptr); - tmpWidget->menuAdd("_T{Highlight}", "", nullptr); + tmpWidget->menuAdd("_T{Font & Color}", "", null); + tmpWidget->menuAdd("_T{Highlight}", "", null); tmpWidget->menuAddGroup("_T{General}"); - tmpWidget->menuAdd("_T{Display}", "", nullptr); + tmpWidget->menuAdd("_T{Display}", "", null); tmpSubWidget = ParameterAboutGui::create(); tmpWidget->menuAdd("_T{About}", "", tmpSubWidget); #endif @@ -459,7 +459,7 @@ void MainWindows::displayProperty() { void MainWindows::onCallbackselectNewFile(const etk::String& _value) { APPL_INFO("onCallbackselectNewFile(" << _value << ")"); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); return; } @@ -468,7 +468,7 @@ void MainWindows::onCallbackselectNewFile(const etk::String& _value) { m_connectionSaveName.disconnect(); onCallbackTitleUpdate(); ememory::SharedPtr tmpp = m_bufferManager->getBufferSelected(); - if (tmpp != nullptr) { + if (tmpp != null) { m_connectionSave = tmpp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate); m_connectionModify = tmpp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate); m_connectionSaveName = tmpp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate); @@ -483,63 +483,63 @@ void MainWindows::onCallbackPopUpFileSelected(const etk::String& _value) { void MainWindows::onCallbackTitleUpdate() { APPL_INFO("onCallbackTitleUpdate()"); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); return; } // select a new Buffer ==> change title: ememory::SharedPtr tmpp = m_bufferManager->getBufferSelected(); - if (tmpp == nullptr) { + if (tmpp == null) { propertyTitle.set("Edn"); - if (m_widgetLabelFileName != nullptr) { + if (m_widgetLabelFileName != null) { m_widgetLabelFileName->propertyValue.set(""); } } else { etk::String nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName(); propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem); - if (m_widgetLabelFileName != nullptr) { + if (m_widgetLabelFileName != null) { m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":"")); } } } void MainWindows::saveAsPopUp(const ememory::SharedPtr& _buffer) { - if (_buffer == nullptr) { - APPL_ERROR("Call With nullptr input..."); + if (_buffer == null) { + APPL_ERROR("Call With null input..."); return; } ememory::SharedPtr tmpObject = appl::WorkerSaveFile::create("buffer-name", _buffer->getFileName()); } void MainWindows::closeNotSavedFile(const ememory::SharedPtr& _buffer) { - if (_buffer == nullptr) { - APPL_ERROR("Call With nullptr input..."); + if (_buffer == null) { + APPL_ERROR("Call With null input..."); return; } ememory::SharedPtr tmpPopUp = ewol::widget::StdPopUp::create(); - if (tmpPopUp == nullptr) { + if (tmpPopUp == null) { APPL_ERROR("Can not create a simple pop-up"); return; } tmpPopUp->propertyTitle.set("_T{Close un-saved file:}"); tmpPopUp->propertyComment.set("_T{The file named:} \"" + _buffer->getFileName() + "\" _T{is curently modify.}
_T{If you don't saves these modifications,
they will be definitly lost...}"); - ememory::SharedPtr bt = nullptr; + ememory::SharedPtr bt = null; if (_buffer->hasFileName() == true) { bt = tmpPopUp->addButton("_T{Save}", true); - if (bt != nullptr) { + if (bt != null) { // TODO : The element is removed before beeing pressed // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFile, _buffer->getFileName()); // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); } } bt = tmpPopUp->addButton("_T{Save As}", true); - if (bt != nullptr) { + if (bt != null) { // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFileAs, _buffer->getFileName()); //bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); // TODO : Request the close when saved ... } bt = tmpPopUp->addButton("_T{Close}", true); - if (bt != nullptr) { + if (bt != null) { // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); } tmpPopUp->addButton("_T{Cancel}", true); diff --git a/sources/appl/Gui/Search.cpp b/sources/appl/Gui/Search.cpp index 8fe8b81..c7475b1 100644 --- a/sources/appl/Gui/Search.cpp +++ b/sources/appl/Gui/Search.cpp @@ -49,12 +49,12 @@ appl::widget::Search::~Search() { } void appl::widget::Search::find() { - if (m_viewerManager == nullptr) { + if (m_viewerManager == null) { APPL_WARNING("No viewer manager selected!!!"); return; } ememory::SharedPtr viewer = m_viewerManager->getViewerSelected(); - if (viewer == nullptr) { + if (viewer == null) { APPL_INFO("No viewer selected!!!"); return; } @@ -85,12 +85,12 @@ void appl::widget::Search::find() { } void appl::widget::Search::replace() { - if (m_viewerManager == nullptr) { + if (m_viewerManager == null) { APPL_WARNING("No viewer manager selected!!!"); return; } ememory::SharedPtr viewer = m_viewerManager->getViewerSelected(); - if (viewer == nullptr) { + if (viewer == null) { APPL_INFO("No viewer selected!!!"); return; } @@ -137,26 +137,26 @@ void appl::widget::Search::OnCallbackForward(const bool& _value) { } void appl::widget::Search::selectSearch() { - if (m_searchEntry != nullptr) { + if (m_searchEntry != null) { m_searchEntry->keepFocus(); } } bool appl::widget::Search::isSelectSearch() { - if (m_searchEntry != nullptr) { + if (m_searchEntry != null) { return m_searchEntry->getFocus(); } return false; } void appl::widget::Search::selectReplace() { - if (m_replaceEntry != nullptr) { + if (m_replaceEntry != null) { m_replaceEntry->keepFocus(); } } bool appl::widget::Search::isSelectReplace() { - if (m_replaceEntry != nullptr) { + if (m_replaceEntry != null) { return m_replaceEntry->getFocus(); } return false; diff --git a/sources/appl/Gui/TagFileList.cpp b/sources/appl/Gui/TagFileList.cpp index 6dc401b..cb77c29 100644 --- a/sources/appl/Gui/TagFileList.cpp +++ b/sources/appl/Gui/TagFileList.cpp @@ -15,7 +15,7 @@ appl::TagFileList::TagFileList() : setMouseLimit(1); // Load color properties: (use file list to be generic ...) m_colorProperty = ewol::resource::ColorFile::create("THEME:COLOR:ListFileSystem.json"); - if (m_colorProperty != nullptr) { + if (m_colorProperty != null) { m_colorIdText = m_colorProperty->request("text"); m_colorIdBackground1 = m_colorProperty->request("background1"); m_colorIdBackground2 = m_colorProperty->request("background2"); @@ -29,7 +29,7 @@ void appl::TagFileList::init() { appl::TagFileList::~TagFileList() { for (auto &it : m_list) { ETK_DELETE(appl::TagListElement, it); - it = nullptr; + it = null; } } @@ -51,7 +51,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() { } bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { - if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) { + if (_raw >= 0 && (size_t)_raw < m_list.size() && null != m_list[_raw]) { if (0 == _colomn) { _myTextToWrite = etk::toString(m_list[_raw]->fileLine); } else { @@ -85,7 +85,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty } if( m_selectedLine >= 0 && m_selectedLine < (int64_t)m_list.size() - && nullptr != m_list[m_selectedLine] ) { + && null != m_list[m_selectedLine] ) { if (previousRaw != m_selectedLine) { signalSelect.emit(etk::toString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename); } else { @@ -110,7 +110,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty */ void appl::TagFileList::add(etk::String& _file, int32_t _line) { appl::TagListElement *tmpFile = ETK_NEW(appl::TagListElement, _file, _line); - if (nullptr != tmpFile) { + if (null != tmpFile) { m_list.pushBack(tmpFile); } markToRedraw(); diff --git a/sources/appl/Gui/TagFileSelection.cpp b/sources/appl/Gui/TagFileSelection.cpp index 9487fc5..fe10511 100644 --- a/sources/appl/Gui/TagFileSelection.cpp +++ b/sources/appl/Gui/TagFileSelection.cpp @@ -35,7 +35,7 @@ void appl::TagFileSelection::init() { #endif mySizerVert = ewol::widget::Sizer::create(); - if (mySizerVert == nullptr) { + if (mySizerVert == null) { EWOL_ERROR("Can not allocate widget == > display might be in error"); return; } @@ -65,7 +65,7 @@ void appl::TagFileSelection::init() { externSubBind(compose, ewol::widget::Button, "PLUGIN-CTAGS-cancel", signalPressed, sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsCancel); m_listTag = appl::TagFileList::create(); - if (m_listTag == nullptr) { + if (m_listTag == null) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { m_listTag->signalValidate.connect(sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsListValidate); @@ -77,7 +77,7 @@ void appl::TagFileSelection::init() { } ewol::widget::LabelShared myWidgetTitle = ewol::widget::Label::create(); - if (myWidgetTitle == nullptr) { + if (myWidgetTitle == null) { EWOL_ERROR("Can not allocate widget == > display might be in error"); return; } @@ -126,7 +126,7 @@ void appl::TagFileSelection::onCallbackCtagsListUnSelect() { * @param[in] jump line id */ void appl::TagFileSelection::addCtagsNewItem(etk::String _file, int32_t _line) { - if (m_listTag != nullptr) { + if (m_listTag != null) { m_listTag->add(_file, _line); } } diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index 02160ae..b1f35ce 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -65,7 +65,7 @@ void appl::TextViewer::init() { registerMultiCast(appl::MsgSelectGotoLine); registerMultiCast(appl::MsgSelectGotoLineSelect); */ - if (m_bufferManager != nullptr) { + if (m_bufferManager != null) { m_bufferManager->signalSelectFile.connect(sharedFromThis(), &appl::TextViewer::onCallbackselectNewFile); } else { APPL_CRITICAL("Buffer manager has not been created at the init"); @@ -90,13 +90,13 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) { } // reset scroll: - if (m_buffer != nullptr) { + if (m_buffer != null) { m_buffer->signals.disconnect(sharedFromThis()); bool needAdd = true; auto it = m_drawingRemenber.begin(); while (it != m_drawingRemenber.end()) { ememory::SharedPtr tmpBuff = it->first.lock(); - if (tmpBuff == nullptr) { + if (tmpBuff == null) { it = m_drawingRemenber.erase(it); continue; } @@ -114,10 +114,10 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) { } } m_originScrooled = vec2(0,0); - if (m_bufferManager != nullptr) { + if (m_bufferManager != null) { m_buffer = m_bufferManager->get(_value); m_bufferManager->setBufferSelected(m_buffer); - if (m_buffer != nullptr) { + if (m_buffer != null) { m_buffer->signalIsModify.connect(sharedFromThis(), &appl::TextViewer::onCallbackIsModify); m_buffer->signalSelectChange.connect(sharedFromThis(), &appl::TextViewer::onCallbackSelectChange); for (auto element : m_drawingRemenber) { @@ -135,7 +135,7 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) { } etk::String appl::TextViewer::getBufferPath() { - if (m_buffer == nullptr) { + if (m_buffer == null) { return ""; } etk::String filename = m_buffer->getFileName(); @@ -173,7 +173,7 @@ void appl::TextViewer::onRegenerateDisplay() { m_displayDrawing.setColor((*m_paintingProperties)[m_colorBackground].getForeground()); m_displayDrawing.rectangleWidth(m_size); - if (m_buffer == nullptr) { + if (m_buffer == null) { m_maxSize.setX(256); m_maxSize.setY(256); float textEndAlignament = etk::max(11.0f, m_size.x()-20.0f); @@ -269,7 +269,7 @@ void appl::TextViewer::onRegenerateDisplay() { appl::DisplayHLData displayLocalSyntax; m_buffer->hightlightGenerateLines(displayLocalSyntax, startingIt, (m_size.y()/tmpLetterSize.y()) + 5); float maxSizeX = 0; - appl::HighlightInfo * HLColor = nullptr; + appl::HighlightInfo * HLColor = null; bool displayCursorAndSelection = isSelectedLast(); appl::Buffer::Iterator it; for (it = startingIt; @@ -308,8 +308,8 @@ void appl::TextViewer::onRegenerateDisplay() { } HLColor = m_buffer->getElementColorAtPosition(displayLocalSyntax, (int64_t)it); bool haveBackground = false; - if ( HLColor != nullptr - && HLColor->patern != nullptr) { + if ( HLColor != null + && HLColor->patern != null) { m_displayText.setColor(HLColor->patern->getColorGlyph().getForeground()); m_displayText.setColorBg(HLColor->patern->getColorGlyph().getBackground()); haveBackground = HLColor->patern->getColorGlyph().haveBackground(); @@ -381,7 +381,7 @@ void appl::TextViewer::onRegenerateDisplay() { } bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } // First call plugin @@ -497,7 +497,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) { keepFocus(); } //tic(); - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } // First call the scrolling widget : @@ -679,7 +679,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP } void appl::TextViewer::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) { - if (m_buffer != nullptr) { + if (m_buffer != null) { etk::String data = gale::context::clipBoard::get(_clipboardID); write(data); } @@ -718,7 +718,7 @@ void appl::TextViewer::onChangePropertyFontName() { // TODO : Update process time ==> a little expensive (2->4ms) in end of file void appl::TextViewer::updateScrolling() { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } vec2 realCursorPosition(0,0); @@ -747,7 +747,7 @@ void appl::TextViewer::updateScrolling() { } bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } markToRedraw(); @@ -761,7 +761,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) { } bool appl::TextViewer::write(const etk::String& _data) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } if (m_buffer->hasTextSelected() == true) { @@ -771,7 +771,7 @@ bool appl::TextViewer::write(const etk::String& _data) { } bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Iterator& _pos) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } markToRedraw(); @@ -787,7 +787,7 @@ bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Itera } bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } markToRedraw(); @@ -803,7 +803,7 @@ bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Ite } bool appl::TextViewer::replace(const etk::String& _data) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return false; } if (m_buffer->hasTextSelected() == false) { @@ -813,7 +813,7 @@ bool appl::TextViewer::replace(const etk::String& _data) { } void appl::TextViewer::remove() { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } if (m_buffer->hasTextSelected() == false) { @@ -831,7 +831,7 @@ void appl::TextViewer::remove() { void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } markToRedraw(); @@ -854,7 +854,7 @@ void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) { } void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } markToRedraw(); @@ -877,7 +877,7 @@ void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) { } void appl::TextViewer::moveCursorUp(uint32_t _nbLine) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } markToRedraw(); @@ -903,7 +903,7 @@ void appl::TextViewer::moveCursorUp(uint32_t _nbLine) { } void appl::TextViewer::moveCursorDown(uint32_t _nbLine) { - if (m_buffer == nullptr) { + if (m_buffer == null) { return; } markToRedraw(); @@ -983,13 +983,13 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo } void appl::TextViewer::setCurrentSelect() { - if (m_viewerManager != nullptr) { + if (m_viewerManager != null) { m_viewerManager->setViewerSelected(ememory::dynamicPointerCast(sharedFromThis()), m_buffer); } } bool appl::TextViewer::isSelectedLast() { - if (m_viewerManager != nullptr) { + if (m_viewerManager != null) { return m_viewerManager->isLastSelected(ememory::dynamicPointerCast(sharedFromThis())); } return false; diff --git a/sources/appl/Gui/TextViewer.hpp b/sources/appl/Gui/TextViewer.hpp index a64d566..73428fb 100644 --- a/sources/appl/Gui/TextViewer.hpp +++ b/sources/appl/Gui/TextViewer.hpp @@ -97,7 +97,7 @@ namespace appl { * @brief Remove selected data ... (No plugin call) */ void removeDirect() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return; } m_buffer->removeSelection(); @@ -110,7 +110,7 @@ namespace appl { * @return true of no error occured. */ bool copy(etk::String& _data) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } return m_buffer->copy(_data); @@ -122,7 +122,7 @@ namespace appl { * @param[in] _posEnd End position to end replace the data. */ void copy(etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return; } m_buffer->copy(_data, _pos, _posEnd); @@ -134,7 +134,7 @@ namespace appl { * @return true if the write is done corectly */ bool writeDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } bool ret = m_buffer->write(_data, _pos); @@ -149,7 +149,7 @@ namespace appl { * @return true if the write is done corectly */ bool replaceDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } bool ret = m_buffer->replace(_data, _pos, _posEnd); @@ -210,14 +210,14 @@ namespace appl { * @return true if a display buffer is present, false otherwise. */ virtual bool hasBuffer() { - return m_buffer != nullptr; + return m_buffer != null; } /** * @brief Get the status of selection. * @return true if we have a current selection, false otherwise. */ virtual bool hasTextSelected() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } return m_buffer->hasTextSelected(); @@ -226,7 +226,7 @@ namespace appl { * @brief Remove Selection of the buffer. */ virtual void unSelect() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return; } m_buffer->unSelect(); @@ -237,7 +237,7 @@ namespace appl { * @param[in] _stop Stop position of the selection (the curor is set at this position) */ virtual void select(const appl::Buffer::Iterator& _start, const appl::Buffer::Iterator& _stop) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return; } moveCursor(_stop); @@ -257,7 +257,7 @@ namespace appl { appl::Buffer::Iterator& _resultStart, appl::Buffer::Iterator& _resultStop, bool _caseSensitive = true) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } bool ret = m_buffer->search(_pos, _search, _resultStart, _caseSensitive); @@ -280,7 +280,7 @@ namespace appl { appl::Buffer::Iterator& _resultStart, appl::Buffer::Iterator& _resultStop, bool _caseSensitive = true) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } bool ret = m_buffer->searchBack(_pos, _search, _resultStart, _caseSensitive); @@ -299,7 +299,7 @@ namespace appl { bool getPosAround(const appl::Buffer::Iterator& _pos, appl::Buffer::Iterator &_beginPos, appl::Buffer::Iterator &_endPos) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return false; } return m_buffer->getPosAround(_pos, _beginPos, _endPos); @@ -310,7 +310,7 @@ namespace appl { * @return The Iterator */ appl::Buffer::Iterator position(int64_t _pos) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->position(_pos); @@ -320,7 +320,7 @@ namespace appl { * @return The iterator on the cursor position */ appl::Buffer::Iterator cursor() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->cursor(); @@ -330,7 +330,7 @@ namespace appl { * @return The iterator on the begin position */ appl::Buffer::Iterator begin() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->begin(); @@ -340,7 +340,7 @@ namespace appl { * @return The iterator on the end position */ appl::Buffer::Iterator end() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->end(); @@ -350,7 +350,7 @@ namespace appl { * @return The Iterator */ appl::Buffer::Iterator selectStart() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->selectStart(); @@ -360,7 +360,7 @@ namespace appl { * @return The Iterator */ appl::Buffer::Iterator selectStop() { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->selectStop(); @@ -371,7 +371,7 @@ namespace appl { * @return The position in the buffer of the start of the line. */ appl::Buffer::Iterator getStartLine(const appl::Buffer::Iterator& _pos) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->getStartLine(_pos); @@ -382,7 +382,7 @@ namespace appl { * @return The position in the buffer of the end of the line. */ appl::Buffer::Iterator getEndLine(const appl::Buffer::Iterator& _pos) { - if (m_buffer==nullptr) { + if (m_buffer==null) { return appl::Buffer::Iterator(); } return m_buffer->getEndLine(_pos); diff --git a/sources/appl/Gui/ViewerManager.cpp b/sources/appl/Gui/ViewerManager.cpp index 1e797f3..3dbf6b2 100644 --- a/sources/appl/Gui/ViewerManager.cpp +++ b/sources/appl/Gui/ViewerManager.cpp @@ -34,7 +34,7 @@ void appl::ViewerManager::setViewerSelected(const ememory::SharedPtrsetBufferSelected(_buffer); } } diff --git a/sources/appl/Gui/WorkerCloseAllFile.cpp b/sources/appl/Gui/WorkerCloseAllFile.cpp index 0842f07..e6fe3b5 100644 --- a/sources/appl/Gui/WorkerCloseAllFile.cpp +++ b/sources/appl/Gui/WorkerCloseAllFile.cpp @@ -15,7 +15,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() { void appl::WorkerCloseAllFile::init() { ewol::object::Worker::init(); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); destroy(); return; @@ -23,7 +23,7 @@ void appl::WorkerCloseAllFile::init() { // List all current open file : for (int64_t iii=m_bufferManager->size()-1; iii>=0; --iii) { ememory::SharedPtr tmpBuffer = m_bufferManager->get(iii); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { continue; } if (tmpBuffer->isModify() == false) { @@ -55,7 +55,7 @@ appl::WorkerCloseAllFile::~WorkerCloseAllFile() { } void appl::WorkerCloseAllFile::onCallbackCloseDone() { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... return; } diff --git a/sources/appl/Gui/WorkerCloseFile.cpp b/sources/appl/Gui/WorkerCloseFile.cpp index a85a8e4..6eb9418 100644 --- a/sources/appl/Gui/WorkerCloseFile.cpp +++ b/sources/appl/Gui/WorkerCloseFile.cpp @@ -12,9 +12,9 @@ appl::WorkerCloseFile::WorkerCloseFile() : signalCloseDone(this, "close-file-done", ""), signalAbort(this, "close-file-abort", ""), - m_buffer(nullptr), - m_worker(nullptr), - m_bufferManager(nullptr) { + m_buffer(null), + m_worker(null), + m_bufferManager(null) { addObjectType("appl::WorkerCloseFile"); // load buffer manager: m_bufferManager = appl::BufferManager::create(); @@ -26,7 +26,7 @@ void appl::WorkerCloseFile::init() { void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) { m_bufferName = _bufferName; - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); destroy(); return; @@ -34,7 +34,7 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) { if (m_bufferName == "") { // need to find the curent file ... ememory::SharedPtr tmpp = m_bufferManager->getBufferSelected(); - if (tmpp == nullptr) { + if (tmpp == null) { APPL_ERROR("No selected buffer now ..."); destroy(); return; @@ -47,7 +47,7 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) { return; } m_buffer = m_bufferManager->get(m_bufferName); - if (m_buffer == nullptr) { + if (m_buffer == null) { APPL_ERROR("Error to get the buffer : " << m_bufferName); destroy(); return; @@ -60,35 +60,35 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) { } ememory::SharedPtr tmpPopUp = ewol::widget::StdPopUp::create(); - if (tmpPopUp == nullptr) { + if (tmpPopUp == null) { APPL_ERROR("Can not create a simple pop-up"); destroy(); return; } tmpPopUp->propertyTitle.set("_T{Close un-saved file:}"); tmpPopUp->propertyComment.set("_T{The file named:} '" + m_buffer->getFileName() + "' _T{is curently modify.}
_T{If you don't saves these modifications,}
_T{they will be definitly lost...}"); - ememory::SharedPtr bt = nullptr; + ememory::SharedPtr bt = null; if (m_buffer->hasFileName() == true) { bt = tmpPopUp->addButton("_T{Save}", true); - if (bt != nullptr) { + if (bt != null) { bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveValidate); } } bt = tmpPopUp->addButton("_T{Save As}", true); - if (bt != nullptr) { + if (bt != null) { bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveAsValidate); } bt = tmpPopUp->addButton("_T{Close}", true); - if (bt != nullptr) { + if (bt != null) { bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose); } bt = tmpPopUp->addButton("_T{Cancel}", true); - if (bt != nullptr) { + if (bt != null) { bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel); } tmpPopUp->propertyCloseOutEvent.set(true); ememory::SharedPtr tmpWindows = ewol::getContext().getWindows(); - if (tmpWindows == nullptr) { + if (tmpWindows == null) { APPL_ERROR("Error to get the windows."); destroy(); return; @@ -107,25 +107,25 @@ void appl::WorkerCloseFile::onCallbackCancel() { } void appl::WorkerCloseFile::onCallbackSaveAsValidate() { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... return; } m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferName); - if (m_worker != nullptr) { + if (m_worker != null) { m_worker->signalSaveDone.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose); m_worker->signalAbort.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel); } } void appl::WorkerCloseFile::onCallbackSaveValidate() { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... signalAbort.emit(); destroy(); return; } - if (m_buffer == nullptr) { + if (m_buffer == null) { APPL_ERROR("Error to get the buffer : oldName=" << m_bufferName); signalAbort.emit(); destroy(); @@ -143,13 +143,13 @@ void appl::WorkerCloseFile::onCallbackSaveValidate() { } void appl::WorkerCloseFile::onCallbackClose() { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... signalAbort.emit(); destroy(); return; } - if (m_buffer == nullptr) { + if (m_buffer == null) { APPL_ERROR("Error to get the buffer : " << m_bufferName); signalAbort.emit(); destroy(); diff --git a/sources/appl/Gui/WorkerSaveAllFile.cpp b/sources/appl/Gui/WorkerSaveAllFile.cpp index 46dcfcf..892207a 100644 --- a/sources/appl/Gui/WorkerSaveAllFile.cpp +++ b/sources/appl/Gui/WorkerSaveAllFile.cpp @@ -15,14 +15,14 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() { void appl::WorkerSaveAllFile::init() { ewol::object::Worker::init(); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); destroy(); return; } // List all current open file : for (auto &it : *m_bufferManager) { - if (it == nullptr) { + if (it == null) { continue; } if (it->isModify() == false) { @@ -55,7 +55,7 @@ appl::WorkerSaveAllFile::~WorkerSaveAllFile() { } void appl::WorkerSaveAllFile::onCallbackSaveAsDone() { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... return; } diff --git a/sources/appl/Gui/WorkerSaveFile.cpp b/sources/appl/Gui/WorkerSaveFile.cpp index d2bb112..d5838c6 100644 --- a/sources/appl/Gui/WorkerSaveFile.cpp +++ b/sources/appl/Gui/WorkerSaveFile.cpp @@ -20,7 +20,7 @@ appl::WorkerSaveFile::WorkerSaveFile() : void appl::WorkerSaveFile::init() { ewol::object::Worker::init(); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { APPL_ERROR("can not call unexistant buffer manager ... "); destroy(); return; @@ -28,7 +28,7 @@ void appl::WorkerSaveFile::init() { if (*propertyBufferName == "") { // need to find the curent file ... ememory::SharedPtr tmpp = m_bufferManager->getBufferSelected(); - if (tmpp == nullptr) { + if (tmpp == null) { APPL_ERROR("No selected buffer now ..."); destroy(); return; @@ -41,7 +41,7 @@ void appl::WorkerSaveFile::init() { return; } ememory::SharedPtr tmpBuffer = m_bufferManager->get(*propertyBufferName); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { APPL_ERROR("Error to get the buffer : " << *propertyBufferName); destroy(); return; @@ -55,7 +55,7 @@ void appl::WorkerSaveFile::init() { } } m_chooser = ewol::widget::FileChooser::create(); - if (m_chooser == nullptr) { + if (m_chooser == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); destroy(); return; @@ -66,7 +66,7 @@ void appl::WorkerSaveFile::init() { m_chooser->propertyPath.set(tmpName.getNameFolder()); m_chooser->propertyFile.set(tmpName.getNameFile()); ememory::SharedPtr tmpWindows = ewol::getContext().getWindows(); - if (tmpWindows == nullptr) { + if (tmpWindows == null) { APPL_ERROR("Error to get the windows."); destroy(); return; @@ -86,7 +86,7 @@ void appl::WorkerSaveFile::onCallbackCancel() { } void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) { - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { // nothing to do in this case ==> can do nothing ... destroy(); return; @@ -102,7 +102,7 @@ void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) { return; } ememory::SharedPtr tmpBuffer = m_bufferManager->get(*propertyBufferName); - if (tmpBuffer == nullptr) { + if (tmpBuffer == null) { APPL_ERROR("Error to get the buffer : " << *propertyBufferName); destroy(); return; diff --git a/sources/appl/HighlightManager.cpp b/sources/appl/HighlightManager.cpp index 149d833..5016b66 100644 --- a/sources/appl/HighlightManager.cpp +++ b/sources/appl/HighlightManager.cpp @@ -29,7 +29,7 @@ void appl::highlightManager::init() { // get the subfolder list : etk::Vector list = myFile.folderGetSubList(false, true, false,false); for (auto &it : list) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getNodeType() != etk::typeNode_folder) { @@ -38,10 +38,10 @@ void appl::highlightManager::init() { etk::String filename = it->getName() + "/highlight.xml"; APPL_DEBUG("Load xml name : " << filename); ememory::SharedPtr myHightLine = appl::Highlight::create(filename); - if (myHightLine != nullptr) { + if (myHightLine != null) { // Check if the language name already exist for (auto &it2 : hlList) { - if ( it2 != nullptr + if ( it2 != null && it2->getTypeName() == myHightLine->getTypeName() ) { APPL_WARNING("LANGUAGE : replace pattern name: '" << myHightLine->getTypeName() << "' with file '" << filename << "' replace: " << it2->getName()); } @@ -53,7 +53,7 @@ void appl::highlightManager::init() { } // display : for (auto &it : hlList) { - if (it == nullptr) { + if (it == null) { continue; } it->display(); @@ -77,7 +77,7 @@ etk::String appl::highlightManager::getTypeFile(const etk::String& _fileName) { APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types"); etk::Vector>& hlList = s_list(); for (auto &it : hlList) { - if (it == nullptr) { + if (it == null) { continue; } APPL_WARNING(" check : " << it->getTypeName()); @@ -94,7 +94,7 @@ etk::String appl::highlightManager::getFileWithTypeType(const etk::String& _type return ""; } for (auto &it : s_list()) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getTypeName() == _type) { diff --git a/sources/appl/TextPluginCopy.cpp b/sources/appl/TextPluginCopy.cpp index a44934f..4036dc4 100644 --- a/sources/appl/TextPluginCopy.cpp +++ b/sources/appl/TextPluginCopy.cpp @@ -21,7 +21,7 @@ appl::TextPluginCopy::TextPluginCopy() : void appl::TextPluginCopy::onPluginEnable(appl::TextViewer& _textDrawer) { // add event : ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { m_menuIdTitle = menu->addTitle("_T{Edit}"); if (m_menuIdTitle != -1) { m_menuIdCopy = menu->add(m_menuIdTitle, "_T{Copy}", "", "appl::TextPluginCopy::menu:copy"); @@ -40,7 +40,7 @@ void appl::TextPluginCopy::onPluginDisable(appl::TextViewer& _textDrawer) { _textDrawer.ext_shortCutRm("appl::TextPluginCopy::copy"); _textDrawer.ext_shortCutRm("appl::TextPluginCopy::Paste"); ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { menu->remove(m_menuIdRemove); menu->remove(m_menuIdPast); menu->remove(m_menuIdCut); diff --git a/sources/appl/TextPluginCtags.cpp b/sources/appl/TextPluginCtags.cpp index 5c42de4..c566bf5 100644 --- a/sources/appl/TextPluginCtags.cpp +++ b/sources/appl/TextPluginCtags.cpp @@ -19,7 +19,7 @@ void appl::setCtagsFileName(const etk::String& _file) { appl::TextPluginCtags::TextPluginCtags() : m_tagFolderBase(""), m_tagFilename(""), - m_ctagFile(nullptr) { + m_ctagFile(null) { m_activateOnReceiveShortCut = true; // load buffer manager: m_bufferManager = appl::BufferManager::create(); @@ -47,7 +47,7 @@ void appl::TextPluginCtags::onPluginDisable(appl::TextViewer& _textDrawer) { } void appl::TextPluginCtags::jumpTo(const etk::String& _name) { - if (m_ctagFile == nullptr) { + if (m_ctagFile == null) { APPL_WARNING("No ctags file open"); return; } @@ -69,7 +69,7 @@ void appl::TextPluginCtags::jumpTo(const etk::String& _name) { if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) { APPL_INFO("Multiple file destination ..."); ememory::SharedPtr tmpWidget = appl::TagFileSelection::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID); @@ -91,7 +91,7 @@ void appl::TextPluginCtags::jumpTo(const etk::String& _name) { void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _lineId) { // save the current file in the history // TODO : registerHistory(); - if (m_bufferManager != nullptr) { + if (m_bufferManager != null) { etk::String plop = _filename; while (plop[0] == '/') { plop.erase(0); @@ -105,9 +105,9 @@ void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _line void appl::TextPluginCtags::loadTagFile() { tagFileInfo info; // close previous tag file - if (nullptr != m_ctagFile) { + if (null != m_ctagFile) { tagsClose(m_ctagFile); - m_ctagFile = nullptr; + m_ctagFile = null; } if (m_tagFilename == "") { return; @@ -115,7 +115,7 @@ void appl::TextPluginCtags::loadTagFile() { // load (open) the tag file : APPL_INFO("try to open tag file : " << m_tagFilename); m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info); - if (nullptr != m_ctagFile) { + if (null != m_ctagFile) { APPL_INFO("open exuberant Ctags file is OK ..."); } else { APPL_INFO("Error to open ctags file ..."); @@ -132,7 +132,7 @@ void appl::TextPluginCtags::printTag(const tagEntry *_entry) { << "\" at line="<< (int32_t)_entry->address.lineNumber); APPL_INFO("Extention field : "); - if (_entry->kind != nullptr && _entry->kind [0] != '\0') { + if (_entry->kind != null && _entry->kind [0] != '\0') { APPL_INFO(" kind : " << _entry->kind); } if (_entry->fileScope) { @@ -170,7 +170,7 @@ bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer, if (_shortCutName == "appl::TextPluginCtags::OpenCtagsFile") { APPL_INFO("Request opening ctag file"); ememory::SharedPtr tmpWidget = ewol::widget::FileChooser::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget == > display might be in error"); return true; } diff --git a/sources/appl/TextPluginData.hpp b/sources/appl/TextPluginData.hpp index 770be15..8e7aa3f 100644 --- a/sources/appl/TextPluginData.hpp +++ b/sources/appl/TextPluginData.hpp @@ -21,7 +21,7 @@ namespace appl { DECLARE_FACTORY(TextViewerPluginData); virtual ~TextViewerPluginData() { for (size_t iii = 0; iii < m_specificData.size() ; ++iii) { - if (m_specificData[iii].second != nullptr) { + if (m_specificData[iii].second != null) { remove(*m_specificData[iii].second); } } @@ -34,7 +34,7 @@ namespace appl { auto it = m_specificData.begin(); while(it != m_specificData.end()) { ememory::SharedPtr buf = it->first.lock(); - if (buf == nullptr) { + if (buf == null) { it = m_specificData.erase(it); continue; } @@ -44,9 +44,9 @@ namespace appl { ++it; } ememory::UniquePtr data(ETK_NEW(TYPE)); - if (data == nullptr) { + if (data == null) { APPL_ERROR("ALLOCATION plugin data error"); - return nullptr; + return null; } TYPE* copyPocalPointer = data.get(); ememory::WeakPtr tmpBuffer = _textDrawer.internalGetBuffer(); @@ -58,7 +58,7 @@ namespace appl { bool onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName) { TYPE* data = getDataRef(_textDrawer); - if (data == nullptr) { + if (data == null) { return false; } return onDataReceiveShortCut(_textDrawer, _shortCutName, *data); @@ -67,7 +67,7 @@ namespace appl { const appl::Buffer::Iterator& _pos, const etk::String& _data) { TYPE* data = getDataRef(_textDrawer); - if (data == nullptr) { + if (data == null) { return false; } return onDataWrite(_textDrawer, _pos, _data, *data); @@ -77,7 +77,7 @@ namespace appl { const etk::String& _data, const appl::Buffer::Iterator& _posEnd) { TYPE* data = getDataRef(_textDrawer); - if (data == nullptr) { + if (data == null) { return false; } return onDataReplace(_textDrawer, _pos, _data, _posEnd, *data); @@ -86,7 +86,7 @@ namespace appl { const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { TYPE* data = getDataRef(_textDrawer); - if (data == nullptr) { + if (data == null) { return false; } return onDataRemove(_textDrawer, _pos, _posEnd, *data); diff --git a/sources/appl/TextPluginHistory.cpp b/sources/appl/TextPluginHistory.cpp index 90b3e53..97142a5 100644 --- a/sources/appl/TextPluginHistory.cpp +++ b/sources/appl/TextPluginHistory.cpp @@ -21,7 +21,7 @@ appl::TextPluginHistory::TextPluginHistory() : void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) { ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { m_menuIdTitle = menu->addTitle("_T{Edit}"); if (m_menuIdTitle != -1) { m_menuIdUndo = menu->add(m_menuIdTitle, "_T{Undo}", "THEME:GUI:Undo.svg", "appl::TextPluginHistory::menu:undo"); @@ -37,7 +37,7 @@ void appl::TextPluginHistory::onPluginDisable(appl::TextViewer& _textDrawer) { _textDrawer.ext_shortCutRm("appl::TextPluginHistory::Undo"); _textDrawer.ext_shortCutRm("appl::TextPluginHistory::Redo"); ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { menu->remove(m_menuIdRedo); menu->remove(m_menuIdUndo); menu->remove(m_menuIdTitle); @@ -57,7 +57,7 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe if (_data.m_redo.size() == 0) { return true; } - if (_data.m_redo[_data.m_redo.size()-1] == nullptr) { + if (_data.m_redo[_data.m_redo.size()-1] == null) { _data.m_redo.popBack(); return true; } @@ -73,7 +73,7 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe if (_data.m_undo.size() == 0) { return true; } - if (_data.m_undo[_data.m_undo.size()-1] == nullptr) { + if (_data.m_undo[_data.m_undo.size()-1] == null) { _data.m_undo.popBack(); return true; } @@ -94,11 +94,11 @@ void appl::TextPluginHistory::clearRedo(appl::PluginHistoryData& _data) { return; } for (size_t iii=0; iii<_data.m_redo.size(); ++iii) { - if (_data.m_redo[iii] == nullptr) { + if (_data.m_redo[iii] == null) { continue; } ETK_DELETE(appl::History, _data.m_redo[iii]); - _data.m_redo[iii] = nullptr; + _data.m_redo[iii] = null; } _data.m_redo.clear(); } @@ -108,11 +108,11 @@ void appl::TextPluginHistory::clearUndo(appl::PluginHistoryData& _data) { return; } for (size_t iii=0; iii<_data.m_undo.size(); ++iii) { - if (_data.m_undo[iii] == nullptr) { + if (_data.m_undo[iii] == null) { continue; } ETK_DELETE(appl::History, _data.m_undo[iii]); - _data.m_undo[iii] = nullptr; + _data.m_undo[iii] = null; } _data.m_undo.clear(); } @@ -126,7 +126,7 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer, return false; } appl::History *tmpElement = ETK_NEW(appl::History); - if (tmpElement != nullptr) { + if (tmpElement != null) { tmpElement->m_addedText = _strData; tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_endPosRemoved = (int64_t)_pos; @@ -134,13 +134,13 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer, APPL_ERROR("History allocation error"); } _textDrawer.writeDirect(_strData, _pos); - if (tmpElement != nullptr) { + if (tmpElement != null) { tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor(); clearRedo(_data); _data.m_undo.pushBack(tmpElement); } ememory::SharedPtr mng = m_pluginManager.lock(); - if (mng!=nullptr) { + if (mng!=null) { mng->onCursorMove(_textDrawer, _textDrawer.cursor()); } return true; @@ -155,20 +155,20 @@ bool appl::TextPluginHistory::onDataReplace(appl::TextViewer& _textDrawer, return false; } appl::History *tmpElement = ETK_NEW(appl::History); - if (tmpElement != nullptr) { + if (tmpElement != null) { tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_addedText = _strData; tmpElement->m_endPosRemoved = (int64_t)_posEnd; _textDrawer.copy(tmpElement->m_removedText, _pos, _posEnd); } _textDrawer.replaceDirect(_strData, _pos, _posEnd); - if (tmpElement != nullptr) { + if (tmpElement != null) { tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor(); clearRedo(_data); _data.m_undo.pushBack(tmpElement); } ememory::SharedPtr mng = m_pluginManager.lock(); - if (mng!=nullptr) { + if (mng!=null) { mng->onCursorMove(_textDrawer, _textDrawer.cursor()); } return true; @@ -182,7 +182,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer, return false; } appl::History *tmpElement = ETK_NEW(appl::History); - if (tmpElement != nullptr) { + if (tmpElement != null) { tmpElement->m_addedText = ""; tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_endPosAdded = tmpElement->m_posAdded; @@ -193,7 +193,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer, } _textDrawer.removeDirect(); ememory::SharedPtr mng = m_pluginManager.lock(); - if (mng!=nullptr) { + if (mng!=null) { mng->onCursorMove(_textDrawer, _textDrawer.cursor()); } return true; diff --git a/sources/appl/TextPluginManager.cpp b/sources/appl/TextPluginManager.cpp index 42e8866..a7b1e33 100644 --- a/sources/appl/TextPluginManager.cpp +++ b/sources/appl/TextPluginManager.cpp @@ -31,7 +31,7 @@ void appl::textPluginManager::addDefaultPlugin() { } void appl::textPluginManager::addPlugin(ememory::SharedPtr _plugin) { - if (_plugin == nullptr) { + if (_plugin == null) { return; } APPL_DEBUG("Add plugin : " << _plugin->getObjectType()); @@ -58,7 +58,7 @@ void appl::textPluginManager::addPlugin(ememory::SharedPtr viewer = m_currentViewer.lock(); - if (viewer != nullptr) { + if (viewer != null) { _plugin->onPluginEnable(*viewer); } } @@ -66,7 +66,7 @@ void appl::textPluginManager::addPlugin(ememory::SharedPtr(_widget.sharedFromThis()); for (auto &it : m_list) { - if (it == nullptr) { + if (it == null) { continue; } it->onPluginEnable(_widget); @@ -76,7 +76,7 @@ void appl::textPluginManager::connect(appl::TextViewer& _widget) { void appl::textPluginManager::disconnect(appl::TextViewer& _widget) { m_currentViewer.reset(); for (auto &it : m_list) { - if (it == nullptr) { + if (it == null) { continue; } it->onPluginDisable(_widget); @@ -86,7 +86,7 @@ void appl::textPluginManager::disconnect(appl::TextViewer& _widget) { bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer, const ewol::event::Entry& _event) { for (auto &it : m_listOnEventEntry) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onEventEntry(_textDrawer, _event) == true ) { @@ -99,7 +99,7 @@ bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer, const ewol::event::Input& _event) { for (auto &it : m_listOnEventInput) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onEventInput(_textDrawer, _event) == true ) { @@ -113,7 +113,7 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer, const appl::Buffer::Iterator& _pos, const etk::String& _data) { for (auto &it : m_listOnWrite) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onWrite(_textDrawer, _pos, _data) == true ) { @@ -128,7 +128,7 @@ bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer, const etk::String& _data, const appl::Buffer::Iterator& _posEnd) { for (auto &it : m_listOnReplace) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onReplace(_textDrawer, _pos, _data, _posEnd) == true ) { @@ -142,7 +142,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { for (auto &it : m_listOnRemove) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onRemove(_textDrawer, _pos, _posEnd) == true ) { @@ -155,7 +155,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName) { for (auto &it : m_listOnReceiveShortCutViewer) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onReceiveShortCut(_textDrawer, _shortCutName) == true ) { @@ -168,7 +168,7 @@ bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer, const appl::Buffer::Iterator& _pos) { for (auto &it : m_listOnCursorMove) { - if (it == nullptr) { + if (it == null) { continue; } if (it->onCursorMove(_textDrawer, _pos) == true ) { diff --git a/sources/appl/TextPluginSelectAll.cpp b/sources/appl/TextPluginSelectAll.cpp index 79c70c5..79b82b9 100644 --- a/sources/appl/TextPluginSelectAll.cpp +++ b/sources/appl/TextPluginSelectAll.cpp @@ -17,7 +17,7 @@ appl::TextPluginSelectAll::TextPluginSelectAll() : void appl::TextPluginSelectAll::onPluginEnable(appl::TextViewer& _textDrawer) { ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { m_menuIdTitle = menu->addTitle("_T{Edit}"); if (m_menuIdTitle != -1) { m_menuIdSelectAll = menu->add(m_menuIdTitle, "_T{Select All}", "", "appl::TextPluginSelectAll::menu:select-all"); @@ -33,7 +33,7 @@ void appl::TextPluginSelectAll::onPluginDisable(appl::TextViewer& _textDrawer) { _textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::All"); _textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::None"); ememory::SharedPtr menu = m_menuInterface.lock(); - if (menu != nullptr) { + if (menu != null) { menu->remove(m_menuIdSelectNone); menu->remove(m_menuIdSelectAll); menu->remove(m_menuIdTitle); diff --git a/sources/appl/ctags/readtags.cpp b/sources/appl/ctags/readtags.cpp index e72df1b..b2bc4a4 100644 --- a/sources/appl/ctags/readtags.cpp +++ b/sources/appl/ctags/readtags.cpp @@ -138,7 +138,7 @@ static int growString (vstring *s) newLength = 2 * s->size; newLine = (char*) realloc (s->buffer, newLength); } - if (newLine == nullptr) + if (newLine == NULL) perror ("string too large"); else { @@ -154,13 +154,13 @@ static void copyName (tagFile *const file) { size_t length; const char *end = strchr (file->line.buffer, '\t'); - if (end == nullptr) + if (end == NULL) { end = strchr (file->line.buffer, '\n'); - if (end == nullptr) + if (end == NULL) end = strchr (file->line.buffer, '\r'); } - if (end != nullptr) + if (end != NULL) length = end - file->line.buffer; else length = strlen (file->line.buffer); @@ -175,7 +175,7 @@ static int readTagLineRaw (tagFile *const file) int result = 1; int reReadLine; - /* If reading the line places any character other than a null or a + /* If reading the line places any character other than a NULL or a * newline at the last character position in the buffer (one less than * the buffer size), then we must resize the buffer and reattempt to read * the line. @@ -189,7 +189,7 @@ static int readTagLineRaw (tagFile *const file) reReadLine = 0; *pLastChar = '\0'; line = fgets (file->line.buffer, (int) file->line.size, file->fp); - if (line == nullptr) + if (line == NULL) { /* read error */ if (! feof (file->fp)) @@ -236,7 +236,7 @@ static tagResult growFields (tagFile *const file) unsigned short newCount = (unsigned short) 2 * file->fields.max; tagExtensionField *newFields = (tagExtensionField*) realloc (file->fields.list, newCount * sizeof (tagExtensionField)); - if (newFields == nullptr) + if (newFields == NULL) perror ("too many extension fields"); else { @@ -251,7 +251,7 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry, char *const string) { char *p = string; - while (p != nullptr && *p != '\0') + while (p != NULL && *p != '\0') { while (*p == TAB) *p++ = '\0'; @@ -260,10 +260,10 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry, char *colon; char *field = p; p = strchr (p, TAB); - if (p != nullptr) + if (p != NULL) *p++ = '\0'; colon = strchr (field, ':'); - if (colon == nullptr) + if (colon == NULL) entry->kind = field; else { @@ -295,19 +295,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry) char *p = file->line.buffer; char *tab = strchr (p, TAB); - entry->fields.list = nullptr; + entry->fields.list = NULL; entry->fields.count = 0; - entry->kind = nullptr; + entry->kind = NULL; entry->fileScope = 0; entry->name = p; - if (tab != nullptr) + if (tab != NULL) { *tab = '\0'; p = tab + 1; entry->file = p; tab = strchr (p, TAB); - if (tab != nullptr) + if (tab != NULL) { int fieldsPresent; *tab = '\0'; @@ -321,8 +321,8 @@ static void parseTagLine (tagFile *file, tagEntry *const entry) do { p = strchr (p + 1, delimiter); - } while (p != nullptr && *(p - 1) == '\\'); - if (p == nullptr) + } while (p != NULL && *(p - 1) == '\\'); + if (p == NULL) { /* invalid pattern */ } @@ -351,19 +351,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry) entry->fields.list = file->fields.list; for (i = entry->fields.count ; i < file->fields.max ; ++i) { - file->fields.list [i].key = nullptr; - file->fields.list [i].value = nullptr; + file->fields.list [i].key = NULL; + file->fields.list [i].value = NULL; } } static char *duplicate (const char *str) { - char *result = nullptr; - if (str != nullptr) + char *result = NULL; + if (str != NULL) { result = strdup (str); - if (result == nullptr) - perror (nullptr); + if (result == NULL) + perror (NULL); } return result; } @@ -372,14 +372,14 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info) { fpos_t startOfLine; const size_t prefixLength = strlen (PseudoTagPrefix); - if (info != nullptr) + if (info != NULL) { info->file.format = 1; info->file.sort = TAG_UNSORTED; - info->program.author = nullptr; - info->program.name = nullptr; - info->program.url = nullptr; - info->program.version = nullptr; + info->program.author = NULL; + info->program.name = NULL; + info->program.url = NULL; + info->program.version = NULL; } while (1) { @@ -407,7 +407,7 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info) file->program.url = duplicate (value); else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0) file->program.version = duplicate (value); - if (info != nullptr) + if (info != NULL) { info->file.format = file->format; info->file.sort = file->sortMethod; @@ -440,7 +440,7 @@ static void gotoFirstLogicalTag (tagFile *const file) static tagFile *initialize (const char *const filePath, tagFileInfo *const info) { tagFile *result = (tagFile*) calloc ((size_t) 1, sizeof (tagFile)); - if (result != nullptr) + if (result != NULL) { growString (&result->line); growString (&result->name); @@ -448,10 +448,10 @@ static tagFile *initialize (const char *const filePath, tagFileInfo *const info) result->fields.list = (tagExtensionField*) calloc ( result->fields.max, sizeof (tagExtensionField)); result->fp = fopen (filePath, "r"); - if (result->fp == nullptr) + if (result->fp == NULL) { free (result); - result = nullptr; + result = NULL; info->status.error_number = errno; } else @@ -475,15 +475,15 @@ static void terminate (tagFile *const file) free (file->name.buffer); free (file->fields.list); - if (file->program.author != nullptr) + if (file->program.author != NULL) free (file->program.author); - if (file->program.name != nullptr) + if (file->program.name != NULL) free (file->program.name); - if (file->program.url != nullptr) + if (file->program.url != NULL) free (file->program.url); - if (file->program.version != nullptr) + if (file->program.version != NULL) free (file->program.version); - if (file->search.name != nullptr) + if (file->search.name != NULL) free (file->search.name); memset (file, 0, sizeof (tagFile)); @@ -494,13 +494,13 @@ static void terminate (tagFile *const file) static tagResult readNext (tagFile *const file, tagEntry *const entry) { tagResult result; - if (file == nullptr || ! file->initialized) + if (file == NULL || ! file->initialized) result = TagFailure; else if (! readTagLine (file)) result = TagFailure; else { - if (entry != nullptr) + if (entry != NULL) parseTagLine (file, entry); result = TagSuccess; } @@ -510,13 +510,13 @@ static tagResult readNext (tagFile *const file, tagEntry *const entry) static const char *readFieldValue ( const tagEntry *const entry, const char *const key) { - const char *result = nullptr; + const char *result = NULL; int i; if (strcmp (key, "kind") == 0) result = entry->kind; else if (strcmp (key, "file") == 0) result = EmptyString; - else for (i = 0 ; i < entry->fields.count && result == nullptr ; ++i) + else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i) if (strcmp (entry->fields.list [i].key, key) == 0) result = entry->fields.list [i].value; return result; @@ -650,7 +650,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry, const char *const name, const int options) { tagResult result; - if (file->search.name != nullptr) + if (file->search.name != NULL) free (file->search.name); file->search.name = duplicate (name); file->search.nameLength = strlen (name); @@ -680,7 +680,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry, else { file->search.pos = file->pos; - if (entry != nullptr) + if (entry != NULL) parseTagLine (file, entry); } return result; @@ -699,7 +699,7 @@ static tagResult findNext (tagFile *const file, tagEntry *const entry) else { result = findSequential (file); - if (result == TagSuccess && entry != nullptr) + if (result == TagSuccess && entry != NULL) parseTagLine (file, entry); } return result; @@ -717,7 +717,7 @@ extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info) extern tagResult tagsSetSortType (tagFile *const file, const sortType type) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) { file->sortMethod = type; result = TagSuccess; @@ -728,7 +728,7 @@ extern tagResult tagsSetSortType (tagFile *const file, const sortType type) extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) { gotoFirstLogicalTag (file); result = readNext (file, entry); @@ -739,15 +739,15 @@ extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry) extern tagResult tagsNext (tagFile *const file, tagEntry *const entry) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) result = readNext (file, entry); return result; } extern const char *tagsField (const tagEntry *const entry, const char *const key) { - const char *result = nullptr; - if (entry != nullptr) + const char *result = NULL; + if (entry != NULL) result = readFieldValue (entry, key); return result; } @@ -756,7 +756,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, const char *const name, const int options) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) result = find (file, entry, name, options); return result; } @@ -764,7 +764,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) result = findNext (file, entry); return result; } @@ -772,7 +772,7 @@ extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry) extern tagResult tagsClose (tagFile *const file) { tagResult result = TagFailure; - if (file != nullptr && file->initialized) + if (file != NULL && file->initialized) { terminate (file); result = TagSuccess; @@ -804,7 +804,7 @@ static void printTag (const tagEntry *entry) entry->name, entry->file, entry->address.pattern); if (extensionFields) { - if (entry->kind != nullptr && entry->kind [0] != '\0') + if (entry->kind != NULL && entry->kind [0] != '\0') printf ("%s\tkind:%s", sep, entry->kind); if (entry->fileScope) printf ("%s\tfile:", sep); @@ -825,7 +825,7 @@ static void findTag (const char *const name, const int options) tagFileInfo info; tagEntry entry; tagFile *const file = tagsOpen (TagFileName, &info); - if (file == nullptr) + if (file == NULL) { fprintf (stderr, "%s: cannot open tag file: %s: %s\n", ProgramName, strerror (info.status.error_number), name); @@ -851,7 +851,7 @@ static void listTags () tagFileInfo info; tagEntry entry; tagFile *const file = tagsOpen (TagFileName, &info); - if (file == nullptr) + if (file == NULL) { fprintf (stderr, "%s: cannot open tag file: %s: %s\n", ProgramName, strerror (info.status.error_number), TagFileName); @@ -927,7 +927,7 @@ extern int main (int argc, char **argv) ++j; if (arg [j] == '\0') SortMethod = TAG_SORTED; - else if (strchr ("012", arg[j]) != nullptr) + else if (strchr ("012", arg[j]) != NULL) SortMethod = (sortType) (arg[j] - '0'); else { diff --git a/sources/appl/ctags/readtags.hpp b/sources/appl/ctags/readtags.hpp index 54e63a9..e5ddbc2 100644 --- a/sources/appl/ctags/readtags.hpp +++ b/sources/appl/ctags/readtags.hpp @@ -114,7 +114,7 @@ typedef struct { /* address for locating tag in source file */ struct { /* pattern for locating source line - * (may be nullptr if not present) */ + * (may be null if not present) */ const char *pattern; /* line number in source file of tag definition @@ -122,7 +122,7 @@ typedef struct { unsigned long lineNumber; } address; - /* kind of tag (may by name, character, or nullptr if not known) */ + /* kind of tag (may by name, character, or null if not known) */ const char *kind; /* is tag of file-limited scope? */ diff --git a/sources/appl/init.cpp b/sources/appl/init.cpp index fe25813..6e6128e 100644 --- a/sources/appl/init.cpp +++ b/sources/appl/init.cpp @@ -85,7 +85,7 @@ class MainApplication : public ewol::context::Application { ememory::SharedPtr basicWindows = MainWindows::create(); - if (basicWindows == nullptr) { + if (basicWindows == null) { APPL_ERROR("Can not allocate the basic windows"); _context.exit(-1); return; @@ -141,7 +141,7 @@ class MainApplication : public ewol::context::Application { } void onKillDemand(ewol::Context& _context) override { APPL_INFO("==> User demand kill ... " PROJECT_NAME " (START)"); - if (m_bufferManager == nullptr) { + if (m_bufferManager == null) { _context.exit(0); } APPL_TODO("Implement the check of buffer not saved ...");