From 1298a82f4fc0723466c1a544e93a76146e62bdef Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 13 Mar 2023 12:20:54 +0100
Subject: [PATCH] pcm/Normalizer: use std::size_t

---
 src/pcm/Normalizer.cxx | 6 +++---
 src/pcm/Normalizer.hxx | 9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/pcm/Normalizer.cxx b/src/pcm/Normalizer.cxx
index a251d95dc..866c11d49 100644
--- a/src/pcm/Normalizer.cxx
+++ b/src/pcm/Normalizer.cxx
@@ -5,17 +5,17 @@
 #include "Normalizer.hxx"
 
 void
-PcmNormalizer::ProcessS16(int16_t *audio, unsigned int count) noexcept
+PcmNormalizer::ProcessS16(int16_t *audio, std::size_t count) noexcept
 {
 	int16_t *ap;
-	unsigned int i;
+	std::size_t i;
         int curGain = gain[pos];
         int newGain;
         int peakVal = 1;
         int peakPos = 0;
         int slot = (pos + 1) % bufsz;
         int *clipped_ = clipped + slot;
-        unsigned int ramp = count;
+        std::size_t ramp = count;
         int delta;
 
 	ap = audio;
diff --git a/src/pcm/Normalizer.hxx b/src/pcm/Normalizer.hxx
index a18f0fabd..2191809f3 100644
--- a/src/pcm/Normalizer.hxx
+++ b/src/pcm/Normalizer.hxx
@@ -4,6 +4,7 @@
 
 #pragma once
 
+#include <cstddef>
 #include <cstdint>
 
 class PcmNormalizer {
@@ -25,11 +26,11 @@ class PcmNormalizer {
         //! History of clip amounts
         int *const clipped;
 
-        unsigned int pos = 0;
-        const unsigned int bufsz;
+	std::size_t pos = 0;
+        const std::size_t bufsz;
 
 public:
-	PcmNormalizer(unsigned history=400) noexcept
+	PcmNormalizer(std::size_t history=400) noexcept
 		:peaks(new int[history]{}),
 		 gain(new int[history]{}),
 		 clipped(new int[history]{}),
@@ -44,7 +45,7 @@ public:
 	}
 
 	//! Process 16-bit signed data
-	void ProcessS16(int16_t *data, unsigned int count) noexcept;
+	void ProcessS16(int16_t *data, std::size_t count) noexcept;
 };
 
 //! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed