Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (9 years ago)
Author:
muemart
Message:

Run clang-modernize -loop-convert

  • Again, not all possible loops were converted
  • It can do pretty cool transformations, but I had to fix a few compile errors, so there might be some runtime errors lurking around too
Location:
code/branches/cpp11_v2/src/orxonox/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10771 r10821  
    407407        if (ambient != nullptr)
    408408        {
    409             for (AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)
    410             {
    411                 if (it->first == ambient)
     409            for (auto & elem : this->ambientSounds_)
     410            {
     411                if (elem.first == ambient)
    412412                {
    413                     it->second = true;
    414                     this->fadeOut(it->first);
     413                    elem.second = true;
     414                    this->fadeOut(elem.first);
    415415                    return;
    416416                }
  • code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc

    r10765 r10821  
    6868        int current_section;
    6969
    70         for(int i = 0; i < 4; i++)
     70        for(auto & initbuffer : initbuffers)
    7171        {
    7272            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
     
    8282            }
    8383
    84             alBufferData(initbuffers[i], format, &inbuffer, ret, vorbisInfo->rate);
     84            alBufferData(initbuffer, format, &inbuffer, ret, vorbisInfo->rate);
    8585        }
    8686        alSourceQueueBuffers(audioSource, 4, initbuffers);
Note: See TracChangeset for help on using the changeset viewer.