Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/libraries/network
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/ClientConnection.cc

    r8858 r10765  
    4444    Connection(NETWORK_PEER_ID_SERVER),
    4545    established_(false),
    46     server_(NULL)
     46    server_(nullptr)
    4747  {
    4848    this->serverAddress_ = new ENetAddress();
     
    7272
    7373    // create host
    74     this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);
     74    this->host_ = enet_host_create(nullptr, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);
    7575   
    76     if ( this->host_ == NULL )
     76    if ( this->host_ == nullptr )
    7777    {
    78       orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl;
     78      orxout(internal_error, context::network) << "ClientConnection: host_ == nullptr" << endl;
    7979      // error handling
    8080      return false;
     
    9393
    9494    this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0);
    95     if ( this->server_==NULL )
     95    if ( this->server_==nullptr )
    9696    {
    97       orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl;
     97      orxout(internal_error, context::network) << "ClientConnection: server_ == nullptr" << endl;
    9898      // error handling
    9999      return false;
  • code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc

    r10624 r10765  
    4848bool FunctionCall::execute(){
    4949  NetworkFunctionBase* fct = NetworkFunctionManager::getInstance().getFunctionByNetworkId( this->functionID_ );
    50   assert( fct != NULL );
     50  assert( fct != nullptr );
    5151  assert( this->nrOfArguments_==this->arguments_.size() );
    5252  switch(this->nrOfArguments_)
  • code/branches/cpp11_v2/src/libraries/network/LANDiscoverable.cc

    r10622 r10765  
    8585      assert( this->host_ == 0 );
    8686      this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 );
    87       if ( this->host_ == NULL )
    88           orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl;
     87      if ( this->host_ == nullptr )
     88          orxout(internal_error, context::network) << "LANDiscoverable: host_ == nullptr" << endl;
    8989    }
    9090    else
  • code/branches/cpp11_v2/src/libraries/network/LANDiscovery.cc

    r10624 r10765  
    4242  LANDiscovery::LANDiscovery()
    4343  {
    44     this->host_ = enet_host_create(NULL, 10, 0, 0, 0 );
    45     if ( this->host_ == NULL )
    46         orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl;
     44    this->host_ = enet_host_create(nullptr, 10, 0, 0, 0 );
     45    if ( this->host_ == nullptr )
     46        orxout(internal_error, context::network) << "LANDiscovery: host_ == nullptr" << endl;
    4747  }
    4848
    4949  LANDiscovery::~LANDiscovery()
    5050  {
    51     if (this->host_ != NULL)
     51    if (this->host_ != nullptr)
    5252      enet_host_destroy(this->host_);
    5353  }
     
    6565    address.host = ENET_HOST_BROADCAST;
    6666    peer = enet_host_connect(this->host_, &address, 0, 0);
    67     if (peer == NULL)
     67    if (peer == nullptr)
    6868        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl;
    6969
     
    7171    enet_address_set_host(&address, "ff02::1"); // TODO: use a multicast group
    7272    peer = enet_host_connect(this->host_, &address, 0, 0);
    73     if (peer == NULL)
     73    if (peer == nullptr)
    7474        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl;
    7575
  • code/branches/cpp11_v2/src/libraries/network/MasterServer.cc

    r10624 r10765  
    4343
    4444  /* forward declaration so the linker doesn't complain */
    45   MasterServer *MasterServer::instance = NULL;
     45  MasterServer *MasterServer::instance = nullptr;
    4646
    4747  /* command: list servers */
     
    345345    /***** ENTER MAIN LOOP *****/
    346346    ENetEvent *event = (ENetEvent *)calloc(sizeof(ENetEvent), sizeof(char));
    347     if( event == NULL )
     347    if( event == nullptr )
    348348    {
    349349      orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl;
  • code/branches/cpp11_v2/src/libraries/network/MasterServerComm.cc

    r8858 r10765  
    5454
    5555    /* initiate the client */
    56     this->client = enet_host_create( NULL /* create a client host */,
     56    this->client = enet_host_create( nullptr /* create a client host */,
    5757        1,
    5858        2, /* allow up 2 channels to be used, 0 and 1 */
     
    6161
    6262    /* see if it worked */
    63     if (this->client == NULL)
     63    if (this->client == nullptr)
    6464    { orxout(internal_error, context::master_server) << "An error occurred while trying to create an "
    6565        << "ENet client host." << endl;
     
    8585    this->peer = enet_host_connect(this->client, &this->address, 2, 0);   
    8686
    87     if( this->peer == NULL )
     87    if( this->peer == nullptr )
    8888    { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet"
    8989        << " connection." << endl;
     
    157157
    158158    /* address buffer */
    159     char *addrconv = NULL;
     159    char *addrconv = nullptr;
    160160    int retval = 0;
    161161
     
    193193
    194194          /* call the supplied callback, if any. */
    195           if( listener != NULL )
     195          if( listener != nullptr )
    196196            retval = listener->rhandler( addrconv, &(this->event) );
    197197
  • code/branches/cpp11_v2/src/libraries/network/NetworkFunctionManager.cc

    r10624 r10765  
    7171            return it->second;
    7272        else
    73             return NULL;
     73            return nullptr;
    7474    }
    7575
  • code/branches/cpp11_v2/src/libraries/network/PeerList.cc

    r10622 r10765  
    4141  PeerList::addPeer( ENetPeer *toadd )
    4242  { /* error correction */
    43     if( toadd == NULL )
     43    if( toadd == nullptr )
    4444    { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl;
    4545      return -1;
     
    9292
    9393    /* not found */
    94     return NULL;
     94    return nullptr;
    9595  }
    9696
  • code/branches/cpp11_v2/src/libraries/network/Server.cc

    r10622 r10765  
    244244  {
    245245//     ClientInformation *temp = ClientInformation::getBegin();
    246 //     if( temp == NULL )
     246//     if( temp == nullptr )
    247247      //no client connected
    248248    if( this->clientIDs_.size()==0 )
     
    255255    }
    256256//     orxout(verbose, context::network) << "sending DeleteObjects" << endl;
    257 //     while(temp != NULL){
     257//     while(temp != nullptr){
    258258//       if( !(temp->getSynched()) )
    259259//       {
  • code/branches/cpp11_v2/src/libraries/network/ServerConnection.cc

    r8858 r10765  
    7373    this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);
    7474   
    75     if ( this->host_ == NULL )
     75    if ( this->host_ == nullptr )
    7676    {
    77         orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl;
     77        orxout(internal_error, context::network) << "ServerConnection: host_ == nullptr" << endl;
    7878        return false;
    7979    }
  • code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc

    r9667 r10765  
    5858  for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){
    5959    id = it->second;
    60     if(id == NULL || !id->hasFactory())
     60    if(id == nullptr || !id->hasFactory())
    6161      continue;
    6262    const std::string& classname = id->getName();
     
    144144    id=ClassByString( std::string((const char*)classname) );
    145145    orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl;
    146     if(id==NULL){
     146    if(id==nullptr){
    147147      orxout(user_error, context::packets) << "Received a bad classname" << endl;
    148148      abort();
  • code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc

    r9667 r10765  
    608608
    609609  if(dest_length==0)
    610     return NULL;
     610    return nullptr;
    611611
    612612  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
     
    645645
    646646  if(dest_length==0)
    647     return NULL;
     647    return nullptr;
    648648
    649649  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
  • code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc

    r8858 r10765  
    122122  // Destroy the ENetPacket if necessary.
    123123  // Note: For the case ENet used the callback to destroy the packet, we have already set
    124   // enetPacket_ to NULL to avoid destroying it again.
     124  // enetPacket_ to nullptr to avoid destroying it again.
    125125  if (this->enetPacket_)
    126126  {
  • code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc

    r10624 r10765  
    105105  uint32_t Synchronisable::findContextID(Context* context)
    106106  {
    107       if (context == NULL)
     107      if (context == nullptr)
    108108          return OBJECTID_UNKNOWN;
    109109
    110110      Synchronisable* synchronisableContext = orxonox_cast<Synchronisable*>(context);
    111       if (synchronisableContext != NULL)
     111      if (synchronisableContext != nullptr)
    112112          return synchronisableContext->getObjectID();
    113113      else
     
    226226      return it1->second;
    227227    // if the objects not in the map it should'nt exist at all anymore
    228     return NULL;
     228    return nullptr;
    229229  }
    230230
Note: See TracChangeset for help on using the changeset viewer.