Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2015, 10:54:34 PM (9 years ago)
Author:
landauf
Message:

replace '0' by 'nullptr'

Location:
code/branches/cpp11_v2/src/libraries/core/command
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc

    r10765 r10768  
    5454    void CommandEvaluation::initialize(const std::string& command)
    5555    {
    56         this->execCommand_ = 0;
    57         this->hintCommand_ = 0;
     56        this->execCommand_ = nullptr;
     57        this->hintCommand_ = nullptr;
    5858        this->string_ = command;
    5959        this->execArgumentsOffset_ = 0;
  • code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.h

    r10765 r10768  
    8686
    8787            int execute();
    88             MultiType query(int* error = 0);
     88            MultiType query(int* error = nullptr);
    8989
    9090            std::string complete();
     
    9797            /// Returns true if the command evaluation contains a valid command that can be executed.
    9898            inline bool isValid() const
    99                 { return (this->execCommand_ != 0); }
     99                { return (this->execCommand_ != nullptr); }
    100100
    101101            /// Returns the console command that was evaluated by this object.
  • code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.h

    r8858 r10768  
    113113            static int execute(const std::string& command, bool useTcl = true, bool printErrors = true); // tolua_export
    114114
    115             static MultiType queryMT(const std::string& command, int* error = 0, bool useTcl = true);
    116             static std::string query(const std::string& command, int* error = 0, bool useTcl = true); // tolua_export
     115            static MultiType queryMT(const std::string& command, int* error = nullptr, bool useTcl = true);
     116            static std::string query(const std::string& command, int* error = NULL, bool useTcl = true); // tolua_export
    117117
    118118            static CommandEvaluation evaluate(const std::string& command);
  • code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc

    r10765 r10768  
    7676
    7777        for (size_t i = 0; i < MAX_FUNCTOR_ARGUMENTS; ++i)
    78             this->argumentCompleter_[i] = 0;
     78            this->argumentCompleter_[i] = nullptr;
    7979
    8080        this->keybindMode_ = KeybindMode::OnPress;
     
    353353    {
    354354        if (this->executor_)
    355             this->executor_->setFunctor(0);
     355            this->executor_->setFunctor(nullptr);
    356356        this->objectStack_.clear();
    357357    }
     
    405405    void ConsoleCommand::popObject()
    406406    {
    407         void* newobject = 0;
     407        void* newobject = nullptr;
    408408        if (!this->objectStack_.empty())
    409409        {
     
    422422            return this->executor_->getFunctor()->getRawObjectPointer();
    423423        else
    424             return 0;
     424            return nullptr;
    425425    }
    426426
     
    528528            return this->argumentCompleter_[index];
    529529        else
    530             return 0;
     530            return nullptr;
    531531    }
    532532
  • code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommandManager.cc

    r10624 r10768  
    3939namespace orxonox
    4040{
    41     ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = 0;
     41    ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = nullptr;
    4242
    4343    /**
     
    6868                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    6969        }
    70         return 0;
     70        return nullptr;
    7171    }
    7272
     
    101101                orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl;
    102102        }
    103         return 0;
     103        return nullptr;
    104104    }
    105105
     
    125125
    126126        // check if a command with this name already exists
    127         if (this->getCommand(group, name) != 0)
     127        if (this->getCommand(group, name) != nullptr)
    128128        {
    129129            if (group == "")
  • code/branches/cpp11_v2/src/libraries/core/command/Executor.h

    r9550 r10768  
    121121                { return (*this->functor_)(arg1, arg2, arg3, arg4, arg5); }
    122122
    123             MultiType parse(const std::string& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const;
    124             MultiType parse(const SubString& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const;
    125 
    126             int evaluateArguments(const SubString& arguments, MultiType arg[MAX_FUNCTOR_ARGUMENTS], int* error = 0, const std::string& delimiter = " ") const;
     123            MultiType parse(const std::string& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const;
     124            MultiType parse(const SubString& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const;
     125
     126            int evaluateArguments(const SubString& arguments, MultiType arg[MAX_FUNCTOR_ARGUMENTS], int* error = nullptr, const std::string& delimiter = " ") const;
    127127
    128128            /// Changes the functor.
     
    249249
    250250            /// Overloads Executor::parse() with an additional object-pointer.
    251             MultiType parse(T* object, const std::string& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const
     251            MultiType parse(T* object, const std::string& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const
    252252            {
    253253                T* oldobject = this->functorMember_->getObject();
  • code/branches/cpp11_v2/src/libraries/core/command/Functor.h

    r10765 r10768  
    242242        public:
    243243            /// Constructor: Stores the object-pointer.
    244             FunctorMember(O* object = 0) : object_(object), bSafeMode_(false) {}
     244            FunctorMember(O* object = nullptr) : object_(object), bSafeMode_(false) {}
    245245            virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } }
    246246
     
    310310            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode.
    311311            inline void objectDeleted()
    312                 { this->object_ = 0; }
     312                { this->object_ = nullptr; }
    313313
    314314            O* object_;     ///< The stored object-pointer, used to execute a member-function (or nullptr for static functions)
     
    322322        public:
    323323            /// Constructor: Stores the object-pointer.
    324             FunctorMember(void* object = 0) {}
     324            FunctorMember(void* object = nullptr) {}
    325325
    326326            /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
     
    330330            MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null)
    331331            {
    332                 return (*this)((void*)0, param1, param2, param3, param4, param5);
     332                return (*this)((void*)nullptr, param1, param2, param3, param4, param5);
    333333            }
    334334
     
    342342            // see Functor::getRawObjectPointer()
    343343            inline void* getRawObjectPointer() const
    344                 { return 0; }
     344                { return nullptr; }
    345345
    346346            // see Functor::setSafeMode()
     
    369369        public:
    370370            /// Constructor: Initializes the base class and stores the function-pointer.
    371             FunctorPointer(F functionPointer, O* object = 0) : FunctorMember<O>(object), functionPointer_(functionPointer) {}
     371            FunctorPointer(F functionPointer, O* object = nullptr) : FunctorMember<O>(object), functionPointer_(functionPointer) {}
    372372
    373373            /// Changes the function-pointer.
     
    494494        public:
    495495            /// Constructor: Initializes the base class.
    496             FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = 0) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {}
     496            FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = nullptr) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {}
    497497
    498498            // see FunctorMember::operator()()
  • code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc

    r10765 r10768  
    6262        , promptString_("orxonox # ")
    6363        , bStatusPrinted_(false)
    64         , originalTerminalSettings_(0)
     64        , originalTerminalSettings_(nullptr)
    6565    {
    6666        this->setTerminalMode();
     
    326326            tcsetattr(0, TCSANOW, IOConsole::singletonPtr_s->originalTerminalSettings_);
    327327            delete IOConsole::singletonPtr_s->originalTerminalSettings_;
    328             IOConsole::singletonPtr_s->originalTerminalSettings_ = 0;
     328            IOConsole::singletonPtr_s->originalTerminalSettings_ = nullptr;
    329329        }
    330330    }
  • code/branches/cpp11_v2/src/libraries/core/command/IRC.cc

    r10624 r10768  
    6666    IRC::IRC()
    6767    {
    68         this->interpreter_ = 0;
     68        this->interpreter_ = nullptr;
    6969    }
    7070
  • code/branches/cpp11_v2/src/libraries/core/command/TclBind.cc

    r10765 r10768  
    4747    SetConsoleCommand("bgerror", &TclBind::bgerror).hide();
    4848
    49     TclBind* TclBind::singletonPtr_s = 0;
     49    TclBind* TclBind::singletonPtr_s = nullptr;
    5050
    5151    /**
     
    5555    TclBind::TclBind(const std::string& datapath)
    5656    {
    57         this->interpreter_ = 0;
     57        this->interpreter_ = nullptr;
    5858        this->bSetTclDataPath_ = false;
    5959        this->setDataPath(datapath);
  • code/branches/cpp11_v2/src/libraries/core/command/TclBind.h

    r8079 r10768  
    121121            static void tcl_execute(Tcl::object const &args);
    122122
    123             static std::string eval(const std::string& tclcode, int* error = 0);
     123            static std::string eval(const std::string& tclcode, int* error = nullptr);
    124124
    125125        private:
  • code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc

    r10624 r10768  
    8686    };
    8787
    88     TclThreadManager* TclThreadManager::singletonPtr_s = 0;
     88    TclThreadManager* TclThreadManager::singletonPtr_s = nullptr;
    8989
    9090    /**
     
    289289        catch (const Tcl::tcl_error& e)
    290290        {
    291             bundle->interpreter_ = 0;
     291            bundle->interpreter_ = nullptr;
    292292            orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl;
    293293        }
     
    521521        {
    522522            TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
    523             return 0;
     523            return nullptr;
    524524        }
    525525    }
Note: See TracChangeset for help on using the changeset viewer.