From f2bc1d4185dfebedaff2e569a6d4f9d12ef903b7 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Thu, 9 Apr 2026 17:26:50 +0000 Subject: [PATCH] lint: fix reserved identifier in function parameter names and comments bugprone-reserved-identifier fixes: - gen_utils.h: rename __size parameter to 'sz' in PtrArray and PtrSizeArray constructors (parameter names starting with __ are reserved) - prometheus_helpers.h: update documentation comments to reference '::SIZE_' instead of '::__size' to match the actual enum values --- include/gen_utils.h | 10 +++++----- include/prometheus_helpers.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/gen_utils.h b/include/gen_utils.h index ddb7ac0b9..7d10de242 100644 --- a/include/gen_utils.h +++ b/include/gen_utils.h @@ -153,14 +153,14 @@ class PtrArray { unsigned int len; unsigned int size; void **pdata; - PtrArray(unsigned int __size=0) { + PtrArray(unsigned int sz=0) { len=0; pdata=NULL; size=0; - if (__size) { - expand(__size); + if (sz) { + expand(sz); } - size=__size; + size=sz; } ~PtrArray() { if (pdata) ( free(pdata) ); @@ -240,7 +240,7 @@ class PtrSizeArray { unsigned int len; unsigned int size; PtrSize_t *pdata; - PtrSizeArray(unsigned int __size=0); + PtrSizeArray(unsigned int sz=0); ~PtrSizeArray(); void add(void *p, unsigned int s) { diff --git a/include/prometheus_helpers.h b/include/prometheus_helpers.h index eda062488..ab9a6114e 100644 --- a/include/prometheus_helpers.h +++ b/include/prometheus_helpers.h @@ -19,7 +19,7 @@ using prometheus::Gauge; * @tparam map_idx_enum The enum holding the types of elements contained in the 'metrics_map' argument. * This enum must contain an element '::counters'. * @tparam counters_enum The counters enum, holding all the identifiers of the metrics - * to be initialized in the 'counter_array' argument. It must contains a '::__size' element. + * to be initialized in the 'counter_array' argument. It must contains a '::SIZE_' element. * @tparam metrics_map The type of the metrics map, it should be a 'tuple' holding the following elements: * { * int: metric_identifier, @@ -77,7 +77,7 @@ void init_prometheus_counter_array( * @tparam map_idx_enum The enum holding the types of elements contained in the 'metrics_map' argument. * This enum must contain an element '::gauges'. * @tparam gauges_enum The counters enum, holding all the identifiers of the metrics - * to be initialized in the 'gauge_array' argument. It must contains a '::__size' element. + * to be initialized in the 'gauge_array' argument. It must contains a '::SIZE_' element. * @tparam metrics_map The type of the metrics map, it should be a 'tuple' holding the following elements: * { * int: metric_identifier, @@ -135,7 +135,7 @@ void init_prometheus_gauge_array( * @tparam map_idx_enum The enum holding the types of elements contained in the 'metrics_map' argument. * This enum must contain an element '::dyn_counters'. * @tparam dyn_counter_enum The counters enum, holding all the identifiers of the metrics - * to be initialized in the 'dyn_counter_array' argument. It must contains a '::__size' element. + * to be initialized in the 'dyn_counter_array' argument. It must contains a '::SIZE_' element. * @tparam metrics_map The type of the metrics map, it should be a 'tuple' holding the following elements: * { * int: metric_identifier, @@ -191,7 +191,7 @@ void init_prometheus_dyn_counter_array( * @tparam map_idx_enum The enum holding the types of elements contained in the 'metrics_map' argument. * This enum must contain an element '::dyn_gauges'. * @tparam dyn_gauge_enum The 'dyn_gauges' enum, holding all the identifiers of the metrics - * to be initialized in the 'dyn_gauge_array' argument. It must contains a '::__size' element. + * to be initialized in the 'dyn_gauge_array' argument. It must contains a '::SIZE_' element. * @tparam metrics_map The type of the metrics map, it should be a 'tuple' holding the following elements: * { * int: metric_identifier,