Add * on auto pointers everywhere

This commit is contained in:
Jean Pierre Cimalando 2020-10-20 21:59:57 +02:00
parent 11fd2f3647
commit 3df9c3692f
6 changed files with 113 additions and 113 deletions

View file

@ -49,10 +49,10 @@ inline void tickPan(const float* pan, float* leftBuffer, float* rightBuffer)
void pan(const float* panEnvelope, float* leftBuffer, float* rightBuffer, unsigned size) noexcept void pan(const float* panEnvelope, float* leftBuffer, float* rightBuffer, unsigned size) noexcept
{ {
const auto sentinel = panEnvelope + size; const auto* sentinel = panEnvelope + size;
#if SFIZZ_HAVE_NEON #if SFIZZ_HAVE_NEON
const auto firstAligned = prevAligned<ByteAlignment>(panEnvelope + TypeAlignment - 1); const auto* firstAligned = prevAligned<ByteAlignment>(panEnvelope + TypeAlignment - 1);
if (willAlign<ByteAlignment>(panEnvelope, leftBuffer, rightBuffer) && (firstAligned < sentinel)) { if (willAlign<ByteAlignment>(panEnvelope, leftBuffer, rightBuffer) && (firstAligned < sentinel)) {
while (panEnvelope < firstAligned) { while (panEnvelope < firstAligned) {
@ -63,7 +63,7 @@ void pan(const float* panEnvelope, float* leftBuffer, float* rightBuffer, unsign
uint32_t indices[TypeAlignment]; uint32_t indices[TypeAlignment];
float leftPan[TypeAlignment]; float leftPan[TypeAlignment];
float rightPan[TypeAlignment]; float rightPan[TypeAlignment];
const auto lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
while (panEnvelope < lastAligned) { while (panEnvelope < lastAligned) {
float32x4_t mmPan = vld1q_f32(panEnvelope); float32x4_t mmPan = vld1q_f32(panEnvelope);
mmPan = vaddq_f32(mmPan, vdupq_n_f32(1.0f)); mmPan = vaddq_f32(mmPan, vdupq_n_f32(1.0f));
@ -112,10 +112,10 @@ inline void tickWidth(const float* width, float* leftBuffer, float* rightBuffer)
void width(const float* widthEnvelope, float* leftBuffer, float* rightBuffer, unsigned size) noexcept void width(const float* widthEnvelope, float* leftBuffer, float* rightBuffer, unsigned size) noexcept
{ {
const auto sentinel = widthEnvelope + size; const auto* sentinel = widthEnvelope + size;
#if SFIZZ_HAVE_NEON #if SFIZZ_HAVE_NEON
const auto firstAligned = prevAligned<ByteAlignment>(widthEnvelope + TypeAlignment - 1); const auto* firstAligned = prevAligned<ByteAlignment>(widthEnvelope + TypeAlignment - 1);
if (willAlign<ByteAlignment>(widthEnvelope, leftBuffer, rightBuffer) && firstAligned < sentinel) { if (willAlign<ByteAlignment>(widthEnvelope, leftBuffer, rightBuffer) && firstAligned < sentinel) {
while (widthEnvelope < firstAligned) { while (widthEnvelope < firstAligned) {
@ -126,7 +126,7 @@ void width(const float* widthEnvelope, float* leftBuffer, float* rightBuffer, un
uint32_t indices[TypeAlignment]; uint32_t indices[TypeAlignment];
float coeff1[TypeAlignment]; float coeff1[TypeAlignment];
float coeff2[TypeAlignment]; float coeff2[TypeAlignment];
const auto lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
while (widthEnvelope < lastAligned) { while (widthEnvelope < lastAligned) {
float32x4_t mmWidth = vld1q_f32(widthEnvelope); float32x4_t mmWidth = vld1q_f32(widthEnvelope);
mmWidth = vaddq_f32(mmWidth, vdupq_n_f32(1.0f)); mmWidth = vaddq_f32(mmWidth, vdupq_n_f32(1.0f));

View file

@ -663,10 +663,10 @@ void sfzInterpolationCast(absl::Span<const T> floatJumps, absl::Span<int> jumps,
SFIZZ_CHECK(jumps.size() >= floatJumps.size()); SFIZZ_CHECK(jumps.size() >= floatJumps.size());
SFIZZ_CHECK(jumps.size() == coeffs.size()); SFIZZ_CHECK(jumps.size() == coeffs.size());
auto floatJump = floatJumps.data(); auto* floatJump = floatJumps.data();
auto jump = jumps.data(); auto* jump = jumps.data();
auto coeff = coeffs.data(); auto* coeff = coeffs.data();
const auto sentinel = floatJump + min(floatJumps.size(), jumps.size(), coeffs.size()); const auto* sentinel = floatJump + min(floatJumps.size(), jumps.size(), coeffs.size());
while (floatJump < sentinel) while (floatJump < sentinel)
_internals::snippetSFZInterpolationCast(floatJump, jump, coeff); _internals::snippetSFZInterpolationCast(floatJump, jump, coeff);

View file

@ -21,55 +21,55 @@ sfizz_synth_t* sfizz_create_synth()
bool sfizz_load_file(sfizz_synth_t* synth, const char* path) bool sfizz_load_file(sfizz_synth_t* synth, const char* path)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->loadSfzFile(path); return self->loadSfzFile(path);
} }
bool sfizz_load_string(sfizz_synth_t* synth, const char* path, const char* text) bool sfizz_load_string(sfizz_synth_t* synth, const char* path, const char* text)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->loadSfzString(path, text); return self->loadSfzString(path, text);
} }
bool sfizz_load_scala_file(sfizz_synth_t* synth, const char* path) bool sfizz_load_scala_file(sfizz_synth_t* synth, const char* path)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->loadScalaFile(path); return self->loadScalaFile(path);
} }
bool sfizz_load_scala_string(sfizz_synth_t* synth, const char* text) bool sfizz_load_scala_string(sfizz_synth_t* synth, const char* text)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->loadScalaString(text); return self->loadScalaString(text);
} }
void sfizz_set_scala_root_key(sfizz_synth_t* synth, int root_key) void sfizz_set_scala_root_key(sfizz_synth_t* synth, int root_key)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setScalaRootKey(root_key); self->setScalaRootKey(root_key);
} }
int sfizz_get_scala_root_key(sfizz_synth_t* synth) int sfizz_get_scala_root_key(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getScalaRootKey(); return self->getScalaRootKey();
} }
void sfizz_set_tuning_frequency(sfizz_synth_t* synth, float frequency) void sfizz_set_tuning_frequency(sfizz_synth_t* synth, float frequency)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setTuningFrequency(frequency); self->setTuningFrequency(frequency);
} }
float sfizz_get_tuning_frequency(sfizz_synth_t* synth) float sfizz_get_tuning_frequency(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getTuningFrequency(); return self->getTuningFrequency();
} }
void sfizz_load_stretch_tuning_by_ratio(sfizz_synth_t* synth, float ratio) void sfizz_load_stretch_tuning_by_ratio(sfizz_synth_t* synth, float ratio)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->loadStretchTuningByRatio(ratio); self->loadStretchTuningByRatio(ratio);
} }
@ -80,105 +80,105 @@ void sfizz_free(sfizz_synth_t* synth)
int sfizz_get_num_regions(sfizz_synth_t* synth) int sfizz_get_num_regions(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumRegions(); return self->getNumRegions();
} }
int sfizz_get_num_groups(sfizz_synth_t* synth) int sfizz_get_num_groups(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumGroups(); return self->getNumGroups();
} }
int sfizz_get_num_masters(sfizz_synth_t* synth) int sfizz_get_num_masters(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumMasters(); return self->getNumMasters();
} }
int sfizz_get_num_curves(sfizz_synth_t* synth) int sfizz_get_num_curves(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumCurves(); return self->getNumCurves();
} }
char* sfizz_export_midnam(sfizz_synth_t* synth, const char* model) char* sfizz_export_midnam(sfizz_synth_t* synth, const char* model)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return strdup(self->exportMidnam(model ? model : "").c_str()); return strdup(self->exportMidnam(model ? model : "").c_str());
} }
size_t sfizz_get_num_preloaded_samples(sfizz_synth_t* synth) size_t sfizz_get_num_preloaded_samples(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumPreloadedSamples(); return self->getNumPreloadedSamples();
} }
int sfizz_get_num_active_voices(sfizz_synth_t* synth) int sfizz_get_num_active_voices(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumActiveVoices(); return self->getNumActiveVoices();
} }
void sfizz_set_samples_per_block(sfizz_synth_t* synth, int samples_per_block) void sfizz_set_samples_per_block(sfizz_synth_t* synth, int samples_per_block)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setSamplesPerBlock(samples_per_block); self->setSamplesPerBlock(samples_per_block);
} }
void sfizz_set_sample_rate(sfizz_synth_t* synth, float sample_rate) void sfizz_set_sample_rate(sfizz_synth_t* synth, float sample_rate)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setSampleRate(sample_rate); self->setSampleRate(sample_rate);
} }
void sfizz_send_note_on(sfizz_synth_t* synth, int delay, int note_number, char velocity) void sfizz_send_note_on(sfizz_synth_t* synth, int delay, int note_number, char velocity)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->noteOn(delay, note_number, velocity); self->noteOn(delay, note_number, velocity);
} }
void sfizz_send_note_off(sfizz_synth_t* synth, int delay, int note_number, char velocity) void sfizz_send_note_off(sfizz_synth_t* synth, int delay, int note_number, char velocity)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->noteOff(delay, note_number, velocity); self->noteOff(delay, note_number, velocity);
} }
void sfizz_send_cc(sfizz_synth_t* synth, int delay, int cc_number, char cc_value) void sfizz_send_cc(sfizz_synth_t* synth, int delay, int cc_number, char cc_value)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->cc(delay, cc_number, cc_value); self->cc(delay, cc_number, cc_value);
} }
void sfizz_send_hdcc(sfizz_synth_t* synth, int delay, int cc_number, float norm_value) void sfizz_send_hdcc(sfizz_synth_t* synth, int delay, int cc_number, float norm_value)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->hdcc(delay, cc_number, norm_value); self->hdcc(delay, cc_number, norm_value);
} }
void sfizz_send_pitch_wheel(sfizz_synth_t* synth, int delay, int pitch) void sfizz_send_pitch_wheel(sfizz_synth_t* synth, int delay, int pitch)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->pitchWheel(delay, pitch); self->pitchWheel(delay, pitch);
} }
void sfizz_send_aftertouch(sfizz_synth_t* synth, int delay, char aftertouch) void sfizz_send_aftertouch(sfizz_synth_t* synth, int delay, char aftertouch)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->aftertouch(delay, aftertouch); self->aftertouch(delay, aftertouch);
} }
void sfizz_send_tempo(sfizz_synth_t* synth, int delay, float seconds_per_quarter) void sfizz_send_tempo(sfizz_synth_t* synth, int delay, float seconds_per_quarter)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->tempo(delay, seconds_per_quarter); self->tempo(delay, seconds_per_quarter);
} }
void sfizz_send_time_signature(sfizz_synth_t* synth, int delay, int beats_per_bar, int beat_unit) void sfizz_send_time_signature(sfizz_synth_t* synth, int delay, int beats_per_bar, int beat_unit)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->timeSignature(delay, beats_per_bar, beat_unit); self->timeSignature(delay, beats_per_bar, beat_unit);
} }
void sfizz_send_time_position(sfizz_synth_t* synth, int delay, int bar, float bar_beat) void sfizz_send_time_position(sfizz_synth_t* synth, int delay, int bar, float bar_beat)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->timePosition(delay, bar, bar_beat); self->timePosition(delay, bar, bar_beat);
} }
void sfizz_send_playback_state(sfizz_synth_t* synth, int delay, int playback_state) void sfizz_send_playback_state(sfizz_synth_t* synth, int delay, int playback_state)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->playbackState(delay, playback_state); self->playbackState(delay, playback_state);
} }
void sfizz_render_block(sfizz_synth_t* synth, float** channels, int num_channels, int num_frames) void sfizz_render_block(sfizz_synth_t* synth, float** channels, int num_channels, int num_frames)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
// Only stereo output is supported for now // Only stereo output is supported for now
ASSERT(num_channels == 2); ASSERT(num_channels == 2);
UNUSED(num_channels); UNUSED(num_channels);
@ -187,24 +187,24 @@ void sfizz_render_block(sfizz_synth_t* synth, float** channels, int num_channels
unsigned int sfizz_get_preload_size(sfizz_synth_t* synth) unsigned int sfizz_get_preload_size(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getPreloadSize(); return self->getPreloadSize();
} }
void sfizz_set_preload_size(sfizz_synth_t* synth, unsigned int preload_size) void sfizz_set_preload_size(sfizz_synth_t* synth, unsigned int preload_size)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setPreloadSize(preload_size); self->setPreloadSize(preload_size);
} }
sfizz_oversampling_factor_t sfizz_get_oversampling_factor(sfizz_synth_t* synth) sfizz_oversampling_factor_t sfizz_get_oversampling_factor(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return static_cast<sfizz_oversampling_factor_t>(self->getOversamplingFactor()); return static_cast<sfizz_oversampling_factor_t>(self->getOversamplingFactor());
} }
bool sfizz_set_oversampling_factor(sfizz_synth_t* synth, sfizz_oversampling_factor_t oversampling) bool sfizz_set_oversampling_factor(sfizz_synth_t* synth, sfizz_oversampling_factor_t oversampling)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
using sfz::Oversampling; using sfz::Oversampling;
switch(oversampling) switch(oversampling)
{ {
@ -227,67 +227,67 @@ bool sfizz_set_oversampling_factor(sfizz_synth_t* synth, sfizz_oversampling_fact
int sfizz_get_sample_quality(sfizz_synth_t* synth, sfizz_process_mode_t mode) int sfizz_get_sample_quality(sfizz_synth_t* synth, sfizz_process_mode_t mode)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getSampleQuality(static_cast<sfz::Synth::ProcessMode>(mode)); return self->getSampleQuality(static_cast<sfz::Synth::ProcessMode>(mode));
} }
void sfizz_set_sample_quality(sfizz_synth_t* synth, sfizz_process_mode_t mode, int quality) void sfizz_set_sample_quality(sfizz_synth_t* synth, sfizz_process_mode_t mode, int quality)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->setSampleQuality(static_cast<sfz::Synth::ProcessMode>(mode), quality); return self->setSampleQuality(static_cast<sfz::Synth::ProcessMode>(mode), quality);
} }
void sfizz_set_volume(sfizz_synth_t* synth, float volume) void sfizz_set_volume(sfizz_synth_t* synth, float volume)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setVolume(volume); self->setVolume(volume);
} }
float sfizz_get_volume(sfizz_synth_t* synth) float sfizz_get_volume(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getVolume(); return self->getVolume();
} }
void sfizz_set_num_voices(sfizz_synth_t* synth, int num_voices) void sfizz_set_num_voices(sfizz_synth_t* synth, int num_voices)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->setNumVoices(num_voices); self->setNumVoices(num_voices);
} }
int sfizz_get_num_voices(sfizz_synth_t* synth) int sfizz_get_num_voices(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getNumVoices(); return self->getNumVoices();
} }
int sfizz_get_num_buffers(sfizz_synth_t* synth) int sfizz_get_num_buffers(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getAllocatedBuffers(); return self->getAllocatedBuffers();
} }
int sfizz_get_num_bytes(sfizz_synth_t* synth) int sfizz_get_num_bytes(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getAllocatedBytes(); return self->getAllocatedBytes();
} }
void sfizz_enable_freewheeling(sfizz_synth_t* synth) void sfizz_enable_freewheeling(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->enableFreeWheeling(); self->enableFreeWheeling();
} }
void sfizz_disable_freewheeling(sfizz_synth_t* synth) void sfizz_disable_freewheeling(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->disableFreeWheeling(); self->disableFreeWheeling();
} }
char* sfizz_get_unknown_opcodes(sfizz_synth_t* synth) char* sfizz_get_unknown_opcodes(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
const auto unknownOpcodes = self->getUnknownOpcodes(); const auto unknownOpcodes = self->getUnknownOpcodes();
size_t totalLength = 0; size_t totalLength = 0;
for (auto& opcode: unknownOpcodes) for (auto& opcode: unknownOpcodes)
@ -309,61 +309,61 @@ char* sfizz_get_unknown_opcodes(sfizz_synth_t* synth)
bool sfizz_should_reload_file(sfizz_synth_t* synth) bool sfizz_should_reload_file(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->shouldReloadFile(); return self->shouldReloadFile();
} }
bool sfizz_should_reload_scala(sfizz_synth_t* synth) bool sfizz_should_reload_scala(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->shouldReloadScala(); return self->shouldReloadScala();
} }
void sfizz_enable_logging(sfizz_synth_t* synth) void sfizz_enable_logging(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->enableLogging(); return self->enableLogging();
} }
void sfizz_set_logging_prefix(sfizz_synth_t* synth, const char* prefix) void sfizz_set_logging_prefix(sfizz_synth_t* synth, const char* prefix)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->setLoggingPrefix(prefix); return self->setLoggingPrefix(prefix);
} }
void sfizz_disable_logging(sfizz_synth_t* synth) void sfizz_disable_logging(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->disableLogging(); return self->disableLogging();
} }
void sfizz_all_sound_off(sfizz_synth_t* synth) void sfizz_all_sound_off(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->allSoundOff(); return self->allSoundOff();
} }
void sfizz_add_external_definitions(sfizz_synth_t* synth, const char* id, const char* value) void sfizz_add_external_definitions(sfizz_synth_t* synth, const char* id, const char* value)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->getParser().addExternalDefinition(id, value); self->getParser().addExternalDefinition(id, value);
} }
void sfizz_clear_external_definitions(sfizz_synth_t* synth) void sfizz_clear_external_definitions(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
self->getParser().clearExternalDefinitions(); self->getParser().clearExternalDefinitions();
} }
unsigned int sfizz_get_num_key_labels(sfizz_synth_t* synth) unsigned int sfizz_get_num_key_labels(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getKeyLabels().size(); return self->getKeyLabels().size();
} }
int sfizz_get_key_label_number(sfizz_synth_t* synth, int label_index) int sfizz_get_key_label_number(sfizz_synth_t* synth, int label_index)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
const auto keyLabels = self->getKeyLabels(); const auto keyLabels = self->getKeyLabels();
if (label_index < 0) if (label_index < 0)
return SFIZZ_OUT_OF_BOUNDS_LABEL_INDEX; return SFIZZ_OUT_OF_BOUNDS_LABEL_INDEX;
@ -381,7 +381,7 @@ int sfizz_get_key_label_number(sfizz_synth_t* synth, int label_index)
const char * sfizz_get_key_label_text(sfizz_synth_t* synth, int label_index) const char * sfizz_get_key_label_text(sfizz_synth_t* synth, int label_index)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
const auto keyLabels = self->getKeyLabels(); const auto keyLabels = self->getKeyLabels();
if (label_index < 0) if (label_index < 0)
return NULL; return NULL;
@ -394,13 +394,13 @@ const char * sfizz_get_key_label_text(sfizz_synth_t* synth, int label_index)
unsigned int sfizz_get_num_cc_labels(sfizz_synth_t* synth) unsigned int sfizz_get_num_cc_labels(sfizz_synth_t* synth)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
return self->getCCLabels().size(); return self->getCCLabels().size();
} }
int sfizz_get_cc_label_number(sfizz_synth_t* synth, int label_index) int sfizz_get_cc_label_number(sfizz_synth_t* synth, int label_index)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
const auto ccLabels = self->getCCLabels(); const auto ccLabels = self->getCCLabels();
if (label_index < 0) if (label_index < 0)
return SFIZZ_OUT_OF_BOUNDS_LABEL_INDEX; return SFIZZ_OUT_OF_BOUNDS_LABEL_INDEX;
@ -418,7 +418,7 @@ int sfizz_get_cc_label_number(sfizz_synth_t* synth, int label_index)
const char * sfizz_get_cc_label_text(sfizz_synth_t* synth, int label_index) const char * sfizz_get_cc_label_text(sfizz_synth_t* synth, int label_index)
{ {
auto self = reinterpret_cast<sfz::Synth*>(synth); auto* self = reinterpret_cast<sfz::Synth*>(synth);
const auto ccLabels = self->getCCLabels(); const auto ccLabels = self->getCCLabels();
if (label_index < 0) if (label_index < 0)
return NULL; return NULL;

View file

@ -18,7 +18,7 @@ constexpr unsigned ByteAlignment = TypeAlignment * sizeof(Type);
void gain1AVX(float gain, const float* input, float* output, unsigned size) noexcept void gain1AVX(float gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_AVX #if SFIZZ_HAVE_AVX
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -38,7 +38,7 @@ void gain1AVX(float gain, const float* input, float* output, unsigned size) noex
void gainAVX(const float* gain, const float* input, float* output, unsigned size) noexcept void gainAVX(const float* gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_AVX #if SFIZZ_HAVE_AVX
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);

View file

@ -19,7 +19,7 @@ constexpr unsigned ByteAlignment = TypeAlignment * sizeof(Type);
void readInterleavedSSE(const float* input, float* outputLeft, float* outputRight, unsigned inputSize) noexcept void readInterleavedSSE(const float* input, float* outputLeft, float* outputRight, unsigned inputSize) noexcept
{ {
const auto sentinel = input + inputSize - 1; const auto* sentinel = input + inputSize - 1;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(input + inputSize - TypeAlignment); const auto* lastAligned = prevAligned<ByteAlignment>(input + inputSize - TypeAlignment);
@ -56,7 +56,7 @@ void readInterleavedSSE(const float* input, float* outputLeft, float* outputRigh
void writeInterleavedSSE(const float* inputLeft, const float* inputRight, float* output, unsigned outputSize) noexcept void writeInterleavedSSE(const float* inputLeft, const float* inputRight, float* output, unsigned outputSize) noexcept
{ {
const auto sentinel = output + outputSize - 1; const auto* sentinel = output + outputSize - 1;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(output + outputSize - TypeAlignment); const auto* lastAligned = prevAligned<ByteAlignment>(output + outputSize - TypeAlignment);
@ -84,7 +84,7 @@ void writeInterleavedSSE(const float* inputLeft, const float* inputRight, float*
void gain1SSE(float gain, const float* input, float* output, unsigned size) noexcept void gain1SSE(float gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -104,7 +104,7 @@ void gain1SSE(float gain, const float* input, float* output, unsigned size) noex
void gainSSE(const float* gain, const float* input, float* output, unsigned size) noexcept void gainSSE(const float* gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -123,7 +123,7 @@ void gainSSE(const float* gain, const float* input, float* output, unsigned size
void divideSSE(const float* input, const float* divisor, float* output, unsigned size) noexcept void divideSSE(const float* input, const float* divisor, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -142,7 +142,7 @@ void divideSSE(const float* input, const float* divisor, float* output, unsigned
void multiplyAddSSE(const float* gain, const float* input, float* output, unsigned size) noexcept void multiplyAddSSE(const float* gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -163,7 +163,7 @@ void multiplyAddSSE(const float* gain, const float* input, float* output, unsign
void multiplyAdd1SSE(float gain, const float* input, float* output, unsigned size) noexcept void multiplyAdd1SSE(float gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -185,7 +185,7 @@ void multiplyAdd1SSE(float gain, const float* input, float* output, unsigned siz
void multiplyMulSSE(const float* gain, const float* input, float* output, unsigned size) noexcept void multiplyMulSSE(const float* gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -206,7 +206,7 @@ void multiplyMulSSE(const float* gain, const float* input, float* output, unsign
void multiplyMul1SSE(float gain, const float* input, float* output, unsigned size) noexcept void multiplyMul1SSE(float gain, const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -228,7 +228,7 @@ void multiplyMul1SSE(float gain, const float* input, float* output, unsigned siz
float linearRampSSE(float* output, float start, float step, unsigned size) noexcept float linearRampSSE(float* output, float start, float step, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -257,7 +257,7 @@ float linearRampSSE(float* output, float start, float step, unsigned size) noexc
float multiplicativeRampSSE(float* output, float start, float step, unsigned size) noexcept float multiplicativeRampSSE(float* output, float start, float step, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -286,7 +286,7 @@ float multiplicativeRampSSE(float* output, float start, float step, unsigned siz
void addSSE(const float* input, float* output, unsigned size) noexcept void addSSE(const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -305,7 +305,7 @@ void addSSE(const float* input, float* output, unsigned size) noexcept
void add1SSE(float value, float* output, unsigned size) noexcept void add1SSE(float value, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -325,7 +325,7 @@ void add1SSE(float value, float* output, unsigned size) noexcept
void subtractSSE(const float* input, float* output, unsigned size) noexcept void subtractSSE(const float* input, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -344,7 +344,7 @@ void subtractSSE(const float* input, float* output, unsigned size) noexcept
void subtract1SSE(float value, float* output, unsigned size) noexcept void subtract1SSE(float value, float* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -365,7 +365,7 @@ void subtract1SSE(float value, float* output, unsigned size) noexcept
void copySSE(const float* input, float* output, unsigned size) noexcept void copySSE(const float* input, float* output, unsigned size) noexcept
{ {
// The sentinel is the input here // The sentinel is the input here
const auto sentinel = input + size; const auto* sentinel = input + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -383,7 +383,7 @@ void copySSE(const float* input, float* output, unsigned size) noexcept
float meanSSE(const float* vector, unsigned size) noexcept float meanSSE(const float* vector, unsigned size) noexcept
{ {
const auto sentinel = vector + size; const auto* sentinel = vector + size;
float result { 0.0f }; float result { 0.0f };
if (size == 0) if (size == 0)
@ -415,7 +415,7 @@ float meanSSE(const float* vector, unsigned size) noexcept
float sumSquaresSSE(const float* vector, unsigned size) noexcept float sumSquaresSSE(const float* vector, unsigned size) noexcept
{ {
const auto sentinel = vector + size; const auto* sentinel = vector + size;
float result { 0.0f }; float result { 0.0f };
if (size == 0) if (size == 0)
@ -455,7 +455,7 @@ void cumsumSSE(const float* input, float* output, unsigned size) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = output + size; const auto* sentinel = output + size;
*output++ = *input++; *output++ = *input++;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
@ -488,7 +488,7 @@ void diffSSE(const float* input, float* output, unsigned size) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = output + size; const auto* sentinel = output + size;
*output++ = *input++; *output++ = *input++;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
@ -521,7 +521,7 @@ void clampAllSSE(float* input, float low, float high, unsigned size) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = input + size; const auto* sentinel = input + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);
@ -555,7 +555,7 @@ bool allWithinSSE(const float* input, float low, float high, unsigned size) noex
if (low > high) if (low > high)
std::swap(low, high); std::swap(low, high);
const auto sentinel = input + size; const auto* sentinel = input + size;
#if SFIZZ_HAVE_SSE2 #if SFIZZ_HAVE_SSE2
const auto* lastAligned = prevAligned<ByteAlignment>(sentinel); const auto* lastAligned = prevAligned<ByteAlignment>(sentinel);

View file

@ -10,7 +10,7 @@
template<class T> template<class T>
inline void readInterleavedScalar(const T* input, T* outputLeft, T* outputRight, unsigned inputSize) noexcept inline void readInterleavedScalar(const T* input, T* outputLeft, T* outputRight, unsigned inputSize) noexcept
{ {
const auto sentinel = input + inputSize - 1; const auto* sentinel = input + inputSize - 1;
while (input < sentinel) { while (input < sentinel) {
*outputLeft++ = *input++; *outputLeft++ = *input++;
*outputRight++ = *input++; *outputRight++ = *input++;
@ -20,7 +20,7 @@ inline void readInterleavedScalar(const T* input, T* outputLeft, T* outputRight,
template<class T> template<class T>
inline void writeInterleavedScalar(const T* inputLeft, const T* inputRight, T* output, unsigned outputSize) noexcept inline void writeInterleavedScalar(const T* inputLeft, const T* inputRight, T* output, unsigned outputSize) noexcept
{ {
const auto sentinel = output + outputSize - 1; const auto* sentinel = output + outputSize - 1;
while (output < sentinel) { while (output < sentinel) {
*output++ = *inputLeft++; *output++ = *inputLeft++;
*output++ = *inputRight++; *output++ = *inputRight++;
@ -30,7 +30,7 @@ inline void writeInterleavedScalar(const T* inputLeft, const T* inputRight, T* o
template<class T> template<class T>
inline void gain1Scalar(T gain, const T* input, T* output, unsigned size) noexcept inline void gain1Scalar(T gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ = gain * (*input++); *output++ = gain * (*input++);
} }
@ -38,7 +38,7 @@ inline void gain1Scalar(T gain, const T* input, T* output, unsigned size) noexce
template<class T> template<class T>
inline void gainScalar(const T* gain, const T* input, T* output, unsigned size) noexcept inline void gainScalar(const T* gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ = (*gain++) * (*input++); *output++ = (*gain++) * (*input++);
} }
@ -46,7 +46,7 @@ inline void gainScalar(const T* gain, const T* input, T* output, unsigned size)
template <class T> template <class T>
inline void divideScalar(const T* input, const T* divisor, T* output, unsigned size) noexcept inline void divideScalar(const T* input, const T* divisor, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ = (*input++) / (*divisor++); *output++ = (*input++) / (*divisor++);
} }
@ -54,7 +54,7 @@ inline void divideScalar(const T* input, const T* divisor, T* output, unsigned s
template <class T> template <class T>
inline void multiplyAddScalar(const T* gain, const T* input, T* output, unsigned size) noexcept inline void multiplyAddScalar(const T* gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ += (*gain++) * (*input++); *output++ += (*gain++) * (*input++);
} }
@ -62,7 +62,7 @@ inline void multiplyAddScalar(const T* gain, const T* input, T* output, unsigned
template <class T> template <class T>
inline void multiplyAdd1Scalar(T gain, const T* input, T* output, unsigned size) noexcept inline void multiplyAdd1Scalar(T gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ += gain * (*input++); *output++ += gain * (*input++);
} }
@ -70,7 +70,7 @@ inline void multiplyAdd1Scalar(T gain, const T* input, T* output, unsigned size)
template <class T> template <class T>
inline void multiplyMulScalar(const T* gain, const T* input, T* output, unsigned size) noexcept inline void multiplyMulScalar(const T* gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ *= (*gain++) * (*input++); *output++ *= (*gain++) * (*input++);
} }
@ -78,7 +78,7 @@ inline void multiplyMulScalar(const T* gain, const T* input, T* output, unsigned
template <class T> template <class T>
inline void multiplyMul1Scalar(T gain, const T* input, T* output, unsigned size) noexcept inline void multiplyMul1Scalar(T gain, const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ *= gain * (*input++); *output++ *= gain * (*input++);
} }
@ -86,7 +86,7 @@ inline void multiplyMul1Scalar(T gain, const T* input, T* output, unsigned size)
template <class T> template <class T>
T linearRampScalar(T* output, T start, T step, unsigned size) noexcept T linearRampScalar(T* output, T start, T step, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) { while (output < sentinel) {
*output++ = start; *output++ = start;
start += step; start += step;
@ -97,7 +97,7 @@ T linearRampScalar(T* output, T start, T step, unsigned size) noexcept
template <class T> template <class T>
T multiplicativeRampScalar(T* output, T start, T step, unsigned size) noexcept T multiplicativeRampScalar(T* output, T start, T step, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) { while (output < sentinel) {
*output++ = start; *output++ = start;
start *= step; start *= step;
@ -108,7 +108,7 @@ T multiplicativeRampScalar(T* output, T start, T step, unsigned size) noexcept
template <class T> template <class T>
inline void addScalar(const T* input, T* output, unsigned size) noexcept inline void addScalar(const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ += *input++; *output++ += *input++;
} }
@ -116,7 +116,7 @@ inline void addScalar(const T* input, T* output, unsigned size) noexcept
template <class T> template <class T>
inline void add1Scalar(T value, T* output, unsigned size) noexcept inline void add1Scalar(T value, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ += value; *output++ += value;
} }
@ -124,7 +124,7 @@ inline void add1Scalar(T value, T* output, unsigned size) noexcept
template <class T> template <class T>
inline void subtractScalar(const T* input, T* output, unsigned size) noexcept inline void subtractScalar(const T* input, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ -= *input++; *output++ -= *input++;
} }
@ -132,7 +132,7 @@ inline void subtractScalar(const T* input, T* output, unsigned size) noexcept
template <class T> template <class T>
inline void subtract1Scalar(T value, T* output, unsigned size) noexcept inline void subtract1Scalar(T value, T* output, unsigned size) noexcept
{ {
const auto sentinel = output + size; const auto* sentinel = output + size;
while (output < sentinel) while (output < sentinel)
*output++ -= value; *output++ -= value;
} }
@ -150,7 +150,7 @@ T meanScalar(const T* vector, unsigned size) noexcept
if (size == 0) if (size == 0)
return result; return result;
const auto sentinel = vector + size; const auto* sentinel = vector + size;
while (vector < sentinel) while (vector < sentinel)
result += *vector++; result += *vector++;
@ -164,7 +164,7 @@ T sumSquaresScalar(const T* vector, unsigned size) noexcept
if (size == 0) if (size == 0)
return result; return result;
const auto sentinel = vector + size; const auto* sentinel = vector + size;
while (vector < sentinel) { while (vector < sentinel) {
result += (*vector) * (*vector); result += (*vector) * (*vector);
vector++; vector++;
@ -179,7 +179,7 @@ void cumsumScalar(const T* input, T* output, unsigned size) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = output + size; const auto* sentinel = output + size;
*output++ = *input++; *output++ = *input++;
while (output < sentinel) { while (output < sentinel) {
@ -194,7 +194,7 @@ void diffScalar(const T* input, T* output, unsigned size) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = output + size; const auto* sentinel = output + size;
*output++ = *input++; *output++ = *input++;
while (output < sentinel) { while (output < sentinel) {
@ -209,7 +209,7 @@ void clampAllScalar(T* input, T low, T high, unsigned size ) noexcept
if (size == 0) if (size == 0)
return; return;
const auto sentinel = input + size; const auto* sentinel = input + size;
while (input < sentinel) { while (input < sentinel) {
const float clampedAbove = *input > high ? high : *input; const float clampedAbove = *input > high ? high : *input;
*input = clampedAbove < low ? low : clampedAbove; *input = clampedAbove < low ? low : clampedAbove;
@ -226,7 +226,7 @@ bool allWithinScalar(const T* input, T low, T high, unsigned size ) noexcept
if (low > high) if (low > high)
std::swap(low, high); std::swap(low, high);
const auto sentinel = input + size; const auto* sentinel = input + size;
while (input < sentinel) { while (input < sentinel) {
if (*input < low || *input > high) if (*input < low || *input > high)
return false; return false;