From fe15975a2113569a44cb9ff0e2eaf1f689668166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 28 Apr 2020 10:48:45 +0200 Subject: [PATCH] BPMDetect: Make conversion from size_t to int explicit Fixes warning C4267 on MSVC. This assumes that `beats.size()` should never overflow `int` - if that could happen, the API should likely be changed to handle it gracefully. --- source/SoundTouch/BPMDetect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/SoundTouch/BPMDetect.cpp b/source/SoundTouch/BPMDetect.cpp index 5ad1926..72a9498 100644 --- a/source/SoundTouch/BPMDetect.cpp +++ b/source/SoundTouch/BPMDetect.cpp @@ -561,7 +561,7 @@ float BPMDetect::getBpm() /// \return number of beats in the arrays. int BPMDetect::getBeats(float *pos, float *values, int max_num) { - int num = beats.size(); + int num = (int)beats.size(); if ((!pos) || (!values)) return num; // pos or values NULL, return just size for (int i = 0; (i < num) && (i < max_num); i++)