diff --git a/lutinMacro_zeus.py b/lutinMacro_zeus.py index 35f9790..6cb523d 100644 --- a/lutinMacro_zeus.py +++ b/lutinMacro_zeus.py @@ -550,7 +550,7 @@ class ServiceDefinition: out += " data.resize(data.size()+4);\n" out += " uint32_t fullId = 0;\n" # convert the object in a real System Object .... - out += " if (m_iface != nullptr) {\n" + out += " if (m_iface != null) {\n" out += " uint16_t id = m_iface->getAddress();\n" out += " uint16_t idObj = m_iface->getNewObjectId();\n" out += " ememory::SharedPtr> obj = ememory::makeShared>(m_iface, idObj, _value);\n" @@ -575,8 +575,8 @@ class ServiceDefinition: out += " \n" out += " template<> " + self.prop["name_class_proxy"] + " futureGetValue<" + self.prop["name_class_proxy"] + ">(ememory::SharedPtr& _promise) {\n" out += " ememory::SharedPtr out;\n" - out += " if ( _promise == nullptr\n" - out += " || _promise->getRaw() == nullptr) {\n" + out += " if ( _promise == null\n" + out += " || _promise->getRaw() == null) {\n" out += " return zeus::ObjectRemote(out);\n" out += " }\n" out += " if (_promise->getRaw()->getType() != zeus::message::type::answer) {\n" @@ -661,21 +661,21 @@ class ServiceDefinition: out += space + '_interface.addAuthor("' + elem.split("<")[0] + '", "' + elem.split("<")[1].replace(">","") + '");\n'; if len(self.functions) != 0 \ or len(self.attributes) != 0: - out += space + "zeus::AbstractFunction* func = nullptr;\n" + out += space + "zeus::AbstractFunction* func = null;\n" for elem in self.attributes: out += space + 'func = _interface.advertise("' + elem.name + '.set", &' + self.prop["name_class"] + '::_internalWrapperProperty_set' + capital_first(elem.name) + ');\n' - out += space + 'if (func != nullptr) {\n' + out += space + 'if (func != null) {\n' if elem.brief != "": out += space + ' func->setDescription("Set parameter ' + elem.brief + '");\n' out += space + '}\n' out += space + 'func = _interface.advertise("' + elem.name + '.get", &' + self.prop["name_class"] + '::_internalWrapperProperty_get' + capital_first(elem.name) + ');\n' - out += space + 'if (func != nullptr) {\n' + out += space + 'if (func != null) {\n' if elem.brief != "": out += space + ' func->setDescription("Get parameter ' + elem.brief + '");\n' out += space + '}\n' for elem in self.functions: out += space + 'func = _interface.advertise("' + elem.name + '", &' + self.prop["name_class"] + '::' + elem.name + ');\n' - out += space + 'if (func != nullptr) {\n' + out += space + 'if (func != null) {\n' space += " " if elem.brief != "": out += space + 'func->setDescription("' + elem.brief + '");\n' diff --git a/tools/gateway/appl/DirectInterface.cpp b/tools/gateway/appl/DirectInterface.cpp index e1b5977..b2b0bef 100644 --- a/tools/gateway/appl/DirectInterface.cpp +++ b/tools/gateway/appl/DirectInterface.cpp @@ -84,7 +84,7 @@ bool appl::DirectInterface::start(appl::GateWay* _gateway) { } void appl::DirectInterface::receive(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } // check transaction ID != 0 @@ -100,7 +100,7 @@ void appl::DirectInterface::receive(ememory::SharedPtr _value) { return; } // Check gateway corectly connected - if (m_gateway == nullptr) { + if (m_gateway == null) { answerProtocolError(transactionId, "GateWay error"); return; } diff --git a/tools/gateway/appl/GateWay.cpp b/tools/gateway/appl/GateWay.cpp index 8f5d234..c7acce2 100644 --- a/tools/gateway/appl/GateWay.cpp +++ b/tools/gateway/appl/GateWay.cpp @@ -22,7 +22,7 @@ namespace appl { bool m_serviceAccess; public: TcpServerInput(appl::GateWay* _gateway, bool _serviceAccess) : - m_thread(nullptr), + m_thread(null), m_threadRunning(false), m_gateway(_gateway), m_serviceAccess(_serviceAccess) { @@ -36,21 +36,21 @@ namespace appl { m_threadRunning = true; APPL_INFO("Start waiting on " << _host << " " << _port); m_thread = ETK_NEW(ethread::Thread, [&](){ threadCallback();}, "GatewayListening"); - if (m_thread == nullptr) { + if (m_thread == null) { m_threadRunning = false; APPL_ERROR("creating callback thread!"); return; } } void stop() { - if (m_thread != nullptr) { + if (m_thread != null) { m_threadRunning = false; } m_interface.unlink(); - if (m_thread != nullptr) { + if (m_thread != null) { m_thread->join(); ETK_DELETE(ethread::Thread, m_thread); - m_thread = nullptr; + m_thread = null; } } void threadCallback() { @@ -158,7 +158,7 @@ void appl::GateWay::stop() { bool appl::GateWay::serviceExist(const etk::String& _service) { for (auto &it : m_listIO) { - if (it == nullptr) { + if (it == null) { continue; } if (it->isConnected() == false) { @@ -175,7 +175,7 @@ bool appl::GateWay::serviceExist(const etk::String& _service) { uint16_t appl::GateWay::serviceClientIdGet(const etk::String& _service) { for (auto &it : m_listIO) { - if (it == nullptr) { + if (it == null) { continue; } if (it->isConnected() == false) { @@ -195,7 +195,7 @@ etk::Vector appl::GateWay::getAllServiceName() { etk::Vector out; // TODO : Change this it is old and deprecated ... for (auto &it : m_listIO) { - if (it == nullptr) { + if (it == null) { continue; } if (it->isConnected() == false) { @@ -213,7 +213,7 @@ bool appl::GateWay::send(ememory::SharedPtr _data) { auto it = m_listIO.begin(); uint16_t id = _data->getDestinationId(); while (it != m_listIO.end()) { - if (*it == nullptr) { + if (*it == null) { continue; } if ((*it)->isConnected() == false) { @@ -235,7 +235,7 @@ void appl::GateWay::cleanIO() { { auto it = m_listIO.begin(); while (it != m_listIO.end()) { - if (*it != nullptr) { + if (*it != null) { if ((*it)->isConnected() == false) { tmpIDToRemove.pushBack((*it)->getId()); it = m_listIO.erase(it); @@ -252,7 +252,7 @@ void appl::GateWay::cleanIO() { { auto it = m_listTemporaryIO.begin(); while (it != m_listTemporaryIO.end()) { - if (*it != nullptr) { + if (*it != null) { if ((*it)->isConnected() == false) { it = m_listTemporaryIO.erase(it); continue; @@ -265,13 +265,13 @@ void appl::GateWay::cleanIO() { } } // Clean router IO - if (m_routerClient != nullptr) { + if (m_routerClient != null) { m_routerClient->clean(); } if (tmpIDToRemove.size() != 0) { APPL_TODO("Remove Ids ... " << tmpIDToRemove); for (auto &it : m_listIO) { - if (it == nullptr) { + if (it == null) { continue; } if (it->isConnected() == false) { @@ -286,11 +286,11 @@ void appl::GateWay::cleanIO() { } // Simply display All active objkect in all interfaces: for( auto &it : m_listIO) { - if (it == nullptr) { + if (it == null) { continue; } zeus::WebServer* tmpp = it->getInterface(); - if (tmpp == nullptr) { + if (tmpp == null) { continue; } tmpp->listObjects(); @@ -341,7 +341,7 @@ bool appl::GateWay::checkIsAlive(const echrono::Duration& _timeout) { return true; } // If no router ==> dead - if (m_routerClient == nullptr) { + if (m_routerClient == null) { return false; } // check only for smallest time-out : 1 second. diff --git a/tools/gateway/appl/IOInterface.cpp b/tools/gateway/appl/IOInterface.cpp index 0aaacb5..71a1348 100644 --- a/tools/gateway/appl/IOInterface.cpp +++ b/tools/gateway/appl/IOInterface.cpp @@ -60,7 +60,7 @@ const etk::Vector& appl::IOInterface::getServiceList() { } void appl::IOInterface::receive(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } APPL_INFO("RECEIVE message " << _value); @@ -128,7 +128,7 @@ void appl::IOInterface::receive(ememory::SharedPtr _value) { if (callFunction == "identify") { etk::String clientName = callObj->getParameter(0); etk::String clientTocken = callObj->getParameter(1); - if (m_userService == nullptr) { + if (m_userService == null) { answerProtocolError(transactionId, "gateWay internal error 3"); return; } @@ -318,7 +318,7 @@ void appl::IOInterface::receive(ememory::SharedPtr _value) { } } else { // TODO: Check here if the user is athorised to send data to a specific client ... - if (m_gateway != nullptr) { + if (m_gateway != null) { m_gateway->send(_value); } } diff --git a/tools/gateway/appl/RouterInterface.cpp b/tools/gateway/appl/RouterInterface.cpp index 576c730..e727134 100644 --- a/tools/gateway/appl/RouterInterface.cpp +++ b/tools/gateway/appl/RouterInterface.cpp @@ -34,7 +34,7 @@ zeus::WebServer* appl::clientSpecificInterface::getInterface() { } bool appl::clientSpecificInterface::isConnected() { - if (m_interfaceWeb == nullptr) { + if (m_interfaceWeb == null) { return false; } if (m_state == appl::clientState::unconnect) { @@ -56,7 +56,7 @@ void appl::clientSpecificInterface::send(ememory::SharedPtr _valu #if 0 void appl::clientSpecificInterface::receive(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } //APPL_ERROR(" ==> parse DATA ..."); @@ -82,7 +82,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v m_interfaceWeb->answerError(transactionId, _value->getClientId(), _value->getServiceId(), "NOT-CONNECTED-SERVICE"); return; } - if (m_listConnectedService[serviceId] == nullptr) { + if (m_listConnectedService[serviceId] == null) { // TODO ... APPL_ERROR("TODO : Manage this case ..."); return; @@ -129,7 +129,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v if (callFunction == "identify") { etk::String clientName = callObj->getParameter(0); etk::String clientTocken = callObj->getParameter(1); - if (m_userService == nullptr) { + if (m_userService == null) { answerProtocolError(transactionId, "gateWay internal error 3"); return; } @@ -224,7 +224,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v // Check if service already link: auto it = m_listConnectedService.begin(); while (it != m_listConnectedService.end()) { - if (*it == nullptr) { + if (*it == null) { ++it; continue; } @@ -241,7 +241,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v return; } ememory::SharedPtr srv = m_gatewayInterface->get(serviceName); - if (srv != nullptr) { + if (srv != null) { zeus::Future futLink = srv->m_interfaceClient.call(m_uid, ZEUS_ID_SERVICE_ROOT, "_new", m_userConnectionName, m_clientName, m_clientgroups); futLink.wait(); // TODO: Set timeout ... if (futLink.hasError() == true) { @@ -276,7 +276,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v m_interfaceWeb->answerError(transactionId, _value->getClientId(), _value->getServiceId(), "ERROR-CREATE-SERVICE-INSTANCE"); return; } - m_listConnectedService[localServiceID] = nullptr; + m_listConnectedService[localServiceID] = null; m_interfaceWeb->answerValue(transactionId, _value->getClientId(), _value->getServiceId(), true); return; } @@ -290,7 +290,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v m_interfaceWeb->answerError(transactionId, _value->getClientId(), _value->getServiceId(), "NOT-CONNECTED-SERVICE"); return; } else { - if (m_listConnectedService[serviceId] == nullptr) { + if (m_listConnectedService[serviceId] == null) { // TODO ... APPL_ERROR("TODO : Manage this case ..."); return; @@ -298,7 +298,7 @@ void appl::clientSpecificInterface::receive(ememory::SharedPtr _v auto fut = m_listConnectedService[serviceId]->m_interfaceClient.callForward(m_uid, _value, (uint64_t(m_uid) << 32) + uint64_t(transactionId)); fut.andAll([=](zeus::FutureBase _ret) { ememory::SharedPtr tmpp = _ret.getRaw(); - if (tmpp == nullptr) { + if (tmpp == null) { return true; } APPL_DEBUG(" ==> transmit : " << tmpp->getTransactionId() << " -> " << transactionId); @@ -352,14 +352,14 @@ appl::RouterInterface::~RouterInterface() { void appl::RouterInterface::stop() { /* TODO ... for (auto &it : m_listConnectedService) { - if (it == nullptr) { + if (it == null) { continue; } it->m_interfaceClient.callClient(m_uid, "_delete"); } - if (m_userService != nullptr) { + if (m_userService != null) { m_userService->m_interfaceClient.callClient(m_uid2, "_delete"); - m_userService = nullptr; + m_userService = null; } m_listConnectedService.clear(); */ @@ -373,7 +373,7 @@ bool appl::RouterInterface::isAlive() { void appl::RouterInterface::onClientData(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } // Get client ID: diff --git a/tools/gateway/appl/main-gateway.cpp b/tools/gateway/appl/main-gateway.cpp index 1048c06..ebdce56 100644 --- a/tools/gateway/appl/main-gateway.cpp +++ b/tools/gateway/appl/main-gateway.cpp @@ -46,10 +46,10 @@ class PlugginAccess { PlugginAccess(const etk::String& _name, const etk::String& _fullName) : m_name(_name), m_fullName(_fullName), - m_handle(nullptr), - m_SERVICE_IO_init(nullptr), - m_SERVICE_IO_uninit(nullptr), - m_SERVICE_IO_instanciate(nullptr) { + m_handle(null), + m_SERVICE_IO_init(null), + m_SERVICE_IO_uninit(null), + m_SERVICE_IO_instanciate(null) { etk::String srv = etk::FSNodeGetApplicationPath() + "/../lib/lib" + m_fullName + "-impl.so"; APPL_PRINT("++++++++++++++++++++++++++++++++"); APPL_PRINT("++ srv: '" << m_name << "' "); @@ -61,29 +61,29 @@ class PlugginAccess { APPL_ERROR("Can not load Lbrary:" << dlerror()); return; } - char *error = nullptr; + char *error = null; m_SERVICE_IO_init = (SERVICE_IO_init_t)dlsym(m_handle, "SERVICE_IO_init"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_init = nullptr; + if (error != null) { + m_SERVICE_IO_init = null; APPL_WARNING("Can not function SERVICE_IO_init :" << error); } m_SERVICE_IO_uninit = (SERVICE_IO_uninit_t)dlsym(m_handle, "SERVICE_IO_uninit"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_uninit = nullptr; + if (error != null) { + m_SERVICE_IO_uninit = null; APPL_WARNING("Can not function SERVICE_IO_uninit :" << error); } m_SERVICE_IO_peridic_call = (SERVICE_IO_peridic_call_t)dlsym(m_handle, "SERVICE_IO_peridic_call"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_uninit = nullptr; + if (error != null) { + m_SERVICE_IO_uninit = null; APPL_WARNING("Can not function SERVICE_IO_uninit :" << error); } m_SERVICE_IO_instanciate = (SERVICE_IO_instanciate_t)dlsym(m_handle, "SERVICE_IO_instanciate"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_instanciate = nullptr; + if (error != null) { + m_SERVICE_IO_instanciate = null; APPL_WARNING("Can not function SERVICE_IO_instanciate:" << error); } } @@ -91,7 +91,7 @@ class PlugginAccess { } bool init(int _argc, const char *_argv[], etk::String _basePath) { - if (m_SERVICE_IO_init == nullptr) { + if (m_SERVICE_IO_init == null) { return false; } @@ -104,7 +104,7 @@ class PlugginAccess { return (*m_SERVICE_IO_init)(_argc, _argv, _basePath); } bool publish(zeus::Client& _client) { - if (m_SERVICE_IO_instanciate == nullptr) { + if (m_SERVICE_IO_instanciate == null) { return false; } _client.serviceAdd(m_name, [=](uint32_t _transactionId, ememory::SharedPtr& _iface, uint32_t _destination) { @@ -117,13 +117,13 @@ class PlugginAccess { return true; } bool uninit() { - if (m_SERVICE_IO_uninit == nullptr) { + if (m_SERVICE_IO_uninit == null) { return false; } return (*m_SERVICE_IO_uninit)(); } void peridic_call() { - if (m_SERVICE_IO_peridic_call == nullptr) { + if (m_SERVICE_IO_peridic_call == null) { return; } (*m_SERVICE_IO_peridic_call)(); diff --git a/tools/launcher/appl/main-launcher.cpp b/tools/launcher/appl/main-launcher.cpp index da9af82..6f4743c 100644 --- a/tools/launcher/appl/main-launcher.cpp +++ b/tools/launcher/appl/main-launcher.cpp @@ -36,11 +36,11 @@ class PlugginAccess { public: PlugginAccess(const etk::String& _name) : m_name(_name), - m_handle(nullptr), - m_SERVICE_IO_init(nullptr), - m_SERVICE_IO_uninit(nullptr), - m_SERVICE_IO_peridic_call(nullptr), - m_SERVICE_IO_instanciate(nullptr) { + m_handle(null), + m_SERVICE_IO_init(null), + m_SERVICE_IO_uninit(null), + m_SERVICE_IO_peridic_call(null), + m_SERVICE_IO_instanciate(null) { etk::String srv = etk::FSNodeGetApplicationPath() + "/../lib/libzeus-service-" + m_name + "-impl.so"; APPL_PRINT("Try to open service with name: '" << m_name << "' at position: '" << srv << "'"); m_handle = dlopen(srv.c_str(), RTLD_LAZY); @@ -48,29 +48,29 @@ class PlugginAccess { APPL_ERROR("Can not load Lbrary:" << dlerror()); return; } - char *error = nullptr; + char *error = null; m_SERVICE_IO_init = (SERVICE_IO_init_t)dlsym(m_handle, "SERVICE_IO_init"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_init = nullptr; + if (error != null) { + m_SERVICE_IO_init = null; APPL_WARNING("Can not function SERVICE_IO_init :" << error); } m_SERVICE_IO_uninit = (SERVICE_IO_uninit_t)dlsym(m_handle, "SERVICE_IO_uninit"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_uninit = nullptr; + if (error != null) { + m_SERVICE_IO_uninit = null; APPL_WARNING("Can not function SERVICE_IO_uninit :" << error); } m_SERVICE_IO_peridic_call = (SERVICE_IO_peridic_call_t)dlsym(m_handle, "SERVICE_IO_peridic_call"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_uninit = nullptr; + if (error != null) { + m_SERVICE_IO_uninit = null; APPL_WARNING("Can not function SERVICE_IO_uninit :" << error); } m_SERVICE_IO_instanciate = (SERVICE_IO_instanciate_t)dlsym(m_handle, "SERVICE_IO_instanciate"); error = dlerror(); - if (error != nullptr) { - m_SERVICE_IO_instanciate = nullptr; + if (error != null) { + m_SERVICE_IO_instanciate = null; APPL_WARNING("Can not function SERVICE_IO_instanciate:" << error); } } @@ -78,7 +78,7 @@ class PlugginAccess { } bool init(int _argc, const char *_argv[], etk::String _basePath) { - if (m_SERVICE_IO_init == nullptr) { + if (m_SERVICE_IO_init == null) { return false; } @@ -91,7 +91,7 @@ class PlugginAccess { return (*m_SERVICE_IO_init)(_argc, _argv, _basePath); } bool publish(zeus::Client& _client) { - if (m_SERVICE_IO_instanciate == nullptr) { + if (m_SERVICE_IO_instanciate == null) { return false; } _client.serviceAdd(m_name, [=](uint32_t _transactionId, ememory::SharedPtr& _iface, uint32_t _destination) { @@ -104,13 +104,13 @@ class PlugginAccess { return true; } bool uninit() { - if (m_SERVICE_IO_uninit == nullptr) { + if (m_SERVICE_IO_uninit == null) { return false; } return (*m_SERVICE_IO_uninit)(); } void peridic_call() { - if (m_SERVICE_IO_peridic_call == nullptr) { + if (m_SERVICE_IO_peridic_call == null) { return; } (*m_SERVICE_IO_peridic_call)(); diff --git a/tools/player-video/appl/MediaDecoder.cpp b/tools/player-video/appl/MediaDecoder.cpp index 96fd179..828ea3f 100644 --- a/tools/player-video/appl/MediaDecoder.cpp +++ b/tools/player-video/appl/MediaDecoder.cpp @@ -23,21 +23,21 @@ static int g_readFunc(void* _opaque, uint8_t* _buf, int _bufSize) { - if (_opaque == nullptr) { + if (_opaque == null) { return 0; } return static_cast(_opaque)->readFunc(_buf, _bufSize); } static int g_writeFunc(void* _opaque, uint8_t* _buf, int _bufSize) { - if (_opaque == nullptr) { + if (_opaque == null) { return 0; } return static_cast(_opaque)->writeFunc(_buf, _bufSize); } static int64_t g_seekFunc(void* _opaque, int64_t _offset, int _whence) { - if (_opaque == nullptr) { + if (_opaque == null) { return 0; } return static_cast(_opaque)->seekFunc(_offset, _whence); @@ -150,22 +150,22 @@ void appl::MessageElementAudio::configure(audio::format _format, uint32_t _sampl appl::MediaDecoder::MediaDecoder() : m_seekApply(-1) { init_ffmpeg(); - m_IOContext = nullptr; - m_formatContext = nullptr; - m_videoDecoderContext = nullptr; - m_audioDecoderContext = nullptr; + m_IOContext = null; + m_formatContext = null; + m_videoDecoderContext = null; + m_audioDecoderContext = null; m_size = ivec2(0,0); - m_videoStream = nullptr; - m_audioStream = nullptr; + m_videoStream = null; + m_audioStream = null; m_videoStream_idx = -1; m_audioStream_idx = -1; - m_frame = nullptr; + m_frame = null; m_videoFrameCount = 0; m_audioFrameCount = 0; m_seek = -1; // output format convertion: - m_convertContext = nullptr; + m_convertContext = null; m_audioPresent = false; m_audioFormat = audio::format_unknow; m_isInit = false; @@ -379,11 +379,11 @@ int appl::MediaDecoder::decode_packet(int *_gotFrame, int _cached) { int appl::MediaDecoder::open_codec_context(int *_streamId, AVFormatContext *_formatContext, enum AVMediaType _type) { int ret = 0; int stream_index = 0; - AVStream *st = nullptr; - AVCodecContext *dec_ctx = nullptr; - AVCodec *dec = nullptr; - AVDictionary *opts = nullptr; - ret = av_find_best_stream(_formatContext, _type, -1, -1, nullptr, 0); + AVStream *st = null; + AVCodecContext *dec_ctx = null; + AVCodec *dec = null; + AVDictionary *opts = null; + ret = av_find_best_stream(_formatContext, _type, -1, -1, null, 0); if (ret < 0) { APPL_ERROR("Could not find " << av_get_media_type_string(_type) << " stream in input file '" << m_sourceFilename << "'"); return ret; @@ -418,8 +418,8 @@ void appl::MediaDecoder::init(ememory::SharedPtr _property, uint // TODO : Correct this later ... We first download the media and after we play it // TODO : We need to download only a small part ... // get the requested node: - if (_property == nullptr) { - APPL_ERROR("Request play of not handle property ==> nullptr"); + if (_property == null) { + APPL_ERROR("Request play of not handle property ==> null"); return; } if (_property->getConnection().isAlive() == false) { @@ -728,7 +728,7 @@ void appl::StreamBuffering::checkIfWeNeedMoreDataFromNetwork() { void appl::MediaDecoder::init() { if ( m_isInit == true - || m_remote == nullptr + || m_remote == null || m_remote->sizeReadable() < 1024*1024) {// Need to wait at lease 1MB return; @@ -739,7 +739,7 @@ void appl::MediaDecoder::init() { ethread::setName("ffmpegThread"); // open input file, and allocate format context #ifdef APPL_USE_GENERIC_FFMPEG - if (avformat_open_input(&m_formatContext, m_sourceFilename.c_str(), nullptr, nullptr) < 0) { + if (avformat_open_input(&m_formatContext, m_sourceFilename.c_str(), null, null) < 0) { APPL_ERROR("Could not open source file " << m_sourceFilename); return; } @@ -750,19 +750,19 @@ void appl::MediaDecoder::init() { } uint8_t* ploooooo = (uint8_t*)av_malloc(APPL_BUFFER_SIZE_FOR_FFMPEG); m_IOContext = avio_alloc_context(ploooooo, APPL_BUFFER_SIZE_FOR_FFMPEG, 0 /* can not write */, this, g_readFunc, g_writeFunc, g_seekFunc); - if (m_IOContext == nullptr) { + if (m_IOContext == null) { APPL_ERROR("Could not create IO stream"); return; } // set IO read and write interface m_formatContext->pb = m_IOContext; - if (avformat_open_input(&m_formatContext, nullptr, nullptr, nullptr) < 0) { + if (avformat_open_input(&m_formatContext, null, null, null) < 0) { APPL_ERROR("Could not open source file " << m_sourceFilename); return; } #endif // retrieve stream information - if (avformat_find_stream_info(m_formatContext, nullptr) < 0) { + if (avformat_find_stream_info(m_formatContext, null) < 0) { APPL_ERROR("Could not find stream information"); // TODO : check this, this will create a memeory leak return; @@ -849,8 +849,8 @@ void appl::MediaDecoder::init() { // dump input information to stderr // For test only: av_dump_format(m_formatContext, 0, m_sourceFilename.c_str(), 0); - if ( m_audioStream == nullptr - && m_videoStream == nullptr) { + if ( m_audioStream == null + && m_videoStream == null) { APPL_ERROR("Could not find audio or video stream in the input, aborting"); return; // TODO : An error occured ... !!!!! } @@ -861,9 +861,9 @@ void appl::MediaDecoder::init() { return; // TODO : An error occured ... !!!!! } APPL_ERROR("ZZZZZZZ"); - // initialize packet, set data to nullptr, let the demuxer fill it + // initialize packet, set data to null, let the demuxer fill it av_init_packet(&m_packet); - m_packet.data = nullptr; + m_packet.data = null; m_packet.size = 0; m_isInit = true; } @@ -927,23 +927,23 @@ void appl::MediaDecoder::uninit() { flushMessage(); avcodec_close(m_videoDecoderContext); avcodec_close(m_audioDecoderContext); - m_formatContext->pb = nullptr; + m_formatContext->pb = null; avformat_close_input(&m_formatContext); av_frame_free(&m_frame); av_free(m_IOContext); - m_IOContext = nullptr; + m_IOContext = null; m_audioPool.clear(); m_videoPool.clear(); m_updateVideoTimeStampAfterSeek = false; - m_videoStream = nullptr; - m_audioStream = nullptr; + m_videoStream = null; + m_audioStream = null; m_sourceFilename = ""; m_videoStream_idx = 0; m_audioStream_idx = 0; m_videoFrameCount = 0; m_audioFrameCount = 0; // output format convertion: - m_convertContext = nullptr; + m_convertContext = null; m_remote.reset(); m_isInit = false; APPL_PRINT("Demuxing & Decoding succeeded... (DONE)"); @@ -951,7 +951,7 @@ void appl::MediaDecoder::uninit() { void appl::MediaDecoder::stop() { m_stopRequested = true; - if (m_remote != nullptr) { + if (m_remote != null) { m_remote->stopStream(); } gale::Thread::stop(); diff --git a/tools/player-video/appl/MediaDecoder.hpp b/tools/player-video/appl/MediaDecoder.hpp index d3a26bb..7056bde 100644 --- a/tools/player-video/appl/MediaDecoder.hpp +++ b/tools/player-video/appl/MediaDecoder.hpp @@ -187,7 +187,7 @@ namespace appl { etk::Vector> getDownloadPart() { etk::Vector> out; - if (m_remote == nullptr) { + if (m_remote == null) { return out; } etk::Vector> vals = m_remote->getDownloadPart(); diff --git a/tools/player-video/appl/Windows.cpp b/tools/player-video/appl/Windows.cpp index 13e0ccd..17e26be 100644 --- a/tools/player-video/appl/Windows.cpp +++ b/tools/player-video/appl/Windows.cpp @@ -34,7 +34,7 @@ static etk::String g_baseDBName = "USERDATA:config.json"; void appl::Windows::store_db() { APPL_DEBUG("Store database [START]"); ejson::Document database; - if (m_clientProp != nullptr) { + if (m_clientProp != null) { database.add("access", m_clientProp->toJson()); } bool retGenerate = database.storeSafe(g_baseDBName); @@ -47,15 +47,15 @@ void appl::Windows::load_db() { if (ret == false) { APPL_WARNING(" ==> LOAD error"); } - if (m_clientProp == nullptr) { + if (m_clientProp == null) { m_clientProp = ememory::makeShared(); - if (m_clientProp == nullptr) { + if (m_clientProp == null) { APPL_ERROR(" can not allocate the pointer of data ==> must auto kill"); autoDestroy(); return; } } - if (m_clientProp != nullptr) { + if (m_clientProp != null) { m_clientProp->fromJson(database["access"].toObject()); } } @@ -72,7 +72,7 @@ void appl::Windows::init() { ewol::widget::Windows::init(); load_db(); m_composer = ewol::widget::Composer::create(); - if (m_composer == nullptr) { + if (m_composer == null) { APPL_CRITICAL(" An error occured ... in the windows creatrion ..."); return; } @@ -82,7 +82,7 @@ void appl::Windows::init() { drawWidgetTree(); m_listViewer = ememory::dynamicPointerCast(m_composer->getSubObjectNamed("ws-name-list-viewer")); - if (m_listViewer != nullptr) { + if (m_listViewer != null) { m_listViewer->signalSelect.connect(sharedFromThis(), &appl::Windows::onCallbackSelectMedia); } @@ -98,21 +98,21 @@ void appl::Windows::init() { shortCutAdd("F11", "menu:full-screen"); signalShortcut.connect(sharedFromThis(), &appl::Windows::onCallbackShortCut); // TODO: try to connect the last connection availlable ... - if (m_clientProp == nullptr) { + if (m_clientProp == null) { onCallbackMenuEvent("menu:connect"); } else { m_clientProp->connect(); if (m_clientProp->getConnection().isAlive() == false) { onCallbackMenuEvent("menu:connect"); } else { - if (m_listViewer != nullptr) { + if (m_listViewer != null) { m_listViewer->setClientProperty(m_clientProp); m_listViewer->searchElements(); } } } m_player = ememory::dynamicPointerCast(m_composer->getSubObjectNamed("ws-name-player")); - if (m_player != nullptr) { + if (m_player != null) { m_player->signalPrevious.connect(sharedFromThis(), &appl::Windows::onCallbackPlayerPrevious); m_player->signalNext.connect(sharedFromThis(), &appl::Windows::onCallbackPlayerNext); m_player->signalFinished.connect(sharedFromThis(), &appl::Windows::onCallbackPlayerFinished); @@ -127,12 +127,12 @@ void appl::Windows::onCallbackShortCut(const etk::String& _value) { void appl::Windows::onCallbackMenuEvent(const etk::String& _value) { APPL_WARNING("Event from Menu : " << _value); - if (m_player != nullptr) { + if (m_player != null) { m_player->stop(); } if (_value == "menu:connect") { appl::widget::ConnectionShared tmpWidget = appl::widget::Connection::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not open File chooser !!! "); return; } @@ -204,20 +204,20 @@ void appl::Windows::onCallbackMenuEvent(const etk::String& _value) { void appl::Windows::onCallbackConnectionValidate(const ememory::SharedPtr& _prop) { m_clientProp = _prop; - if (m_clientProp == nullptr) { + if (m_clientProp == null) { // TODO: set back in public mode ... return; } store_db(); // Update viewer to show all ... - if (m_listViewer != nullptr) { + if (m_listViewer != null) { m_listViewer->setClientProperty(m_clientProp); m_listViewer->searchElements(); } } void appl::Windows::onCallbackConnectionError(const ememory::SharedPtr& _prop) { m_clientProp = _prop; - if (m_clientProp == nullptr) { + if (m_clientProp == null) { // TODO: set back in public mode ... return; } @@ -235,7 +235,7 @@ void appl::Windows::onCallbackPrevious() { m_id = m_list.size()-1; } ememory::SharedPtr tmpDisp = ememory::dynamicPointerCast(getSubObjectNamed("displayer")); - if (tmpDisp != nullptr) { + if (tmpDisp != null) { // stop previous (if needed) tmpDisp->stop(); // Set new file: @@ -261,7 +261,7 @@ void appl::Windows::onCallbackNext() { m_id = 0; } ememory::SharedPtr tmpDisp = ememory::dynamicPointerCast(getSubObjectNamed("displayer")); - if (tmpDisp != nullptr) { + if (tmpDisp != null) { // stop previous (if needed) tmpDisp->stop(); // Set new file: @@ -282,7 +282,7 @@ void appl::Windows::addFile(const etk::String& _file) { if (m_list.size() == 1) { m_id = 0; ememory::SharedPtr tmpDisp = ememory::dynamicPointerCast(getSubObjectNamed("displayer")); - if (tmpDisp != nullptr) { + if (tmpDisp != null) { tmpDisp->setFile(m_list[m_id]); echrono::Duration time = tmpDisp->getDuration(); APPL_DEBUG("duration = " << time << " " << etk::toString(time.toSeconds())); @@ -294,16 +294,16 @@ void appl::Windows::addFile(const etk::String& _file) { void appl::Windows::onCallbackSelectMedia(const uint32_t& _value) { ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-player"); - if (m_player != nullptr) { + if (m_player != null) { m_player->playStream(m_clientProp, _value); } } void appl::Windows::onCallbackPlayerPrevious() { - if (m_player != nullptr) { + if (m_player != null) { m_player->stop(); } - if (m_listViewer != nullptr) { + if (m_listViewer != null) { if (m_listViewer->previous() == false) { ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer"); } @@ -311,10 +311,10 @@ void appl::Windows::onCallbackPlayerPrevious() { } void appl::Windows::onCallbackPlayerNext() { - if (m_player != nullptr) { + if (m_player != null) { m_player->stop(); } - if (m_listViewer != nullptr) { + if (m_listViewer != null) { if (m_listViewer->next() == false) { ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer"); } @@ -322,7 +322,7 @@ void appl::Windows::onCallbackPlayerNext() { } void appl::Windows::onCallbackPlayerFinished() { - if (m_player != nullptr) { + if (m_player != null) { m_player->stop(); } ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer"); diff --git a/tools/player-video/appl/widget/Connection.cpp b/tools/player-video/appl/widget/Connection.cpp index 903cfcd..a1160a0 100644 --- a/tools/player-video/appl/widget/Connection.cpp +++ b/tools/player-video/appl/widget/Connection.cpp @@ -37,16 +37,16 @@ void appl::widget::Connection::init() { subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]connect-password", signalModify, sharedFromThis(), &appl::widget::Connection::onCallbackEntryPasswordChangeValue); subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]connect-bt", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackButtonValidate); subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]cancel-bt", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackButtonCancel); - setProperty(nullptr); + setProperty(null); propertyCanFocus.set(true); } void appl::widget::Connection::setProperty(ememory::SharedPtr _baseProperty) { m_baseProperty = _baseProperty; - if (m_baseProperty == nullptr) { + if (m_baseProperty == null) { m_baseProperty = ememory::makeShared(); - if (m_baseProperty == nullptr) { + if (m_baseProperty == null) { APPL_ERROR(" can not allocate the pointer of data ==> must auto kill"); autoDestroy(); return; diff --git a/tools/player-video/appl/widget/Connection.hpp b/tools/player-video/appl/widget/Connection.hpp index a42fc3e..c1fd59d 100644 --- a/tools/player-video/appl/widget/Connection.hpp +++ b/tools/player-video/appl/widget/Connection.hpp @@ -29,7 +29,7 @@ namespace appl { * The first step is to create the file chooser pop-up : (never in the constructor!!!) * [code style=c++] * appl::widget::ConnectionShared tmpWidget = appl::widget::Connection::create(); - * if (tmpWidget == nullptr) { + * if (tmpWidget == null) { * APPL_ERROR("Can not open File chooser !!! "); * return -1; * } @@ -39,7 +39,7 @@ namespace appl { * tmpWidget->signalCancel.connect(sharedFromThis(), &****::onCallbackConnectionCancel); * // add the widget as windows pop-up ... * ewol::widget::WindowsShared tmpWindows = getWindows(); - * if (tmpWindows == nullptr) { + * if (tmpWindows == null) { * APPL_ERROR("Can not get the current windows !!! "); * return -1; * } @@ -72,7 +72,7 @@ namespace appl { public: DECLARE_WIDGET_FACTORY(Connection, "Connection"); virtual ~Connection(); - void setProperty(ememory::SharedPtr _baseProperty=nullptr); + void setProperty(ememory::SharedPtr _baseProperty=null); private: etk::String getCompleateFileName(); void updateCurrentFolder(); diff --git a/tools/player-video/appl/widget/ListViewer.cpp b/tools/player-video/appl/widget/ListViewer.cpp index dbe312c..f7e6730 100644 --- a/tools/player-video/appl/widget/ListViewer.cpp +++ b/tools/player-video/appl/widget/ListViewer.cpp @@ -475,7 +475,7 @@ void appl::widget::ListViewer::searchElementsInternal(const etk::String& _filter m_listElementGroup.clear(); m_listDisplay.clear(); resetScrollOrigin(); - if (m_clientProp == nullptr) { + if (m_clientProp == null) { APPL_ERROR("No client Availlable ..."); return; } @@ -518,7 +518,7 @@ void appl::widget::ListViewer::searchElementsInternal(const etk::String& _filter } for (auto &it : returnValues) { auto elem = ememory::makeShared(remoteServiceVideo, ememory::staticPointerCast(sharedFromThis())); - if (elem == nullptr) { + if (elem == null) { APPL_ERROR("Can not allocate element... " << it); continue; } @@ -542,7 +542,7 @@ void appl::widget::ListViewer::searchElementsInternal(const etk::String& _filter APPL_INFO("Get some Values: " << returnValues << ""); for (auto &it : returnValues) { auto elem = ememory::makeShared(remoteServiceVideo, ememory::staticPointerCast(sharedFromThis())); - if (elem == nullptr) { + if (elem == null) { APPL_ERROR("Can not allocate element... " << it); continue; } @@ -557,7 +557,7 @@ void appl::widget::ListViewer::searchElementsInternal(const etk::String& _filter void appl::widget::ListViewer::onDraw() { m_text.draw(); for (auto &it : m_listDisplay) { - if (it == nullptr) { + if (it == null) { continue; } it->draw(); @@ -650,11 +650,11 @@ void appl::widget::ListViewer::onRegenerateDisplay() { APPL_VERBOSE("origin scrolled : " << m_originScrooled << " nb Pixel/element = " << realPixelSize.y() << " offset=" << offset); for (size_t iii=0; iiim_idCurentElement = offset + iii; if (offset + iii < m_listElement.size()) { elem->m_property = m_listElement[offset + iii]; - if (elem->m_property != nullptr) { + if (elem->m_property != null) { elem->m_property->loadData(); } } else { @@ -662,7 +662,7 @@ void appl::widget::ListViewer::onRegenerateDisplay() { } if (offset + iii < m_listElementGroup.size()) { elem->m_propertyGroup = m_listElementGroup[offset + iii]; - if (elem->m_propertyGroup != nullptr) { + if (elem->m_propertyGroup != null) { elem->m_propertyGroup->loadData(); } } else { @@ -693,7 +693,7 @@ void appl::widget::ListViewer::onRegenerateDisplay() { break; } } else { - APPL_ERROR("create nullptr"); + APPL_ERROR("create null"); } } @@ -703,7 +703,7 @@ void appl::widget::ListViewer::onRegenerateDisplay() { vec2 elementSize = vec2(m_size.x(), int32_t(realPixelSize.y())); vec2 startPos = vec2(-m_originScrooled.x(), m_size.y()) - vec2(0, elementSize.y()-(m_originScrooled.y()-realOffset)); for (auto &it : m_listDisplay) { - if (it == nullptr) { + if (it == null) { startPos -= vec2(0, elementSize.y()); continue; } @@ -735,8 +735,8 @@ void appl::ElementDisplayed::generateDisplay(vec2 _startPos, vec2 _size) { m_image.clear(); m_text.clear(); m_draw.clear(); - if ( m_property == nullptr - && m_propertyGroup == nullptr) { + if ( m_property == null + && m_propertyGroup == null) { return; } //APPL_INFO("Regenrate size : " << _startPos << " " << _size); @@ -771,7 +771,7 @@ void appl::ElementDisplayed::generateDisplay(vec2 _startPos, vec2 _size) { m_text.setTextAlignement(originText.x(), originText.x()+_size.x()-_size.y(), ewol::compositing::alignDisable); // TODO: m_text.setClipping(originText, vec2(originText.x()+_size.x()-_size.y(), _size.y())); etk::String textToDisplay; - if (m_property != nullptr) { + if (m_property != null) { if (m_property->LoadDataEnded() == false) { textToDisplay += "
Loading in progress ... " + etk::toString(m_property->m_nbElementLoaded) + "/8"; } else { @@ -815,7 +815,7 @@ void appl::ElementDisplayed::generateDisplay(vec2 _startPos, vec2 _size) { // -------------------------------------------- // -- Display Image... // -------------------------------------------- - if (m_property != nullptr) { + if (m_property != null) { bool haveThumb = false; if (m_property->LoadDataEnded() == false) { haveThumb = false; @@ -873,7 +873,7 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) { vec2 relativePos = relativePosition(_event.getPos()); int32_t findId = -1; for (size_t iii=0; iiim_pos.x() @@ -891,9 +891,9 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) { if (_event.getId() == 1) { if(_event.getStatus() == gale::key::status::pressSingle) { APPL_DEBUG("Select element : " << findId << " " << m_listDisplay[findId]->m_idCurentElement); - if (m_listDisplay[findId]->m_property != nullptr) { + if (m_listDisplay[findId]->m_property != null) { ememory::SharedPtr prop = m_listDisplay[findId]->m_property; - if (prop == nullptr) { + if (prop == null) { return true; } etk::String fullTitle; @@ -910,9 +910,9 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) { APPL_DEBUG("info element : " << prop->m_id << " title: " << fullTitle); m_currentPayed = prop->m_id; signalSelect.emit(prop->m_id); - } else if (m_listDisplay[findId]->m_propertyGroup != nullptr) { + } else if (m_listDisplay[findId]->m_propertyGroup != null) { ememory::SharedPtr prop = m_listDisplay[findId]->m_propertyGroup; - if (prop == nullptr) { + if (prop == null) { return true; } etk::String newGroup = ""; @@ -945,14 +945,14 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) { bool appl::widget::ListViewer::previous() { for (int64_t iii=0; iiim_id == m_currentPayed) { // Start search ... --iii; while(iii>=0) { - if (m_listElement[iii] == nullptr) { + if (m_listElement[iii] == null) { --iii; continue; } @@ -968,14 +968,14 @@ bool appl::widget::ListViewer::previous() { bool appl::widget::ListViewer::next() { for (size_t iii=0; iiim_id == m_currentPayed) { // Start search ... ++iii; while(iii _property, uint32_t _mediaId) { - if (m_display == nullptr) { + if (m_display == null) { return; } // stop previous (if needed) @@ -112,7 +112,7 @@ static etk::String timeToStaticString(const echrono::Duration& _time) { } void appl::widget::Player::onCallbackFinished() { - if (m_progress != nullptr) { + if (m_progress != null) { etk::Vector> tmp; m_progress->setRangeAvaillable(tmp); m_progress->propertyValue.set(0); @@ -126,7 +126,7 @@ void appl::widget::Player::onCallbackFinished() { void appl::widget::Player::onCallbackDuration(const echrono::Duration& _time) { //APPL_ERROR("duration = " << _time); - if (m_progress != nullptr) { + if (m_progress != null) { m_progress->propertyValue.set(0); m_progress->propertyMaximum.set(_time.toSeconds()); } @@ -136,12 +136,12 @@ void appl::widget::Player::onCallbackDuration(const echrono::Duration& _time) { void appl::widget::Player::onCallbackPosition(const echrono::Duration& _time) { //APPL_ERROR("time = " << _time); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-player-label-time", "value", "" + timeToStaticString(_time) + ""); - if (m_progress != nullptr) { + if (m_progress != null) { m_progress->propertyValue.set(_time.toSeconds()); } - if (m_display != nullptr) { + if (m_display != null) { etk::Vector> tmp = m_display->getDownloadPart(); - if (m_progress != nullptr) { + if (m_progress != null) { m_progress->setRangeAvaillable(tmp); } } @@ -151,7 +151,7 @@ void appl::widget::Player::onCallbackSeekRequest(const float& _value) { APPL_DEBUG("==========================================================================="); APPL_DEBUG("seek at = " << echrono::Duration(_value) << " from value=" << _value); APPL_DEBUG("==========================================================================="); - if (m_display != nullptr) { + if (m_display != null) { m_display->seek(echrono::Duration(_value)); } } @@ -160,7 +160,7 @@ void appl::widget::Player::onCallbackVolumeRequest(const float& _value) { APPL_DEBUG("==========================================================================="); APPL_DEBUG("volume change value=" << _value << " dB"); APPL_DEBUG("==========================================================================="); - if (m_display != nullptr) { + if (m_display != null) { m_display->changeVolume(_value); } } @@ -169,7 +169,7 @@ void appl::widget::Player::onCallbackLightRequest(const float& _value) { APPL_DEBUG("==========================================================================="); APPL_DEBUG("volume change value=" << _value << " %"); APPL_DEBUG("==========================================================================="); - if (m_display != nullptr) { + if (m_display != null) { m_display->changeLight(_value); } } @@ -188,7 +188,7 @@ void appl::widget::Player::onCallbackFPS(const int32_t& _fps) { void appl::widget::Player::stop() { propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-player-bt-play", "value", "false"); - if (m_display == nullptr) { + if (m_display == null) { return; } m_display->stop(); @@ -196,7 +196,7 @@ void appl::widget::Player::stop() { void appl::widget::Player::suspend() { propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-player-bt-play", "value", "false"); - if (m_display == nullptr) { + if (m_display == null) { return; } m_display->pause(); @@ -208,7 +208,7 @@ void appl::widget::Player::onCallbackButtonPrevious() { } void appl::widget::Player::onCallbackButtonPlay(const bool& _value) { - if (m_display == nullptr) { + if (m_display == null) { return; } if (_value == true) { diff --git a/tools/player-video/appl/widget/VideoPlayer.cpp b/tools/player-video/appl/widget/VideoPlayer.cpp index 9f8da1d..13f25b9 100644 --- a/tools/player-video/appl/widget/VideoPlayer.cpp +++ b/tools/player-video/appl/widget/VideoPlayer.cpp @@ -35,7 +35,7 @@ void appl::widget::VideoDisplay::init() { getObjectManager().periodicCall.connect(sharedFromThis(), &appl::widget::VideoDisplay::periodicEvent); // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); - if (m_VBO == nullptr) { + if (m_VBO == null) { APPL_ERROR("can not instanciate VBO ..."); return; } @@ -46,9 +46,9 @@ void appl::widget::VideoDisplay::init() { m_useElement = 0; for (int32_t iii=0; iiigetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); @@ -88,7 +88,7 @@ void appl::widget::VideoDisplay::setFile(const etk::String& _filename) { m_decoder.reset(); // Create a new interface m_decoder = ememory::makeShared(); - if (m_decoder == nullptr) { + if (m_decoder == null) { APPL_ERROR("Can not create sharedPtr on decoder ..."); return; } @@ -100,17 +100,17 @@ void appl::widget::VideoDisplay::setFile(const etk::String& _filename) { void appl::widget::VideoDisplay::setZeusMedia(ememory::SharedPtr _property, uint32_t _mediaId) { // Stop playing in all case... stop(); - if (m_decoder != nullptr) { + if (m_decoder != null) { m_decoder->uninit(); } // Clear the old interface m_decoder.reset(); // Create a new interface - if (m_decoder == nullptr) { + if (m_decoder == null) { m_decoder = ememory::makeShared(); } - if (m_decoder == nullptr) { + if (m_decoder == null) { APPL_ERROR("Can not create sharedPtr on decoder ..."); return; } @@ -124,7 +124,7 @@ bool appl::widget::VideoDisplay::isPlaying() { } void appl::widget::VideoDisplay::play() { - if (m_decoder == nullptr) { + if (m_decoder == null) { APPL_WARNING("Request play with no associated decoder"); return; } @@ -140,7 +140,7 @@ void appl::widget::VideoDisplay::play() { } void appl::widget::VideoDisplay::changeVolume(const float& _value) { - if (m_audioManager != nullptr) { + if (m_audioManager != null) { m_audioManager->setVolume("MASTER", _value); } } @@ -158,13 +158,13 @@ void appl::widget::VideoDisplay::pause() { void appl::widget::VideoDisplay::stop() { m_isPalying = false; - if ( m_decoder != nullptr + if ( m_decoder != null && m_decoder->getState() != gale::Thread::state::stop) { APPL_ERROR("Stop Decoder"); m_decoder->stop(); m_currentTime = 0; } - if (m_audioInterface != nullptr) { + if (m_audioInterface != null) { APPL_ERROR("Stop audio interface"); // Stop audio interface m_audioInterface->stop(); @@ -181,13 +181,13 @@ void appl::widget::VideoDisplay::onDraw() { return; } /* - if ( m_resource[iii] == nullptr - || m_resource2 == nullptr) { + if ( m_resource[iii] == null + || m_resource2 == null) { // this is a normale case ... the user can choice to have no image ... return; } */ - if (m_GLprogram == nullptr) { + if (m_GLprogram == null) { APPL_ERROR("No shader ..."); return; } @@ -197,7 +197,7 @@ void appl::widget::VideoDisplay::onDraw() { m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix); // TextureID - if (m_resource[m_useElement] != nullptr) { + if (m_resource[m_useElement] != null) { m_GLprogram->setTexture0(m_GLtexID, m_resource[m_useElement]->getRendererId()); } // position: @@ -266,7 +266,7 @@ void appl::widget::VideoDisplay::onRegenerateDisplay() { // set the somposition properties : m_position = vec3(0,0,0); - if (m_decoder != nullptr) { + if (m_decoder != null) { ivec2 tmp = m_decoder->getSize(); vec2 realSize(tmp.x(), tmp.y()); vec2 displaySize = m_size; @@ -299,7 +299,7 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) APPL_VERBOSE("tick: " << _event); m_currentTime += _event.getDeltaCallDuration(); } - if (m_decoder == nullptr) { + if (m_decoder == null) { return; } if (m_decoder->m_seekApply > echrono::Duration(-1)) { @@ -308,7 +308,7 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) APPL_ERROR("Apply seek position : " << m_currentTime); APPL_ERROR("=========================================================="); m_decoder->m_seekApply = echrono::Duration(-1); - if (m_audioInterface != nullptr) { + if (m_audioInterface != null) { m_audioInterface->clearInternalBuffer(); } } @@ -320,7 +320,7 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) if ( idSlot != -1 && m_currentTime > m_decoder->m_audioPool[idSlot].m_time) { APPL_VERBOSE("Get Slot AUDIO " << m_currentTime << " > " << m_decoder->m_audioPool[idSlot].m_time); - if (m_audioInterface == nullptr) { + if (m_audioInterface == null) { // start audio interface the first time we need it APPL_ERROR("=========================================================="); APPL_ERROR("== Presence of Audio: " << m_decoder->haveAudio() << " =="); @@ -330,14 +330,14 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) m_decoder->audioGetChannelMap(), m_decoder->audioGetFormat(), "speaker"); - if(m_audioInterface == nullptr) { + if(m_audioInterface == null) { APPL_ERROR("Can not create Audio interface"); } m_audioInterface->setReadwrite(); m_audioInterface->start(); } } - if (m_audioInterface != nullptr) { + if (m_audioInterface != null) { int32_t nbSample = m_decoder->m_audioPool[idSlot].m_buffer.size() / audio::getFormatBytes(m_decoder->m_audioPool[idSlot].m_format) / m_decoder->m_audioPool[idSlot].m_map.size(); @@ -411,7 +411,7 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) void appl::widget::VideoDisplay::seek(const echrono::Duration& _time) { APPL_PRINT("seek request = " << _time); - if (m_decoder == nullptr) { + if (m_decoder == null) { return; } m_decoder->seek(_time); diff --git a/tools/player-video/appl/widget/VideoPlayer.hpp b/tools/player-video/appl/widget/VideoPlayer.hpp index 3b4089d..e06aad0 100644 --- a/tools/player-video/appl/widget/VideoPlayer.hpp +++ b/tools/player-video/appl/widget/VideoPlayer.hpp @@ -88,14 +88,14 @@ namespace appl { ememory::SharedPtr m_audioInterface; //!< Play audio interface public: echrono::Duration getDuration() { - if (m_decoder != nullptr) { + if (m_decoder != null) { return m_decoder->getDuration(); } return echrono::Duration(0); } void seek(const echrono::Duration& _time); etk::Vector> getDownloadPart() { - if (m_decoder == nullptr) { + if (m_decoder == null) { return etk::Vector>(); } return m_decoder->getDownloadPart(); diff --git a/tools/router/appl/ClientInterface.cpp b/tools/router/appl/ClientInterface.cpp index 9430a7f..9820b68 100644 --- a/tools/router/appl/ClientInterface.cpp +++ b/tools/router/appl/ClientInterface.cpp @@ -34,8 +34,8 @@ appl::ClientInterface::~ClientInterface() { etk::String appl::ClientInterface::requestURI(const etk::String& _uri, const etk::Map& _options) { APPL_INFO("request connect on CLIENT: '" << _uri << "' from " << m_interfaceClient.getRemoteAddress()); - if(m_routerInterface == nullptr) { - APPL_ERROR("Can not access to the main GateWay interface (nullptr)"); + if(m_routerInterface == null) { + APPL_ERROR("Can not access to the main GateWay interface (null)"); return "CLOSE"; } etk::String tmpURI = _uri; @@ -48,7 +48,7 @@ etk::String appl::ClientInterface::requestURI(const etk::String& _uri, const etk } m_userGateWay = m_routerInterface->get(tmpURI); APPL_INFO("Connect on client done : '" << tmpURI << "'"); - if (m_userGateWay == nullptr) { + if (m_userGateWay == null) { APPL_ERROR("Can not connect on Client ==> it does not exist ..."); return "CLOSE"; } @@ -59,7 +59,7 @@ etk::String appl::ClientInterface::requestURI(const etk::String& _uri, const etk APPL_WARNING("Request redirect of the connection, because it is possible"); // remove reference on the client befor it was inform of our connection m_userGateWay->rmClient(sharedFromThis()); - m_userGateWay = nullptr; + m_userGateWay = null; m_interfaceRedirect = true; return etk::String("REDIRECT:") + m_routerInterface->propertyClientIp.get() + ":" + etk::toString(externalPort); } @@ -78,7 +78,7 @@ void appl::ClientInterface::stop() { if (m_interfaceClient.isActive() == true) { m_interfaceClient.disconnect(); } - if (m_userGateWay != nullptr) { + if (m_userGateWay != null) { m_userGateWay->rmClient(sharedFromThis()); } } @@ -93,7 +93,7 @@ bool appl::ClientInterface::isAlive() { //APPL_INFO("is alive : " << m_interfaceClient.isActive()); bool ret = m_interfaceClient.isActive(); if (ret == true) { - if (m_userGateWay == nullptr) { + if (m_userGateWay == null) { return false; } m_userGateWay->clientAlivePing(); @@ -111,7 +111,7 @@ void appl::ClientInterface::answerProtocolError(uint32_t _transactionId, const e void appl::ClientInterface::onClientData(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } // check transaction ID != 0 @@ -127,7 +127,7 @@ void appl::ClientInterface::onClientData(ememory::SharedPtr _valu return; } // Check gateway corectly connected - if (m_userGateWay == nullptr) { + if (m_userGateWay == null) { answerProtocolError(transactionId, "GateWay error (not connected)"); return; } @@ -159,7 +159,7 @@ void appl::ClientInterface::onClientData(ememory::SharedPtr _valu } void appl::ClientInterface::send(ememory::SharedPtr _data) { - if (_data == nullptr) { + if (_data == null) { return; } m_interfaceClient.writeBinary(_data); diff --git a/tools/router/appl/GateWayInterface.cpp b/tools/router/appl/GateWayInterface.cpp index 319f4c8..b9b6e04 100644 --- a/tools/router/appl/GateWayInterface.cpp +++ b/tools/router/appl/GateWayInterface.cpp @@ -40,8 +40,8 @@ etk::String appl::GateWayInterface::requestURI(const etk::String& _uri, const et for (auto &it: _options) { ZEUS_INFO(" '" << it.first << "' = '" << it.second << "'"); } - if(m_routerInterface == nullptr) { - ZEUS_ERROR("Can not access to the main GateWay interface (nullptr)"); + if(m_routerInterface == null) { + ZEUS_ERROR("Can not access to the main GateWay interface (null)"); return "CLOSE"; } etk::String tmpURI = _uri; @@ -85,7 +85,7 @@ void appl::GateWayInterface::send(ememory::SharedPtr _data) { } uint16_t appl::GateWayInterface::addClient(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return -1; } APPL_WARNING("Add client on GateWay " << _value->getId()); @@ -94,7 +94,7 @@ uint16_t appl::GateWayInterface::addClient(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } uint16_t id = _value->getId(); @@ -102,7 +102,7 @@ void appl::GateWayInterface::rmClient(ememory::SharedPtr bool find = false; auto it = m_clientConnected.begin(); while (it != m_clientConnected.end()) { - if (*it == nullptr) { + if (*it == null) { it = m_clientConnected.erase(it); } else if (*it == _value) { it = m_clientConnected.erase(it); @@ -118,7 +118,7 @@ void appl::GateWayInterface::rmClient(ememory::SharedPtr } void appl::GateWayInterface::onServiceData(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } if (m_name == "") { diff --git a/tools/router/appl/Router.cpp b/tools/router/appl/Router.cpp index d51fc7b..82de7ea 100644 --- a/tools/router/appl/Router.cpp +++ b/tools/router/appl/Router.cpp @@ -75,7 +75,7 @@ namespace appl { bool m_service; public: TcpServerInput(appl::Router* _router, bool _service) : - m_thread(nullptr), + m_thread(null), m_threadRunning(false), m_router(_router), m_service(_service) { @@ -88,21 +88,21 @@ namespace appl { m_interface.link(); m_threadRunning = true; m_thread = ETK_NEW(ethread::Thread, [&](){ threadCallback();}, "routerListener"); - if (m_thread == nullptr) { + if (m_thread == null) { m_threadRunning = false; ZEUS_ERROR("creating callback thread!"); return; } } void stop() { - if (m_thread != nullptr) { + if (m_thread != null) { m_threadRunning = false; } m_interface.unlink(); - if (m_thread != nullptr) { + if (m_thread != null) { m_thread->join(); ETK_DELETE(ethread::Thread, m_thread); - m_thread = nullptr; + m_thread = null; } } void threadCallback() { @@ -168,7 +168,7 @@ void appl::Router::stop() { bool appl::Router::userIsConnected(const etk::String& _userName) { for (auto &it : m_GateWayList) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _userName) { @@ -187,7 +187,7 @@ extern "C" { ememory::SharedPtr appl::Router::get(const etk::String& _userName) { // TODO : Start USer only when needed, not get it all time started... for (auto &it : m_GateWayList) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _userName) { @@ -210,9 +210,9 @@ ememory::SharedPtr appl::Router::get(const etk::String& cmd += "&"; APPL_ERROR("Start " << cmd); it.m_subProcess = popen(cmd.c_str(), "r"); - if (it.m_subProcess == nullptr) { + if (it.m_subProcess == null) { perror("popen"); - return nullptr; + return null; } // just trash IO ... //pclose(it.m_subProcess); @@ -266,7 +266,7 @@ ememory::SharedPtr appl::Router::get(const etk::String& while (nbCheckDelayMax-- > 0) { ethread::sleepMilliSeconds((25)); for (auto &it : m_GateWayList) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _userName) { @@ -279,7 +279,7 @@ ememory::SharedPtr appl::Router::get(const etk::String& break; } } - return nullptr; + return null; } @@ -287,7 +287,7 @@ etk::Vector appl::Router::getAllUserName() { etk::Vector out; /* for (auto &it : m_GateWayList) { - if (it == nullptr) { + if (it == null) { continue; } out.pushBack(it->getName()); @@ -302,7 +302,7 @@ void appl::Router::cleanIO() { store_db(); auto it = m_GateWayList.begin(); while (it != m_GateWayList.end()) { - if (*it != nullptr) { + if (*it != null) { if ((*it)->isAlive() == false) { it = m_GateWayList.erase(it); continue; @@ -315,7 +315,7 @@ void appl::Router::cleanIO() { } auto it2 = m_clientList.begin(); while (it2 != m_clientList.end()) { - if (*it2 != nullptr) { + if (*it2 != null) { if ((*it2)->isAlive() == false) { (*it2)->stop(); APPL_ERROR("count = " << (*it2).useCount() << " list.size()=" << m_clientList.size()); diff --git a/tools/server-remote/appl/Windows.cpp b/tools/server-remote/appl/Windows.cpp index 1ebc684..185b4d2 100644 --- a/tools/server-remote/appl/Windows.cpp +++ b/tools/server-remote/appl/Windows.cpp @@ -33,7 +33,7 @@ static etk::String g_baseDBName = "USERDATA:config.json"; void appl::Windows::store_db() { APPL_DEBUG("Store database [START]"); ejson::Document database; - if (m_clientProp != nullptr) { + if (m_clientProp != null) { database.add("access", m_clientProp->toJson()); } bool retGenerate = database.storeSafe(g_baseDBName); @@ -46,15 +46,15 @@ void appl::Windows::load_db() { if (ret == false) { APPL_WARNING(" ==> LOAD error"); } - if (m_clientProp == nullptr) { + if (m_clientProp == null) { m_clientProp = ememory::makeShared(); - if (m_clientProp == nullptr) { + if (m_clientProp == null) { APPL_ERROR(" can not allocate the pointer of data ==> must auto kill"); autoDestroy(); return; } } - if (m_clientProp != nullptr) { + if (m_clientProp != null) { m_clientProp->fromJson(database["access"].toObject()); } } @@ -69,7 +69,7 @@ void appl::Windows::init() { ewol::widget::Windows::init(); load_db(); m_composer = ewol::widget::Composer::create(); - if (m_composer == nullptr) { + if (m_composer == null) { APPL_CRITICAL(" An error occured ... in the windows creatrion ..."); return; } @@ -87,7 +87,7 @@ void appl::Windows::init() { shortCutAdd("F11", "menu:connect"); signalShortcut.connect(sharedFromThis(), &appl::Windows::onCallbackShortCut); // TODO: try to connect the last connection availlable ... - if (m_clientProp == nullptr) { + if (m_clientProp == null) { onCallbackMenuEvent("menu:connect"); } else { m_clientProp->connect(); @@ -107,7 +107,7 @@ void appl::Windows::onCallbackMenuEvent(const etk::String& _value) { APPL_WARNING("Event from Menu : " << _value); if (_value == "menu:connect") { appl::widget::ConnectionShared tmpWidget = appl::widget::Connection::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not open File chooser !!! "); return; } @@ -130,7 +130,7 @@ void appl::Windows::onCallbackMenuEvent(const etk::String& _value) { void appl::Windows::onCallbackConnectionValidate(const ememory::SharedPtr& _prop) { m_clientProp = _prop; - if (m_clientProp == nullptr) { + if (m_clientProp == null) { // TODO: set back in public mode ... return; } @@ -143,7 +143,7 @@ void appl::Windows::onCallbackConnectionCancel() { } void appl::Windows::onCallbackReboot() { - if (m_clientProp == nullptr) { + if (m_clientProp == null) { onCallbackMenuEvent("menu:connect"); return; } @@ -173,7 +173,7 @@ void appl::Windows::onCallbackReboot() { } void appl::Windows::onCallbackShutdown() { - if (m_clientProp == nullptr) { + if (m_clientProp == null) { onCallbackMenuEvent("menu:connect"); return; } diff --git a/tools/server-remote/appl/widget/Connection.cpp b/tools/server-remote/appl/widget/Connection.cpp index 79cf85c..f83eefb 100644 --- a/tools/server-remote/appl/widget/Connection.cpp +++ b/tools/server-remote/appl/widget/Connection.cpp @@ -37,16 +37,16 @@ void appl::widget::Connection::init() { subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]connect-password", signalModify, sharedFromThis(), &appl::widget::Connection::onCallbackEntryPasswordChangeValue); subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]connect-bt", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackButtonValidate); subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]cancel-bt", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackButtonCancel); - setProperty(nullptr); + setProperty(null); propertyCanFocus.set(true); } void appl::widget::Connection::setProperty(ememory::SharedPtr _baseProperty) { m_baseProperty = _baseProperty; - if (m_baseProperty == nullptr) { + if (m_baseProperty == null) { m_baseProperty = ememory::makeShared(); - if (m_baseProperty == nullptr) { + if (m_baseProperty == null) { APPL_ERROR(" can not allocate the pointer of data ==> must auto kill"); autoDestroy(); return; diff --git a/tools/server-remote/appl/widget/Connection.hpp b/tools/server-remote/appl/widget/Connection.hpp index 408fa9e..df4298a 100644 --- a/tools/server-remote/appl/widget/Connection.hpp +++ b/tools/server-remote/appl/widget/Connection.hpp @@ -29,7 +29,7 @@ namespace appl { * The first step is to create the file chooser pop-up : (never in the constructor!!!) * [code style=c++] * appl::widget::ConnectionShared tmpWidget = appl::widget::Connection::create(); - * if (tmpWidget == nullptr) { + * if (tmpWidget == null) { * APPL_ERROR("Can not open File chooser !!! "); * return -1; * } @@ -39,7 +39,7 @@ namespace appl { * tmpWidget->signalCancel.connect(sharedFromThis(), &****::onCallbackConnectionCancel); * // add the widget as windows pop-up ... * ewol::widget::WindowsShared tmpWindows = getWindows(); - * if (tmpWindows == nullptr) { + * if (tmpWindows == null) { * APPL_ERROR("Can not get the current windows !!! "); * return -1; * } @@ -71,7 +71,7 @@ namespace appl { public: DECLARE_WIDGET_FACTORY(Connection, "Connection"); virtual ~Connection(); - void setProperty(ememory::SharedPtr _baseProperty=nullptr); + void setProperty(ememory::SharedPtr _baseProperty=null); private: etk::String getCompleateFileName(); void updateCurrentFolder(); diff --git a/tools/service-user/appl/main-service-user.cpp b/tools/service-user/appl/main-service-user.cpp index 87a6db8..894f20a 100644 --- a/tools/service-user/appl/main-service-user.cpp +++ b/tools/service-user/appl/main-service-user.cpp @@ -47,7 +47,7 @@ namespace appl { APPL_WARNING("call clientGroupsGet : " << _clientName); etk::Vector out; /* - if (m_client == nullptr) { + if (m_client == null) { return out; } */ diff --git a/tools/service-video/appl/main-service-video.cpp b/tools/service-video/appl/main-service-video.cpp index f90dc0e..b354348 100644 --- a/tools/service-video/appl/main-service-video.cpp +++ b/tools/service-video/appl/main-service-video.cpp @@ -96,7 +96,7 @@ static etk::Vector splitAction(const etk::String& _in) { static void metadataChange(zeus::MediaImpl* _element, const etk::String& _key) { g_needToStore = true; // meta_data have chage ==> we need to upfdate the path of the file where the data is stored ... - if (_element == nullptr) { + if (_element == null) { return; } _element->forceUpdateDecoratedName(); @@ -140,7 +140,7 @@ namespace appl { // TODO : Check right ... etk::Vector out; for (size_t iii=_start; iiigetUniqueId()); @@ -152,7 +152,7 @@ namespace appl { // TODO : Check right ... uint32_t out; for (size_t iii=0; iiigetSha512() == _sha512) { @@ -168,7 +168,7 @@ namespace appl { // TODO : Check right ... ememory::SharedPtr property; for (auto &it : m_listFile) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getUniqueId() == _mediaId) { @@ -199,7 +199,7 @@ namespace appl { { ethread::UniqueLock lock(g_mutex); for (auto &it : m_listFile) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getSha512() == sha512StringRemote) { @@ -250,7 +250,7 @@ namespace appl { for (auto it = m_listFile.begin(); it != m_listFile.end(); /* No increment */) { - if (*it == nullptr) { + if (*it == null) { it = m_listFile.erase(it); continue; } @@ -356,7 +356,7 @@ namespace appl { etk::Vector> listAndParsed = interpreteSQLRequest(_sqlLikeRequest); ethread::UniqueLock lock(g_mutex); for (auto &it : m_listFile) { - if (it == nullptr) { + if (it == null) { continue; } APPL_DEBUG(" [" << it->getUniqueId() << " list=" << mapToString(it->getMetadataDirect())); @@ -377,7 +377,7 @@ namespace appl { etk::Vector> listAndParsed = interpreteSQLRequest(_sqlLikeRequest); ethread::UniqueLock lock(g_mutex); for (auto &it : m_listFile) { - if (it == nullptr) { + if (it == null) { continue; } bool isCorrectElement = isValid(listAndParsed, it->getMetadataDirect()); @@ -471,7 +471,7 @@ static void store_db() { ejson::Array listFilesArray; database.add("list-files", listFilesArray); for (auto &it : m_listFile) { - if (it != nullptr) { + if (it != null) { listFilesArray.add(it->getJson()); } } @@ -489,7 +489,7 @@ static void load_db() { ejson::Array listFilesArray = database["list-files"].toArray(); for (const auto itArray: listFilesArray) { auto property = ememory::makeShared(g_basePath, itArray.toObject()); - if (property == nullptr) { + if (property == null) { APPL_ERROR("can not allocate element ..."); continue; } diff --git a/zeus/AbstractFunction.hpp b/zeus/AbstractFunction.hpp index 06bce98..fda6d8f 100644 --- a/zeus/AbstractFunction.hpp +++ b/zeus/AbstractFunction.hpp @@ -133,7 +133,7 @@ namespace zeus { */ virtual void execute(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, - void* _class=nullptr) = 0; + void* _class=null) = 0; }; } diff --git a/zeus/AbstractFunctionTypeClass.hpp b/zeus/AbstractFunctionTypeClass.hpp index 78604ca..bb1c80b 100644 --- a/zeus/AbstractFunctionTypeClass.hpp +++ b/zeus/AbstractFunctionTypeClass.hpp @@ -26,7 +26,7 @@ namespace zeus { ememory::SharedPtr _obj, ZEUS_CLASS_TYPE* _pointer, ZEUS_RETURN (ZEUS_CLASS_TYPE::*_func)(zeus::ActionNotification& _notifs, ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } ZEUS_RETURN ret; @@ -40,7 +40,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; ret = (*_pointer.*_func)(notifs, _obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceClient"); return; } @@ -61,7 +61,7 @@ namespace zeus { ememory::SharedPtr _obj, ZEUS_CLASS_TYPE* _pointer, ZEUS_RETURN (ZEUS_CLASS_TYPE::*_func)(ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } ZEUS_RETURN ret; @@ -74,7 +74,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; ret = (*_pointer.*_func)(_obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceClient"); return; } @@ -95,7 +95,7 @@ namespace zeus { ememory::SharedPtr _obj, ZEUS_CLASS_TYPE* _pointer, void (ZEUS_CLASS_TYPE::*_func)(zeus::ActionNotification& _notifs, ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } zeus::ActionNotification notifs(_interfaceClient, _obj->getTransactionId(), _obj->getDestination(), _obj->getSource()); @@ -108,7 +108,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; (*_pointer.*_func)(notifs, _obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceClient"); return; } @@ -129,7 +129,7 @@ namespace zeus { ememory::SharedPtr _obj, ZEUS_CLASS_TYPE* _pointer, void (ZEUS_CLASS_TYPE::*_func)(ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } if (zeus::checkOrderFunctionParameter() == true) { @@ -141,7 +141,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; (*_pointer.*_func)(_obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceClient"); return; } @@ -183,15 +183,15 @@ namespace zeus { void execute(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, void* _class) override { - if (_obj == nullptr) { + if (_obj == null) { return; } - ZEUS_CLASS_TYPE* tmpClass = nullptr; - if (_class != nullptr) { + ZEUS_CLASS_TYPE* tmpClass = null; + if (_class != null) { tmpClass = (ZEUS_CLASS_TYPE*)_class; } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceWeb"); return; } @@ -272,15 +272,15 @@ namespace zeus { void execute(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, void* _class) override { - if (_obj == nullptr) { + if (_obj == null) { return; } - ZEUS_CLASS_TYPE* tmpClass = nullptr; - if (_class != nullptr) { + ZEUS_CLASS_TYPE* tmpClass = null; + if (_class != null) { tmpClass = (ZEUS_CLASS_TYPE*)_class; } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceWeb"); return; } diff --git a/zeus/AbstractFunctionTypeDirect.hpp b/zeus/AbstractFunctionTypeDirect.hpp index 1018850..39b6832 100644 --- a/zeus/AbstractFunctionTypeDirect.hpp +++ b/zeus/AbstractFunctionTypeDirect.hpp @@ -21,7 +21,7 @@ namespace zeus { void executeCall(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, ZEUS_RETURN (*_func)(ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } ZEUS_RETURN ret; @@ -34,7 +34,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; ret = _func(_obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceWeb"); return; } @@ -53,7 +53,7 @@ namespace zeus { void executeCall(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, void (*_func)(ZEUS_TYPES...)) { - if (_obj == nullptr) { + if (_obj == null) { return; } if (zeus::checkOrderFunctionParameter() == true) { @@ -65,7 +65,7 @@ namespace zeus { int32_t idParam = int32_t(sizeof...(ZEUS_TYPES))-1; _func(_obj->getParameter(idParam--)...); } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceWeb"); return; } @@ -108,10 +108,10 @@ namespace zeus { void execute(ememory::SharedPtr _interfaceClient, ememory::SharedPtr _obj, void* _class) override { - if (_obj == nullptr) { + if (_obj == null) { return; } - if (_interfaceClient == nullptr) { + if (_interfaceClient == null) { ZEUS_ERROR("Nullptr for _interfaceWeb"); return; } diff --git a/zeus/ActionNotification.hpp b/zeus/ActionNotification.hpp index 7bbfe25..935ef96 100644 --- a/zeus/ActionNotification.hpp +++ b/zeus/ActionNotification.hpp @@ -18,7 +18,7 @@ namespace zeus { uint32_t m_source; uint32_t m_destination; public: - ActionNotification(ememory::SharedPtr _interface = nullptr, + ActionNotification(ememory::SharedPtr _interface = null, uint32_t _transactionId = 0, uint32_t _source = 0, uint32_t _destination = 0): @@ -31,7 +31,7 @@ namespace zeus { emit(_value); } void emit(const ZEUS_TYPE_EVENT& _value) { - if (m_interface == nullptr) { + if (m_interface == null) { return; } m_interface->eventValue(m_transactionId, m_source, m_destination, _value); diff --git a/zeus/Client.cpp b/zeus/Client.cpp index dc586aa..f1a14ff 100644 --- a/zeus/Client.cpp +++ b/zeus/Client.cpp @@ -32,7 +32,7 @@ zeus::Client::~Client() { } void zeus::Client::onClientData(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } ZEUS_DEBUG("receive message : " << _value); @@ -48,7 +48,7 @@ void zeus::Client::onClientData(ememory::SharedPtr _value) { */ // TODO: all the basic checks ... - if (_value == nullptr) { + if (_value == null) { return; } //APPL_ERROR(" ==> parse DATA ..."); @@ -168,7 +168,7 @@ zeus::ObjectRemote zeus::Client::getService(const etk::String& _name) { auto it = m_listConnectedService.begin(); while (it != m_listConnectedService.end()) { ememory::SharedPtr val = it->lock(); - if (val == nullptr) { + if (val == null) { it = m_listConnectedService.erase(it); continue; } @@ -235,7 +235,7 @@ bool zeus::Client::connectTo(const etk::String& _address, echrono::Duration _tim } ZEUS_INFO("connect Connection TCP is OK"); m_interfaceWeb = ememory::makeShared(); - if (m_interfaceWeb == nullptr) { + if (m_interfaceWeb == null) { ZEUS_ERROR("Allocate connection error"); return false; } @@ -342,7 +342,7 @@ bool zeus::Client::connect(const etk::String& _address, const etk::String& _clie void zeus::Client::disconnect() { ZEUS_DEBUG("disconnect [START]"); - if (m_interfaceWeb != nullptr) { + if (m_interfaceWeb != null) { m_interfaceWeb->disconnect(); m_interfaceWeb.reset(); } else { @@ -352,7 +352,7 @@ void zeus::Client::disconnect() { } bool zeus::Client::isAlive() { - if (m_interfaceWeb == nullptr) { + if (m_interfaceWeb == null) { return false; } return m_interfaceWeb->isActive(); @@ -365,7 +365,7 @@ void zeus::Client::pingIsAlive() { } void zeus::Client::displayConnectedObject() { - if (m_interfaceWeb== nullptr) { + if (m_interfaceWeb== null) { return; } m_interfaceWeb->listObjects(); @@ -373,7 +373,7 @@ void zeus::Client::displayConnectedObject() { void zeus::Client::cleanDeadObject() { - if (m_interfaceWeb== nullptr) { + if (m_interfaceWeb== null) { return; } m_interfaceWeb->cleanDeadObject(); diff --git a/zeus/Client.hpp b/zeus/Client.hpp index b2be4f9..8033cfe 100644 --- a/zeus/Client.hpp +++ b/zeus/Client.hpp @@ -131,8 +131,8 @@ namespace zeus { uint32_t _destination, const etk::String& _functionName, _ARGS&&... _args) { - if (m_interfaceWeb == nullptr) { - ememory::SharedPtr ret = zeus::message::Answer::create(nullptr); // TODO : This is really a bad case ... + if (m_interfaceWeb == null) { + ememory::SharedPtr ret = zeus::message::Answer::create(null); // TODO : This is really a bad case ... ret->addError("NULLPTR", "call " + _functionName + " with no interface open"); return zeus::FutureBase(0, ret); } diff --git a/zeus/Future.cpp b/zeus/Future.cpp index d945665..de88ede 100644 --- a/zeus/Future.cpp +++ b/zeus/Future.cpp @@ -13,8 +13,8 @@ namespace zeus { template<> bool futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return false; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -25,8 +25,8 @@ namespace zeus { } template<> int64_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -37,8 +37,8 @@ namespace zeus { } template<> int32_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -49,8 +49,8 @@ namespace zeus { } template<> int16_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -61,8 +61,8 @@ namespace zeus { } template<> int8_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -73,8 +73,8 @@ namespace zeus { } template<> uint64_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -85,8 +85,8 @@ namespace zeus { } template<> uint32_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -97,8 +97,8 @@ namespace zeus { } template<> uint16_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -109,8 +109,8 @@ namespace zeus { } template<> uint8_t futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -121,8 +121,8 @@ namespace zeus { } template<> double futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -133,8 +133,8 @@ namespace zeus { } template<> float futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return 0.0f; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -145,8 +145,8 @@ namespace zeus { } template<> etk::String futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return ""; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -158,8 +158,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -172,8 +172,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -186,8 +186,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -200,8 +200,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -214,8 +214,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -228,8 +228,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -242,8 +242,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -256,8 +256,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -270,8 +270,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -284,8 +284,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -298,8 +298,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -312,8 +312,8 @@ namespace zeus { template<> etk::Vector futureGetValue>(ememory::SharedPtr& _promise) { etk::Vector out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -325,8 +325,8 @@ namespace zeus { } template<> zeus::Raw futureGetValue(ememory::SharedPtr& _promise) { - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return zeus::Raw(); } if (_promise->getRaw()->getType() != zeus::message::type::answer) { @@ -338,8 +338,8 @@ namespace zeus { template<> ememory::SharedPtr futureGetValue>(ememory::SharedPtr& _promise) { ememory::SharedPtr out; - if ( _promise == nullptr - || _promise->getRaw() == nullptr) { + if ( _promise == null + || _promise->getRaw() == null) { return out; } if (_promise->getRaw()->getType() != zeus::message::type::answer) { diff --git a/zeus/Future.hpp b/zeus/Future.hpp index 4e29a61..089c26e 100644 --- a/zeus/Future.hpp +++ b/zeus/Future.hpp @@ -174,7 +174,7 @@ namespace zeus { Future& onSignal(etk::Function _callback) { zeus::FutureBase::onEvent( [=](ememory::SharedPtr _msg) { - if (_msg == nullptr) { + if (_msg == null) { return; } _callback(_msg->getEvent()); @@ -190,7 +190,7 @@ namespace zeus { Future& onSignal(etk::Function _callback) { zeus::FutureBase::onEvent( [=](ememory::SharedPtr _msg) { - if (_msg == nullptr) { + if (_msg == null) { return; } _callback(etk::move(_msg->getEvent())); @@ -339,7 +339,7 @@ namespace zeus { Future& onSignal(etk::Function _callback) { zeus::FutureBase::onEvent( [=](ememory::SharedPtr _msg) { - if (_msg == nullptr) { + if (_msg == null) { return; } _callback(_msg->getEvent()); @@ -355,7 +355,7 @@ namespace zeus { Future& onSignal(etk::Function _callback) { zeus::FutureBase::onEvent( [=](ememory::SharedPtr _msg) { - if (_msg == nullptr) { + if (_msg == null) { return; } _callback(etk::move(_msg->getEvent())); diff --git a/zeus/FutureBase.cpp b/zeus/FutureBase.cpp index 539050f..b3b7b17 100644 --- a/zeus/FutureBase.cpp +++ b/zeus/FutureBase.cpp @@ -18,7 +18,7 @@ zeus::FutureBase::FutureBase(const zeus::FutureBase& _base): } zeus::FutureBase::FutureBase() { - m_promise = nullptr; + m_promise = null; } zeus::FutureBase::FutureBase(uint32_t _transactionId, uint32_t _source) { @@ -30,15 +30,15 @@ zeus::FutureBase::FutureBase(ememory::SharedPtr _promise) { } void zeus::FutureBase::setAction() { - if (m_promise == nullptr) { + if (m_promise == null) { return; } m_promise->setAction(); } ememory::SharedPtr zeus::FutureBase::getRaw() { - if (m_promise == nullptr) { - return nullptr; + if (m_promise == null) { + return null; } return m_promise->getRaw(); } @@ -48,42 +48,42 @@ zeus::FutureBase::FutureBase(uint32_t _transactionId, ememory::SharedPtrremoteObjectDestroyed(); } void zeus::FutureBase::andAll(zeus::Promise::Observer _callback) { - if (m_promise == nullptr) { + if (m_promise == null) { return; } m_promise->andAll(_callback); } void zeus::FutureBase::andThen(zeus::Promise::Observer _callback) { - if (m_promise == nullptr) { + if (m_promise == null) { return; } m_promise->andThen(_callback); } void zeus::FutureBase::andElse(zeus::Promise::Observer _callback) { - if (m_promise == nullptr) { + if (m_promise == null) { return; } m_promise->andElse(_callback); } void zeus::FutureBase::onEvent(zeus::Promise::ObserverEvent _callback) { - if (m_promise == nullptr) { + if (m_promise == null) { return; } m_promise->onEvent(_callback); } echrono::Duration zeus::FutureBase::getTransmitionTime() const { - if (m_promise == nullptr) { + if (m_promise == null) { return echrono::nanoseconds(0); } return m_promise->getTransmitionTime(); @@ -95,7 +95,7 @@ zeus::FutureBase zeus::FutureBase::operator= (const zeus::FutureBase& _base) { } bool zeus::FutureBase::setMessage(ememory::SharedPtr _value) { - if (m_promise == nullptr) { + if (m_promise == null) { ZEUS_ERROR(" Not a valid future ..."); return true; } @@ -103,53 +103,53 @@ bool zeus::FutureBase::setMessage(ememory::SharedPtr _value) { } uint32_t zeus::FutureBase::getTransactionId() const { - if (m_promise == nullptr) { + if (m_promise == null) { return 0; } return m_promise->getTransactionId(); } uint32_t zeus::FutureBase::getSource() const { - if (m_promise == nullptr) { + if (m_promise == null) { return 0; } return m_promise->getSource(); } bool zeus::FutureBase::hasError() const { - if (m_promise == nullptr) { + if (m_promise == null) { return true; } return m_promise->hasError(); } etk::String zeus::FutureBase::getErrorType() const { - if (m_promise == nullptr) { + if (m_promise == null) { return "NULL_PTR"; } return m_promise->getErrorType(); } etk::String zeus::FutureBase::getErrorHelp() const { - if (m_promise == nullptr) { - return "This is a nullptr future"; + if (m_promise == null) { + return "This is a null future"; } return m_promise->getErrorHelp(); } bool zeus::FutureBase::isValid() const { - return m_promise != nullptr; + return m_promise != null; } bool zeus::FutureBase::isFinished() const { - if (m_promise == nullptr) { + if (m_promise == null) { return true; } return m_promise->isFinished(); } const zeus::FutureBase& zeus::FutureBase::wait() const { - if (m_promise == nullptr) { + if (m_promise == null) { return *this; } m_promise->waitFor(echrono::seconds(5)); @@ -157,7 +157,7 @@ const zeus::FutureBase& zeus::FutureBase::wait() const { } const zeus::FutureBase& zeus::FutureBase::waitFor(echrono::Duration _delta) const { - if (m_promise == nullptr) { + if (m_promise == null) { return *this; } m_promise->waitFor(_delta); @@ -165,7 +165,7 @@ const zeus::FutureBase& zeus::FutureBase::waitFor(echrono::Duration _delta) cons } const zeus::FutureBase& zeus::FutureBase::waitUntil(echrono::Steady _endTime) const { - if (m_promise == nullptr) { + if (m_promise == null) { return *this; } m_promise->waitUntil(_endTime); diff --git a/zeus/Object.cpp b/zeus/Object.cpp index 6edec77..c6d3b4a 100644 --- a/zeus/Object.cpp +++ b/zeus/Object.cpp @@ -20,7 +20,7 @@ zeus::Object::Object(const ememory::SharedPtr& _iface, uint16_t } void zeus::Object::receive(ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return; } if (_value->getPartFinish() == false) { diff --git a/zeus/Object.hpp b/zeus/Object.hpp index 4626d17..b4c1559 100644 --- a/zeus/Object.hpp +++ b/zeus/Object.hpp @@ -69,18 +69,18 @@ namespace zeus { ZEUS_RETURN_VALUE (ZEUS_CLASS_TYPE::*_func)(ZEUS_FUNC_ARGS_TYPE... _args)) { _name = "obj." + _name; for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() == _name) { ZEUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); - return nullptr; + return null; } } AbstractFunction* tmp = createAbstractFunctionClass(_name, _func); - if (tmp == nullptr) { + if (tmp == null) { ZEUS_ERROR("can not create abstract function ... '" << _name << "'"); - return nullptr; + return null; } tmp->setType(zeus::AbstractFunction::type::service); ZEUS_VERBOSE("Add function '" << _name << "' in local mode"); @@ -118,21 +118,21 @@ namespace zeus { ZEUS_RETURN_VALUE (ZEUS_CLASS_TYPE::*_func)(zeus::ActionNotification& _notifs, ZEUS_FUNC_ARGS_TYPE... _args)) { if (etk::start_with(_name, "srv.") == true) { ZEUS_ERROR("Advertise function start with 'srv.' is not permited ==> only allow for internal service: '" << _name << "'"); - return nullptr; + return null; } for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() == _name) { ZEUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); - return nullptr; + return null; } } zeus::AbstractFunction* tmp = createAbstractFunctionClass(_name, _func); - if (tmp == nullptr) { + if (tmp == null) { ZEUS_ERROR("can not create abstract function ... '" << _name << "'"); - return nullptr; + return null; } tmp->setType(zeus::AbstractFunction::type::object); ZEUS_VERBOSE("Add function '" << _name << "' in object mode"); @@ -153,21 +153,21 @@ namespace zeus { ZEUS_RETURN_VALUE (ZEUS_CLASS_TYPE::*_func)(ZEUS_FUNC_ARGS_TYPE... _args)) { if (etk::start_with(_name, "srv.") == true) { ZEUS_ERROR("Advertise function start with 'srv.' is not permited ==> only allow for internal service: '" << _name << "'"); - return nullptr; + return null; } for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() == _name) { ZEUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); - return nullptr; + return null; } } zeus::AbstractFunction* tmp = createAbstractFunctionClass(_name, _func); - if (tmp == nullptr) { + if (tmp == null) { ZEUS_ERROR("can not create abstract function ... '" << _name << "'"); - return nullptr; + return null; } tmp->setType(zeus::AbstractFunction::type::object); ZEUS_VERBOSE("Add function '" << _name << "' in object mode"); @@ -187,7 +187,7 @@ namespace zeus { } void callBinary(const etk::String& _call, ememory::SharedPtr _value) override { for (auto &it2 : m_listFunction) { - if (it2 == nullptr) { + if (it2 == null) { continue; } if (it2->getName() != _call) { @@ -210,7 +210,7 @@ namespace zeus { return; } case zeus::AbstractFunction::type::global: { - it2->execute(m_interfaceWeb, _value, nullptr); + it2->execute(m_interfaceWeb, _value, null); return; } case zeus::AbstractFunction::type::unknow: diff --git a/zeus/ObjectRemote.cpp b/zeus/ObjectRemote.cpp index 04a38e2..701f943 100644 --- a/zeus/ObjectRemote.cpp +++ b/zeus/ObjectRemote.cpp @@ -50,13 +50,13 @@ const etk::String& zeus::ObjectRemoteBase::getName() const { zeus::ObjectRemote::ObjectRemote(ememory::SharedPtr _interface): m_interface(_interface) { - if (m_interface == nullptr) { + if (m_interface == null) { return; } } bool zeus::ObjectRemote::exist() const { - if (m_interface == nullptr) { + if (m_interface == null) { return false; } return m_interface->m_isLinked; diff --git a/zeus/ObjectRemote.hpp b/zeus/ObjectRemote.hpp index 1ebc171..958de1f 100644 --- a/zeus/ObjectRemote.hpp +++ b/zeus/ObjectRemote.hpp @@ -31,7 +31,7 @@ namespace zeus { * @brief Contructor of the remote object */ ObjectRemoteBase(): - zeus::WebObj(nullptr, 0, 0) { + zeus::WebObj(null, 0, 0) { ZEUS_INFO("[XX/YY] Create"); } /** @@ -95,7 +95,7 @@ namespace zeus { * @brief Contructor of a remote Object * @param[in] _interface Interface of the object */ - ObjectRemote(ememory::SharedPtr _interface = nullptr); + ObjectRemote(ememory::SharedPtr _interface = null); /** * @brief permit to check if the remote hs been corectly created * @return true The object exist @@ -111,10 +111,10 @@ namespace zeus { */ template zeus::FutureBase call(const etk::String& _functionName, _ARGS&&... _args) const { - if ( m_interface == nullptr - || m_interface->m_interfaceWeb == nullptr) { - ememory::SharedPtr ret = zeus::message::Answer::create(nullptr); // TODO : This is a real bad case ... - if (ret != nullptr) { + if ( m_interface == null + || m_interface->m_interfaceWeb == null) { + ememory::SharedPtr ret = zeus::message::Answer::create(null); // TODO : This is a real bad case ... + if (ret != null) { ret->addError("NULLPTR", "call " + _functionName + " with no interface open"); } return zeus::FutureBase(0, ret); diff --git a/zeus/Promise.cpp b/zeus/Promise.cpp index c249023..a6131d6 100644 --- a/zeus/Promise.cpp +++ b/zeus/Promise.cpp @@ -35,8 +35,8 @@ zeus::Promise::Promise(uint32_t _transactionId, ememory::SharedPtrsetTransactionId(m_transactionId); @@ -62,12 +62,12 @@ void zeus::Promise::andAll(zeus::Promise::Observer _callback) { } if (hasError() == false) { ethread::UniqueLock lock(m_mutex); - if (m_callbackThen != nullptr) { + if (m_callbackThen != null) { m_callbackThen(zeus::FutureBase(sharedFromThis())); } } else { ethread::UniqueLock lock(m_mutex); - if (m_callbackElse != nullptr) { + if (m_callbackElse != null) { m_callbackElse(zeus::FutureBase(sharedFromThis())); } } @@ -85,7 +85,7 @@ void zeus::Promise::andThen(zeus::Promise::Observer _callback) { return; } ethread::UniqueLock lock(m_mutex); - if (m_callbackThen == nullptr) { + if (m_callbackThen == null) { return; } m_callbackThen(zeus::FutureBase(sharedFromThis())); @@ -103,7 +103,7 @@ void zeus::Promise::andElse(zeus::Promise::Observer _callback) { return; } ethread::UniqueLock lock(m_mutex); - if (m_callbackElse == nullptr) { + if (m_callbackElse == null) { return; } m_callbackElse(zeus::FutureBase(sharedFromThis())); @@ -138,8 +138,8 @@ bool zeus::Promise::setMessage(ememory::SharedPtr _value) { } ethread::UniqueLock lock(m_mutex); // notification of a progresion ... - if (callback != nullptr) { - if (_value == nullptr) { + if (callback != null) { + if (_value == null) { return true; } callback(ememory::staticPointerCast(_value)); @@ -154,7 +154,7 @@ bool zeus::Promise::setMessage(ememory::SharedPtr _value) { { ethread::UniqueLock lock(m_mutex); m_message = _value; - if (m_message == nullptr) { + if (m_message == null) { return true; } if (m_message->getPartFinish() == false) { @@ -168,7 +168,7 @@ bool zeus::Promise::setMessage(ememory::SharedPtr _value) { ethread::UniqueLock lock(m_mutex); callback = etk::move(m_callbackThen); } - if (callback != nullptr) { + if (callback != null) { bool ret = callback(zeus::FutureBase(sharedFromThis())); { ethread::UniqueLock lock(m_mutex); @@ -182,7 +182,7 @@ bool zeus::Promise::setMessage(ememory::SharedPtr _value) { ethread::UniqueLock lock(m_mutex); callback = m_callbackElse; } - if (callback != nullptr) { + if (callback != null) { bool ret = callback(zeus::FutureBase(sharedFromThis())); { ethread::UniqueLock lock(m_mutex); @@ -204,7 +204,7 @@ uint32_t zeus::Promise::getSource() const { bool zeus::Promise::hasError() const { ethread::UniqueLock lock(m_mutex); - if (m_message == nullptr) { + if (m_message == null) { return true; } if (m_message->getType() != zeus::message::type::answer) { @@ -215,7 +215,7 @@ bool zeus::Promise::hasError() const { etk::String zeus::Promise::getErrorType() const { ethread::UniqueLock lock(m_mutex); - if (m_message == nullptr) { + if (m_message == null) { return "NULL_PTR"; } if (m_message->getType() != zeus::message::type::answer) { @@ -226,8 +226,8 @@ etk::String zeus::Promise::getErrorType() const { etk::String zeus::Promise::getErrorHelp() const { ethread::UniqueLock lock(m_mutex); - if (m_message == nullptr) { - return "This is a nullptr future"; + if (m_message == null) { + return "This is a null future"; } if (m_message->getType() != zeus::message::type::answer) { return "This answer is not a anwser type"; @@ -238,7 +238,7 @@ etk::String zeus::Promise::getErrorHelp() const { bool zeus::Promise::isFinished() const { ethread::UniqueLock lock(m_mutex); - if (m_message == nullptr) { + if (m_message == null) { // in this case, we are waiting for an answer that the first packet is not arrived return false; } diff --git a/zeus/Raw.cpp b/zeus/Raw.cpp index 10e2b33..c060776 100644 --- a/zeus/Raw.cpp +++ b/zeus/Raw.cpp @@ -11,14 +11,14 @@ ETK_DECLARE_TYPE(zeus::Raw); zeus::Raw::Raw() : m_size(0), - m_dataExternal(nullptr), + m_dataExternal(null), m_dataInternal() { } zeus::Raw::Raw(uint32_t _size) : m_size(_size), - m_dataExternal(nullptr), + m_dataExternal(null), m_dataInternal() { m_dataInternal.resize(_size); } @@ -35,16 +35,16 @@ uint32_t zeus::Raw::size() const { } const uint8_t* zeus::Raw::data() const { - if (m_dataExternal != nullptr) { + if (m_dataExternal != null) { return m_dataExternal; } return &m_dataInternal[0]; } uint8_t* zeus::Raw::writeData() { - if (m_dataExternal != nullptr) { + if (m_dataExternal != null) { ZEUS_ERROR("Try to write on Data that is not allowed ..."); - return nullptr; + return null; } return &m_dataInternal[0]; } diff --git a/zeus/Raw.hpp b/zeus/Raw.hpp index 586bb31..f1b50f4 100644 --- a/zeus/Raw.hpp +++ b/zeus/Raw.hpp @@ -40,12 +40,12 @@ namespace zeus { uint32_t size() const; /** * @brief Get a pointer on the data - * @return a pointer on the data (or nullptr) + * @return a pointer on the data (or null) */ const uint8_t* data() const; /** * @brief Get a writable pointer on the data - * @return a pointer on the data (or nullptr) + * @return a pointer on the data (or null) */ uint8_t* writeData(); }; diff --git a/zeus/RemoteProcessCall.cpp b/zeus/RemoteProcessCall.cpp index 83a773f..4de0ff8 100644 --- a/zeus/RemoteProcessCall.cpp +++ b/zeus/RemoteProcessCall.cpp @@ -13,44 +13,44 @@ zeus::RemoteProcessCall::RemoteProcessCall(const ememory::SharedPtrsetDescription("Get description"); func->setReturn("String version of the service number separate with dot with -dev at the end if developpement version, and '-number' or integration version uipdate : 1.5.2 or 1.8-dev 1.5.2-55"); } func = advertise("getVersion", &zeus::RemoteProcessCall::getVersion); - if (func != nullptr) { + if (func != null) { func->setDescription("Get version"); func->setReturn("String version of the service number separate with dot with -dev at the end if developpement version, and '-number' or integration version uipdate : 1.5.2 or 1.8-dev 1.5.2-55"); } func = advertise("getType", &zeus::RemoteProcessCall::getType); - if (func != nullptr) { + if (func != null) { func->setDescription("Get type"); func->setReturn("String of generic type of the service base on TYPE-ENTERPRISE.ENTERPRISE-NAME.SERVICE-TYPE/VERSION_PROTOCOL"); } func = advertise("getAuthors", &zeus::RemoteProcessCall::getAuthors2); - if (func != nullptr) { + if (func != null) { func->setDescription("Get List of developper/maintainer"); func->setReturn("list of personnes: 'NAME surname '"); } func = advertise("getFunctions", &zeus::RemoteProcessCall::getFunctions); - if (func != nullptr) { + if (func != null) { func->setDescription("Get List of function availlable (filter with right)"); func->setReturn("list of function name"); } func = advertise("getFunctionSignature", &zeus::RemoteProcessCall::getFunctionSignature); - if (func != nullptr) { + if (func != null) { func->setDescription("Get List type of return and after the parameters"); func->addParam("func", "function name"); func->setReturn("list of element type"); } func = advertise("getFunctionPrototype", &zeus::RemoteProcessCall::getFunctionPrototype); - if (func != nullptr) { + if (func != null) { func->setDescription("Get List type of return and after the parameters"); func->addParam("func", "function name"); func->setReturn("list of element type"); } func = advertise("getFunctionDescription", &zeus::RemoteProcessCall::getFunctionDescription); - if (func != nullptr) { + if (func != null) { func->setDescription("get function description"); func->addParam("func", "function name"); func->setReturn("generic string"); @@ -99,7 +99,7 @@ etk::Vector zeus::RemoteProcessCall::getAuthors2() { zeus::AbstractFunction* zeus::RemoteProcessCall::getFunction(etk::String _funcName) { for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _funcName) { @@ -107,7 +107,7 @@ zeus::AbstractFunction* zeus::RemoteProcessCall::getFunction(etk::String _funcNa } return it; } - return nullptr; + return null; } etk::String zeus::RemoteProcessCall::getType() { @@ -122,7 +122,7 @@ void zeus::RemoteProcessCall::setType(const etk::String& _type) { etk::Vector zeus::RemoteProcessCall::getFunctions() { etk::Vector out; for (auto &it: m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } /* @@ -142,7 +142,7 @@ etk::Vector zeus::RemoteProcessCall::getFunctionSignature(etk::Stri } */ for (auto &it: m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _funcName) { @@ -163,7 +163,7 @@ etk::String zeus::RemoteProcessCall::getFunctionPrototype(etk::String _funcName) } */ for (auto &it: m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _funcName) { @@ -181,7 +181,7 @@ etk::String zeus::RemoteProcessCall::getFunctionDescription(etk::String _funcNam } */ for (auto &it: m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() != _funcName) { diff --git a/zeus/RemoteProcessCall.hpp b/zeus/RemoteProcessCall.hpp index 498b5b1..5727958 100644 --- a/zeus/RemoteProcessCall.hpp +++ b/zeus/RemoteProcessCall.hpp @@ -150,18 +150,18 @@ namespace zeus { zeus::AbstractFunction* advertise(const etk::String& _name, ZEUS_RETURN_VALUE (*_func)(ZEUS_FUNC_ARGS_TYPE... _args)) { for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() == _name) { ZEUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); - return nullptr; + return null; } } zeus::AbstractFunction* tmp = createAbstractFunctionDirect(_name, _func); - if (tmp == nullptr) { + if (tmp == null) { ZEUS_ERROR("can not create abstract function ... '" << _name << "'"); - return nullptr; + return null; } tmp->setType(zeus::AbstractFunction::type::global); ZEUS_VERBOSE("Add function '" << _name << "' in global mode"); @@ -182,18 +182,18 @@ namespace zeus { ZEUS_RETURN_VALUE (ZEUS_CLASS_TYPE::*_func)(ZEUS_FUNC_ARGS_TYPE... _args)) { _name = "sys." + _name; for (auto &it : m_listFunction) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getName() == _name) { ZEUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); - return nullptr; + return null; } } zeus::AbstractFunction* tmp = createAbstractFunctionClass(_name, _func); - if (tmp == nullptr) { + if (tmp == null) { ZEUS_ERROR("can not create abstract function ... '" << _name << "'"); - return nullptr; + return null; } tmp->setType(zeus::AbstractFunction::type::local); ZEUS_VERBOSE("Add function '" << _name << "' in local mode"); diff --git a/zeus/WebServer.cpp b/zeus/WebServer.cpp index e35594b..5462028 100644 --- a/zeus/WebServer.cpp +++ b/zeus/WebServer.cpp @@ -22,8 +22,8 @@ ememory::SharedPtr zeus::createBaseCall(const ememory::Shar const etk::String& _functionName) { ememory::SharedPtr obj; obj = zeus::message::Call::create(_iface); - if (obj == nullptr) { - return nullptr; + if (obj == null) { + return null; } obj->setSource(_source); obj->setDestination(_destination); @@ -58,8 +58,8 @@ zeus::WebServer::WebServer() : m_localIdObjectIncrement(1), m_interfaceId(0), m_transmissionId(1), - m_observerElement(nullptr), - m_threadAsync(nullptr) { + m_observerElement(null), + m_threadAsync(null) { m_interfaceId = interfaceId++; m_threadAsyncRunning = false; @@ -72,8 +72,8 @@ zeus::WebServer::WebServer(enet::Tcp _connection, bool _isServer) : m_localIdObjectIncrement(1), m_interfaceId(0), m_transmissionId(1), - m_observerElement(nullptr), - m_threadAsync(nullptr) { + m_observerElement(null), + m_threadAsync(null) { m_interfaceId = interfaceId++; m_threadAsyncRunning = false; setInterface(etk::move(_connection), _isServer); @@ -131,7 +131,7 @@ void zeus::WebServer::interfaceRemoved(etk::Vector _list) { it != m_listRemoteObject.end(); /* no increment */) { ememory::SharedPtr tmp = it->lock(); - if (tmp == nullptr) { + if (tmp == null) { it = m_listRemoteObject.erase(it); continue; } @@ -149,7 +149,7 @@ void zeus::WebServer::interfaceRemoved(etk::Vector _list) { for (auto it=m_listObject.begin(); it != m_listObject.end(); /* no increment */) { - if (*it == nullptr) { + if (*it == null) { it = m_listObject.erase(it); continue; } @@ -184,7 +184,7 @@ void zeus::WebServer::connect(bool _async){ ZEUS_DEBUG("connect [START]"); m_threadAsyncRunning = true; m_threadAsync = ETK_NEW(ethread::Thread, [&](){ threadAsyncCallback();}, "webServerAsync"); - if (m_threadAsync == nullptr) { + if (m_threadAsync == null) { m_threadAsyncRunning = false; ZEUS_ERROR("creating async sender thread!"); return; @@ -209,10 +209,10 @@ void zeus::WebServer::disconnect(bool _inThreadStop){ m_connection.controlClose(); } m_connection.stop(_inThreadStop); - if (m_threadAsync != nullptr) { + if (m_threadAsync != null) { m_threadAsync->join(); ETK_DELETE(ethread::Thread, m_threadAsync); - m_threadAsync = nullptr; + m_threadAsync = null; } ZEUS_DEBUG("disconnect [STOP]"); } @@ -248,7 +248,7 @@ class SendAsyncBinary { } if (m_async.size() == 0) { ememory::SharedPtr obj = zeus::message::Data::create(_interface->sharedFromThis()); - if (obj == nullptr) { + if (obj == null) { return true; } //obj->setInterfaceId(m_interfaceId); @@ -304,7 +304,7 @@ etk::String zeus::WebServer::onReceiveUri(const etk::String& _uri, const etk::Ve return "CLOSE"; } // TODO : Add better return on specific user ... - if (m_observerRequestUri != nullptr) { + if (m_observerRequestUri != null) { etk::Map options; etk::String uri; size_t pos = _uri.find('?'); @@ -339,7 +339,7 @@ void zeus::WebServer::onReceiveData(etk::Vector& _frame, bool _isBinary return; } ememory::SharedPtr dataRaw = zeus::Message::create(sharedFromThis(), _frame); - if (dataRaw == nullptr) { + if (dataRaw == null) { ZEUS_ERROR("Message Allocation ERROR ... "); disconnect(true); return; @@ -365,7 +365,7 @@ void zeus::WebServer::newMessage(ememory::SharedPtr _buffer) { // if an adress id different ... just transmit it ... if (m_localAddress != _buffer->getDestinationId()) { // TODO : Change the callback ... - if (m_observerElement != nullptr) { + if (m_observerElement != null) { m_processingPool.async( [=](){ // not a pending call ==> simple event or call ... @@ -386,7 +386,7 @@ void zeus::WebServer::newMessage(ememory::SharedPtr _buffer) { //ethread::UniqueLock lock(m_mutex); auto it = m_listPartialMessage.begin(); while (it != m_listPartialMessage.end()) { - if (*it == nullptr) { + if (*it == null) { it = m_listPartialMessage.erase(it); continue; } @@ -442,7 +442,7 @@ void zeus::WebServer::newMessage(ememory::SharedPtr _buffer) { ethread::UniqueLock lock(m_listObjectMutex); // Call local object for (auto &it : m_listObject) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getFullId() == dest) { @@ -464,7 +464,7 @@ void zeus::WebServer::newMessage(ememory::SharedPtr _buffer) { // call local map object on remote object for (auto &it : m_listRemoteObject) { ememory::SharedPtr tmp = it.lock(); - if (tmp == nullptr) { + if (tmp == null) { continue; } if (tmp->getFullId() == dest) { @@ -481,7 +481,7 @@ void zeus::WebServer::newMessage(ememory::SharedPtr _buffer) { } } } - if (m_observerElement != nullptr) { + if (m_observerElement != null) { m_processingPool.async( [=](){ // not a pending call ==> simple event or call ... @@ -533,7 +533,7 @@ void zeus::WebServer::listObjects() { { ethread::UniqueLock lock(m_listObjectMutex); for (auto &it : m_listObject) { - if (it == nullptr) { + if (it == null) { continue; } it->display(); @@ -543,7 +543,7 @@ void zeus::WebServer::listObjects() { ethread::UniqueLock lock(m_listRemoteObjectMutex); for (auto &it : m_listRemoteObject) { ememory::SharedPtr tmpp = it.lock(); - if (tmpp == nullptr) { + if (tmpp == null) { continue; } tmpp->display(); @@ -564,7 +564,7 @@ void zeus::WebServer::cleanDeadObject() { for (auto it=m_listObject.begin(); it!=m_listObject.end(); /* no auto increment*/) { - if (*it == nullptr) { + if (*it == null) { it = m_listObject.erase(it); continue; } @@ -600,7 +600,7 @@ bool zeus::WebServer::transferRemoteObjectOwnership(uint16_t _objectAddress, uin { ethread::UniqueLock lock(m_listObjectMutex); for (auto &it : m_listObject) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getObjectId() == _objectAddress) { @@ -612,7 +612,7 @@ bool zeus::WebServer::transferRemoteObjectOwnership(uint16_t _objectAddress, uin ethread::UniqueLock lock(m_listRemoteObjectMutex); for (auto &it : m_listRemoteObject) { ememory::SharedPtr tmp = it.lock(); - if (tmp == nullptr) { + if (tmp == null) { continue; } if (tmp->getObjectId() == _objectAddress) { @@ -633,7 +633,7 @@ bool zeus::WebServer::removeObjectOwnership(uint16_t _objectAddress, uint32_t _s { ethread::UniqueLock lock(m_listObjectMutex); for (auto &it : m_listObject) { - if (it == nullptr) { + if (it == null) { continue; } ZEUS_INFO("1 Remove ownership of " << it->getObjectId() << " == " << _objectAddress); @@ -646,7 +646,7 @@ bool zeus::WebServer::removeObjectOwnership(uint16_t _objectAddress, uint32_t _s ethread::UniqueLock lock(m_listRemoteObjectMutex); for (auto &it : m_listRemoteObject) { ememory::SharedPtr tmp = it.lock(); - if (tmp == nullptr) { + if (tmp == null) { continue; } ZEUS_INFO("2 Remove ownership of " << tmp->getObjectId() << " == " << _objectAddress); @@ -719,7 +719,7 @@ zeus::FutureBase zeus::WebServer::callBinary(ememory::SharedPtr _ void zeus::WebServer::answerError(uint32_t _clientTransactionId, uint32_t _source, uint32_t _destination, const etk::String& _errorValue, const etk::String& _errorHelp) { auto answer = zeus::message::Answer::create(sharedFromThis()); - if (answer == nullptr) { + if (answer == null) { return; } answer->setTransactionId(_clientTransactionId); @@ -731,7 +731,7 @@ void zeus::WebServer::answerError(uint32_t _clientTransactionId, uint32_t _sourc void zeus::WebServer::answerVoid(uint32_t _clientTransactionId, uint32_t _source, uint32_t _destination) { auto answer = zeus::message::Answer::create(sharedFromThis()); - if (answer == nullptr) { + if (answer == null) { return; } answer->setTransactionId(_clientTransactionId); diff --git a/zeus/WebServer.hpp b/zeus/WebServer.hpp index b312798..e42bd1b 100644 --- a/zeus/WebServer.hpp +++ b/zeus/WebServer.hpp @@ -98,8 +98,8 @@ namespace zeus { const etk::String& _functionName, _ARGS&&... _args) { ememory::SharedPtr callElem = createBaseCall(_iface, _transactionId, _source, _destination, _functionName); - if (callElem == nullptr) { - return nullptr; + if (callElem == null) { + return null; } createParam(0, callElem, etk::forward<_ARGS>(_args)...); return callElem; diff --git a/zeus/message/Message.cpp b/zeus/message/Message.cpp index 888ae81..16058cb 100644 --- a/zeus/message/Message.cpp +++ b/zeus/message/Message.cpp @@ -30,7 +30,7 @@ void zeus::Message::appendMessageData(ememory::SharedPtr _o } void zeus::Message::appendMessage(ememory::SharedPtr _obj) { - if (_obj == nullptr) { + if (_obj == null) { return; } if (_obj->getType() != zeus::message::type::data) { @@ -68,8 +68,8 @@ void zeus::Message::clear() { etk::Stream& zeus::operator <<(etk::Stream& _os, const ememory::SharedPtr& _obj) { _os << "zeus::Message: "; - if (_obj == nullptr) { - _os << "nullptr"; + if (_obj == null) { + _os << "null"; } else { _obj->generateDisplay(_os); } @@ -197,17 +197,17 @@ ememory::SharedPtr zeus::Message::create(ememory::SharedPtr(&header), &_buffer[0], sizeof(zeus::message::headerBin)); enum zeus::message::type type = zeus::message::getTypeFromInt(uint16_t(header.flags & 0x07)); switch (type) { case zeus::message::type::unknow: - return nullptr; + return null; case zeus::message::type::call: { ememory::SharedPtr value = zeus::message::Call::create(_iface); - if (value == nullptr) { - return nullptr; + if (value == null) { + return null; } value->setTransactionId(header.transactionId); value->setSourceId(header.sourceId); @@ -222,8 +222,8 @@ ememory::SharedPtr zeus::Message::create(ememory::SharedPtr value = zeus::message::Answer::create(_iface); - if (value == nullptr) { - return nullptr; + if (value == null) { + return null; } value->setTransactionId(header.transactionId); value->setSourceId(header.sourceId); @@ -238,8 +238,8 @@ ememory::SharedPtr zeus::Message::create(ememory::SharedPtr value = zeus::message::Data::create(_iface); - if (value == nullptr) { - return nullptr; + if (value == null) { + return null; } value->setTransactionId(header.transactionId); value->setSourceId(header.sourceId); @@ -254,8 +254,8 @@ ememory::SharedPtr zeus::Message::create(ememory::SharedPtr value = zeus::message::Event::create(_iface); - if (value == nullptr) { - return nullptr; + if (value == null) { + return null; } value->setTransactionId(header.transactionId); value->setSourceId(header.sourceId); @@ -269,6 +269,6 @@ ememory::SharedPtr zeus::Message::create(ememory::SharedPtr _iface): } bool zeus::message::Parameter::writeOn(enet::WebSocket& _interface) { - uint8_t* data = nullptr; + uint8_t* data = null; uint32_t dataSize = 0; uint16_t nbParameters = m_parameter.size(); size_t size = _interface.writeData((uint8_t*)&nbParameters, sizeof(uint16_t)); @@ -126,7 +126,7 @@ zeus::message::ParamType zeus::message::Parameter::getParameterType(int32_t _id) } const uint8_t* zeus::message::Parameter::getParameterPointer(int32_t _id) const { - const uint8_t* out = nullptr; + const uint8_t* out = null; if ( m_parameter.size() <= _id || _id < 0) { ZEUS_ERROR("out of range Id for parameter ... " << _id << " have " << m_parameter.size()); diff --git a/zeus/message/Parameter.hpp b/zeus/message/Parameter.hpp index e6a1424..e5d2097 100644 --- a/zeus/message/Parameter.hpp +++ b/zeus/message/Parameter.hpp @@ -35,7 +35,7 @@ namespace zeus { /** * @brief Get the start pointer of the parameter * @param[in] _id Number of the parameter - * @return pointer of the parameter or nullptr + * @return pointer of the parameter or null */ const uint8_t* getParameterPointer(int32_t _id) const; /** diff --git a/zeus/message/Parameter_getParameter.cpp b/zeus/message/Parameter_getParameter.cpp index 6122258..329605d 100644 --- a/zeus/message/Parameter_getParameter.cpp +++ b/zeus/message/Parameter_getParameter.cpp @@ -1554,7 +1554,7 @@ namespace zeus { // get new local ID: ememory::SharedPtr iface = m_iface; - if (iface != nullptr) { + if (iface != null) { uint16_t id = iface->getAddress(); uint16_t idObj = iface->getNewObjectId(); // Sent to the interface the change of links from the curent interface to the real object remote ... (the client interface can control that the user calle r is athorised to do it ... diff --git a/zeus/zeus-Media.impl.cpp b/zeus/zeus-Media.impl.cpp index 7aee1bc..37026ae 100644 --- a/zeus/zeus-Media.impl.cpp +++ b/zeus/zeus-Media.impl.cpp @@ -161,7 +161,7 @@ void zeus::MediaImpl::setMetadata(etk::String _key, etk::String _value) { || _key == "decorated-name") { return; } - if (m_callback != nullptr) { + if (m_callback != null) { m_callback(this, _key); } }