summaryrefslogtreecommitdiffstats
path: root/misc/pinfo
diff options
context:
space:
mode:
author Matteo Bernardini <ponce@slackbuilds.org>2022-02-03 17:10:22 +0100
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2022-02-04 17:53:37 +0700
commit4eca7874327f6ab3e65c6f4175b45d6e363a6a4d (patch)
treed1c1c9049dbb7c38864d742daec4eebaf4b573e2 /misc/pinfo
parentd5f236fa91808b2ac724693baefe74c93b02e87f (diff)
downloadslackbuilds-4eca7874327f6ab3e65c6f4175b45d6e363a6a4d.tar.gz
slackbuilds-4eca7874327f6ab3e65c6f4175b45d6e363a6a4d.tar.xz
misc/pinfo: Fix building with the newer ncurses.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc/pinfo')
-rw-r--r--misc/pinfo/ncurses-6.3.diff32
-rw-r--r--misc/pinfo/pinfo.SlackBuild1
2 files changed, 33 insertions, 0 deletions
diff --git a/misc/pinfo/ncurses-6.3.diff b/misc/pinfo/ncurses-6.3.diff
new file mode 100644
index 0000000000..82cf176794
--- /dev/null
+++ b/misc/pinfo/ncurses-6.3.diff
@@ -0,0 +1,32 @@
+From ab604fdb67296dad27f3a25f3c9aabdd2fb8c3fa Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Thu, 11 Nov 2021 19:02:24 +0000
+Subject: [PATCH] src/video.c: use %ld to print longs
+
+ncurses-6.3 added printf()-stype attribute annotations for gcc-like
+compilers that can now detect argument mismatches:
+
+ video.c:114:26: error: format '%d' expects argument of type 'int',
+ but argument 3 has type 'long unsigned int' [-Werror=format=]
+ 114 | printw(_("Viewing line %d/%d, 100%%"), lines, lines);
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
+---
+ src/video.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/video.c b/src/video.c
+index f6b444a..195d781 100644
+--- a/src/video.c
++++ b/src/video.c
+@@ -109,9 +109,9 @@ showscreen(char **message, unsigned long lines, unsigned long pos, long cursor,
+ mymvhline(maxy - 1, 0, ' ', maxx);
+ move(maxy - 1, 0);
+ if ((pos < lines - 1) &&(lines > pos + maxy - 2))
+- printw(_("Viewing line %d/%d, %d%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines);
++ printw(_("Viewing line %ld/%ld, %ld%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines);
+ else
+- printw(_("Viewing line %d/%d, 100%%"), lines, lines);
++ printw(_("Viewing line %ld/%ld, 100%%"), lines, lines);
+ info_add_highlights(pos, cursor, lines, column, message);
+ attrset(normal);
+ move(0, 0);
diff --git a/misc/pinfo/pinfo.SlackBuild b/misc/pinfo/pinfo.SlackBuild
index 5c640b1222..2c60b8136d 100644
--- a/misc/pinfo/pinfo.SlackBuild
+++ b/misc/pinfo/pinfo.SlackBuild
@@ -87,6 +87,7 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
patch -p1 < $CWD/gcc10-stringop.diff
+patch -p1 < $CWD/ncurses-6.3.diff
[ -e configure ] || sh autogen.sh