Support clang-tidy (#1034)
This commit is contained in:
@@ -20,7 +20,7 @@ CircularBuffer::CircularBuffer(int32_t capacity) {
|
||||
}
|
||||
|
||||
void CircularBuffer::Resize(int32_t new_capacity) {
|
||||
int32_t capacity = buffer_.size();
|
||||
int32_t capacity = static_cast<int32_t>(buffer_.size());
|
||||
if (new_capacity <= capacity) {
|
||||
SHERPA_ONNX_LOGE("new_capacity (%d) <= original capacity (%d). Skip it.",
|
||||
new_capacity, capacity);
|
||||
@@ -86,7 +86,7 @@ void CircularBuffer::Resize(int32_t new_capacity) {
|
||||
}
|
||||
|
||||
void CircularBuffer::Push(const float *p, int32_t n) {
|
||||
int32_t capacity = buffer_.size();
|
||||
int32_t capacity = static_cast<int32_t>(buffer_.size());
|
||||
int32_t size = Size();
|
||||
if (n + size > capacity) {
|
||||
int32_t new_capacity = std::max(capacity * 2, n + size);
|
||||
@@ -126,7 +126,7 @@ std::vector<float> CircularBuffer::Get(int32_t start_index, int32_t n) const {
|
||||
return {};
|
||||
}
|
||||
|
||||
int32_t capacity = buffer_.size();
|
||||
int32_t capacity = static_cast<int32_t>(buffer_.size());
|
||||
|
||||
if (start_index - head_ + n > size) {
|
||||
SHERPA_ONNX_LOGE("Invalid start_index: %d and n: %d. head_: %d, size: %d",
|
||||
|
||||
Reference in New Issue
Block a user