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/orxonox/weaponsystem
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/Munition.cc

    r9667 r10768  
    6565            // For separated magazines we definitively need a given user
    6666            if (!user)
    67                 return 0;
     67                return nullptr;
    6868
    6969            // Use the map to get the magazine assigned to the given user
     
    7979        }
    8080
    81         return 0;
     81        return nullptr;
    8282    }
    8383
     
    236236        // If we don't use separate magazines, set user to 0
    237237        if (!this->bUseSeparateMagazines_)
    238             user = 0;
     238            user = nullptr;
    239239
    240240        // Remove the current magazine for the given user
     
    442442        // If we don't use separate magazines, set user to 0
    443443        if (!this->bUseSeparateMagazines_)
    444             user = 0;
     444            user = nullptr;
    445445
    446446        // Remove the current magazine for the given user
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/Weapon.cc

    r10650 r10768  
    4545        RegisterObject(Weapon);
    4646
    47         this->weaponPack_ = 0;
    48         this->weaponSlot_ = 0;
     47        this->weaponPack_ = nullptr;
     48        this->weaponSlot_ = nullptr;
    4949        this->bReloading_ = false;
    5050        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
     
    9292            ++i;
    9393        }
    94         return 0;
     94        return nullptr;
    9595    }
    9696
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponMode.cc

    r10650 r10768  
    5151        RegisterObject(WeaponMode);
    5252
    53         this->weapon_ = 0;
     53        this->weapon_ = nullptr;
    5454        this->mode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
    5555
    56         this->munition_ = 0;
     56        this->munition_ = nullptr;
    5757        this->initialMunition_ = 0;
    5858        this->initialMagazines_ = 0;
     
    232232        }
    233233        else
    234             this->munition_ = 0;
     234            this->munition_ = nullptr;
    235235    }
    236236
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc

    r10650 r10768  
    4444        RegisterObject(WeaponPack);
    4545
    46         this->weaponSystem_ = 0;
     46        this->weaponSystem_ = nullptr;
    4747    }
    4848
     
    107107        assert(it != this->weapons_.end());
    108108        this->weapons_.erase(it);
    109         weapon->setWeaponPack(0);
     109        weapon->setWeaponPack(nullptr);
    110110    }
    111111
     
    121121        }
    122122
    123         return 0;
     123        return nullptr;
    124124    }
    125125
     
    139139            ++i;
    140140        }
    141         return 0;
     141        return nullptr;
    142142    }
    143143
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSet.cc

    r10650 r10768  
    4343        RegisterObject(WeaponSet);
    4444
    45         this->weaponSystem_ = 0;
     45        this->weaponSystem_ = nullptr;
    4646        this->desiredFiremode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
    4747    }
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSlot.cc

    r10648 r10768  
    4343        RegisterObject(WeaponSlot);
    4444
    45         this->weaponSystem_ = 0;
    46         this->weapon_ = 0;
     45        this->weaponSystem_ = nullptr;
     46        this->weapon_ = nullptr;
    4747
    4848        this->setSyncMode(ObjectDirection::None);
     
    8888        if (this->weapon_)
    8989        {
    90             this->weapon_->setWeaponSlot(0);
    91             this->weapon_ = 0;
     90            this->weapon_->setWeaponSlot(nullptr);
     91            this->weapon_ = nullptr;
    9292        }
    9393    }
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSlot.h

    r10650 r10768  
    7474            */
    7575            inline bool isOccupied() const
    76                 { return (this->weapon_ != 0); }
     76                { return (this->weapon_ != nullptr); }
    7777
    7878            inline void setWeaponSystem(WeaponSystem * weaponSystem)
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponSystem.cc

    r10650 r10768  
    5252        RegisterObject(WeaponSystem);
    5353
    54         this->pawn_ = 0;
     54        this->pawn_ = nullptr;
    5555    }
    5656
     
    6060        {
    6161            if (this->pawn_)
    62                 this->pawn_->setWeaponSystem(0);
     62                this->pawn_->setWeaponSystem(nullptr);
    6363
    6464            while (!this->weaponSets_.empty())
     
    112112                return (*it);
    113113        }
    114         return 0;
     114        return nullptr;
    115115    }
    116116
     
    159159                return it->second;
    160160        }
    161         return 0;
     161        return nullptr;
    162162    }
    163163
     
    213213        // Remove all weapons from their WeaponSlot
    214214        unsigned int i = 0;
    215         Weapon* weapon = 0;
     215        Weapon* weapon = nullptr;
    216216        while ((weapon = wPack->getWeapon(i++)))
    217217            if (weapon->getWeaponSlot())
     
    237237                return (*it);
    238238        }
    239         return 0;
     239        return nullptr;
    240240    }
    241241
     
    303303    {
    304304        if (!identifier || !identifier->getIdentifier())
    305             return 0;
     305            return nullptr;
    306306
    307307        std::map<Identifier *, Munition *>::iterator it = this->munitions_.find(identifier->getIdentifier());
     
    318318        else
    319319        {
    320             return 0;
     320            return nullptr;
    321321        }
    322322    }
Note: See TracChangeset for help on using the changeset viewer.