[PATCH v1 21/48] perf demangle: Silence -Wshorten-64-to-32 warnings

Ian Rogers
2025-04-01T18:25:19Z

tools/perf/util/demangle-java.c | 4 ++--
tools/perf/util/demangle-ocaml.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c
index ddf33d58bcd3..ee20f4d08765 100644
--- a/tools/perf/util/demangle-java.c
+++ b/tools/perf/util/demangle-java.c
@@ -42,9 +42,9 @@ static const char *base_types['Z' - 'A' + 1] = {
* error : NULL
*/
static char *
-__demangle_java_sym(const char *str, const char *end, char *buf, int maxlen, int mode)
+__demangle_java_sym(const char *str, const char *end, char *buf, size_t maxlen, int mode)
{
- int rlen = 0;
+ size_t rlen = 0;
int array = 0;
int narg = 0;
const char *q;
diff --git a/tools/perf/util/demangle-ocaml.c b/tools/perf/util/demangle-ocaml.c
index 9d707bb60b4b..25fe755df5ab 100644
--- a/tools/perf/util/demangle-ocaml.c
+++ b/tools/perf/util/demangle-ocaml.c
@@ -30,8 +30,7 @@ ocaml_demangle_sym(const char *sym)
{
char *result;
int j = 0;
- int i;
- int len;
+ size_t i, len;

if (!ocaml_is_mangled(sym)) {
return NULL;
--
2.49.0.504.g3bcea36a83-goog