From 413584f0fb06f189bd51eaba17d935ee560ac3a8 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Thu, 9 Apr 2026 15:15:52 +0000 Subject: [PATCH] lint: fix unsigned-to-signed cast in MySrvConnList::find_idx Use static_cast instead of C-style cast for clarity and to avoid unsigned->signed narrowing warnings while preserving the -1 sentinel. --- include/MySQL_HostGroups_Manager.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/MySQL_HostGroups_Manager.h b/include/MySQL_HostGroups_Manager.h index 0ba8c6cf8..3fc8233af 100644 --- a/include/MySQL_HostGroups_Manager.h +++ b/include/MySQL_HostGroups_Manager.h @@ -180,7 +180,10 @@ class MySrvConnList { MySQL_Connection *conn = NULL; conn = (MySQL_Connection *)conns->index(i); if (conn==c) { - return (unsigned int)i; + // 'find_idx' returns an int; cast the unsigned loop index to int + // to avoid unsigned->signed narrowing warnings and keep the + // sentinel return value of -1 for "not found". + return static_cast(i); } } return -1;