From a459db9bf692e11c2d4ecb6047c2878cdcbeb2bd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Sep 2022 13:20:41 -0400 Subject: Use uppercase integer literal suffixes --- plugins/.clang-tidy | 6 +++++- plugins/eg-sampler.lv2/peaks.h | 4 ++-- plugins/eg-sampler.lv2/sampler.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy index b1adcb3..bff0bfd 100644 --- a/plugins/.clang-tidy +++ b/plugins/.clang-tidy @@ -5,7 +5,6 @@ Checks: > *, -*-magic-numbers, -*-narrowing-conversions, - -*-uppercase-literal-suffix, -altera-*, -bugprone-easily-swappable-parameters, -bugprone-macro-parentheses, @@ -20,3 +19,8 @@ Checks: > WarningsAsErrors: '*' HeaderFilterRegex: '.*' FormatStyle: file +CheckOptions: + - key: hicpp-uppercase-literal-suffix.NewSuffixes + value: L;U;f + - key: readability-uppercase-literal-suffix.NewSuffixes + value: L;U;f diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h index 7e0997e..47d6616 100644 --- a/plugins/eg-sampler.lv2/peaks.h +++ b/plugins/eg-sampler.lv2/peaks.h @@ -152,11 +152,11 @@ peaks_sender_send(PeaksSender* sender, forge, &vec_frame, sizeof(float), uris->atom_Float); // Calculate how many peaks to send this update - const uint32_t chunk_size = MAX(1u, sender->n_samples / sender->n_peaks); + const uint32_t chunk_size = MAX(1U, sender->n_samples / sender->n_peaks); const uint32_t space = forge->size - forge->offset; const uint32_t remaining = sender->n_peaks - sender->current_offset; const uint32_t n_update = - MIN(remaining, MIN(n_frames / 4u, space / sizeof(float))); + MIN(remaining, MIN(n_frames / 4U, space / sizeof(float))); // Calculate peak (maximum magnitude) for each chunk for (uint32_t i = 0; i < n_update; ++i) { diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 9ec3cf4..d870a07 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -134,7 +134,7 @@ load_sample(LV2_Log_Logger* logger, const char* path, const int sample_rate) return NULL; } - sf_seek(sndfile, 0ul, SEEK_SET); + sf_seek(sndfile, 0UL, SEEK_SET); sf_read_float(sndfile, data, info->frames * info->channels); sf_close(sndfile); -- cgit v1.2.1