ncurses-6.3.diff 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. From ab604fdb67296dad27f3a25f3c9aabdd2fb8c3fa Mon Sep 17 00:00:00 2001
  2. From: Sergei Trofimovich <slyich@gmail.com>
  3. Date: Thu, 11 Nov 2021 19:02:24 +0000
  4. Subject: [PATCH] src/video.c: use %ld to print longs
  5. ncurses-6.3 added printf()-stype attribute annotations for gcc-like
  6. compilers that can now detect argument mismatches:
  7. video.c:114:26: error: format '%d' expects argument of type 'int',
  8. but argument 3 has type 'long unsigned int' [-Werror=format=]
  9. 114 | printw(_("Viewing line %d/%d, 100%%"), lines, lines);
  10. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. ---
  12. src/video.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. diff --git a/src/video.c b/src/video.c
  15. index f6b444a..195d781 100644
  16. --- a/src/video.c
  17. +++ b/src/video.c
  18. @@ -109,9 +109,9 @@ showscreen(char **message, unsigned long lines, unsigned long pos, long cursor,
  19. mymvhline(maxy - 1, 0, ' ', maxx);
  20. move(maxy - 1, 0);
  21. if ((pos < lines - 1) &&(lines > pos + maxy - 2))
  22. - printw(_("Viewing line %d/%d, %d%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines);
  23. + printw(_("Viewing line %ld/%ld, %ld%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines);
  24. else
  25. - printw(_("Viewing line %d/%d, 100%%"), lines, lines);
  26. + printw(_("Viewing line %ld/%ld, 100%%"), lines, lines);
  27. info_add_highlights(pos, cursor, lines, column, message);
  28. attrset(normal);
  29. move(0, 0);