diff options
author | David Robillard <d@drobilla.net> | 2017-12-25 13:59:47 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-25 16:26:13 -0500 |
commit | d6a9571641bcb34acb3521feb08eea33195fd9ca (patch) | |
tree | 5c28e2800d829b7b1896e2fcbe3f8870b88e039d /src/server/internals | |
parent | 25177612b20f7d3ebd4138fed9cd9acffec7e756 (diff) | |
download | ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.tar.gz ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.tar.bz2 ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.zip |
Use nullptr
Diffstat (limited to 'src/server/internals')
-rw-r--r-- | src/server/internals/Note.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 754d76f2..9b157d54 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -225,7 +225,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame assert(note_num <= 127); Key* key = &_keys[note_num]; - Voice* voice = NULL; + Voice* voice = nullptr; uint32_t voice_num = 0; if (key->state != Key::State::OFF) { @@ -242,7 +242,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame } // If we didn't find a free one, steal the oldest - if (voice == NULL) { + if (voice == nullptr) { voice_num = 0; voice = &(*_voices)[0]; FrameTime oldest_time = (*_voices)[0].time; @@ -254,7 +254,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame } } } - assert(voice != NULL); + assert(voice != nullptr); assert(voice == &(*_voices)[voice_num]); // Update stolen key, if applicable @@ -325,19 +325,19 @@ NoteNode::free_voice(RunContext& context, uint32_t voice, FrameTime time) assert(time >= context.start() && time <= context.end()); // Find a key to reassign to the freed voice (the newest, if there is one) - Key* replace_key = NULL; + Key* replace_key = nullptr; uint8_t replace_key_num = 0; for (uint8_t i = 0; i <= 127; ++i) { if (_keys[i].state == Key::State::ON_UNASSIGNED) { - if (replace_key == NULL || _keys[i].time > replace_key->time) { + if (replace_key == nullptr || _keys[i].time > replace_key->time) { replace_key = &_keys[i]; replace_key_num = i; } } } - if (replace_key != NULL) { // Found a key to assign to freed voice + if (replace_key != nullptr) { // Found a key to assign to freed voice assert(&_keys[replace_key_num] == replace_key); assert(replace_key->state == Key::State::ON_UNASSIGNED); |