system/a2tools: Fix compile warnings.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-06-01 02:38:02 -04:00 committed by Willy Sudiarto Raharjo
parent 9de00470fa
commit 4e158b736b
No known key found for this signature in database
GPG key ID: 3F617144D7238786
2 changed files with 34 additions and 12 deletions

View file

@ -6,11 +6,13 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20230601 bkw: BUILD=2, fix compiler warnings.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=a2tools
VERSION=${VERSION:-003}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -33,16 +35,12 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
@ -51,16 +49,18 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
unzip $CWD/$PRGNAM-v$VERSION.zip
unzip $CWD/$PRGNAM-v$VERSION.zip -x '*.exe' '*.dos' '*.csh'
cd $PRGNAM
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
chmod 644 *
# 20230531 bkw: fix a couple of (probably harmless) compiler warnings.
patch -p1 < $CWD/fix_warnings.diff
# It doesn't come with a Makefile, it comes with a csh script. Don't
# use it...
gcc $SLKCFLAGS -DUNIX -Wall -o $PRGNAM $PRGNAM.c
${CC:-gcc} $SLKCFLAGS -DUNIX -Wall -o $PRGNAM $PRGNAM.c
mkdir -p $PKG/usr/bin $PKG/usr/man/man6
install -s -m0755 $PRGNAM $PKG/usr/bin
gzip -9c < $PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
@ -70,9 +70,10 @@ for link in a2ls a2in a2out a2rm; do
ln -s $PRGNAM.6.gz $PKG/usr/man/man6/$link.6.gz
done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a LICENSE README $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

View file

@ -0,0 +1,21 @@
diff -Naur a2tools/a2tools.c a2tools.patched/a2tools.c
--- a2tools/a2tools.c 2001-04-10 00:18:01.000000000 -0400
+++ a2tools.patched/a2tools.c 2023-05-31 23:25:37.538490402 -0400
@@ -541,7 +541,7 @@
void a2out (void) {
unsigned char listbuffer[256];
unsigned int hop, next_trk, next_sec, i, j;
- void (*postproc_function)(void);
+ void (*postproc_function)(void) = NULL;
if (!dir_do(dir_find_name)) quit(6,"File not found.\n");
hop = begun = 0;
next_trk=dir_entry_data[0];
@@ -817,7 +817,7 @@
/* prepare source filename by padding blanks */
i=0;
- while(i<30 && a2_name[i]) padded_name[i]=a2_name[i++] & 0x7f;
+ while(i<30 && a2_name[i]) { padded_name[i]=a2_name[i] & 0x7f; i++; }
while(i<30) padded_name[i++]=' ';
/* get VTOC and check validity */