[PATCH v1 40/48] perf list: Silence -Wshorten-64-to-32 warnings

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

tools/perf/builtin-list.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index fed482adb039..ffe2e972e3f2 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -93,7 +93,7 @@ static void wordwrap(FILE *fp, const char *s, int start, int max, int corr)
bool comma = false;

while (*s) {
- int wlen = strcspn(s, " ,\t\n");
+ int wlen = (int)strcspn(s, " ,\t\n");
const char *sep = comma ? "," : " ";

if ((column + wlen >= max && column > start) || saw_newline) {
@@ -171,7 +171,7 @@ static void default_print_event(void *ps, const char *topic, const char *pmu_nam
int desc_len = -1;

if (pmu_name && strcmp(pmu_name, "default_core")) {
- desc_len = strlen(desc);
+ desc_len = (int)strlen(desc);
desc_len = asprintf(&desc_with_unit,
desc_len > 0 && desc[desc_len - 1] != '.'
? "%s. Unit: %s" : "%s Unit: %s",
--
2.49.0.504.g3bcea36a83-goog