From 890f59d056b89f35239f2b530a0da92f2e9ad8a2 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 16 Nov 2023 03:16:41 -0800 Subject: [PATCH] Fix fix on 1991/buzzard The parameter type of q in function z() should be a 'char *', not a 'char **'. Added to CSILENCE -Wno-implicit-int. Note that if including files for abs(3), strlen(3) or other functions implicitly declared the program will not work (or at least it won't work if at least one of them is #included?). --- 1991/buzzard/Makefile | 6 +++++- 1991/buzzard/README.md | 8 +++++--- 1991/buzzard/buzzard.alt.c | 2 +- 1991/buzzard/buzzard.c | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/1991/buzzard/Makefile b/1991/buzzard/Makefile index ccb1632c6..45bffa1ea 100644 --- a/1991/buzzard/Makefile +++ b/1991/buzzard/Makefile @@ -41,7 +41,7 @@ include ../../var.mk CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration \ -Wno-int-conversion -Wno-logical-op-parentheses -Wno-pedantic \ -Wno-return-type -Wno-unknown-escape-sequence -Wno-unused-value \ - -Wno-deprecated-non-prototype + -Wno-deprecated-non-prototype -Wno-implicit-int # Common C compiler warning flags # @@ -140,6 +140,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + + # data files # data: ${DATA} diff --git a/1991/buzzard/README.md b/1991/buzzard/README.md index dd569da1c..717fd60b1 100644 --- a/1991/buzzard/README.md +++ b/1991/buzzard/README.md @@ -28,9 +28,11 @@ bugs.md](/bugs.md#1991-buzzard). ## Alternate code: -This version changes the keys `f` for forward, `l` for left and `r` for right to -`k` for forward, `l` for right and `h` for left, which is more natural for those -who use vi(m). Also one can just hit `q` followed by enter to quit the maze. +This version changes the keys `f` for forward, `l` for left and `r` for right by +default to `k` for forward, `l` for right and `h` for left, which is more +natural for those who use vi(m). Also one can just hit `q` followed by enter to +quit the maze. It is problematic to reconfigure the keys except by modifying the +code directly so the keys are not made a `-D` at the compiler. ### Alternate build: diff --git a/1991/buzzard/buzzard.alt.c b/1991/buzzard/buzzard.alt.c index f7a274844..929746a6d 100644 --- a/1991/buzzard/buzzard.alt.c +++ b/1991/buzzard/buzzard.alt.c @@ -1,7 +1,7 @@ #include #define X(s) (!(s&3)-((s&3)==2)) #define W while -char Z[82][82],A,B,f,g=26;z(q)char**q;{return atoi(q);}m(d,l){return +char Z[82][82],A,B,f,g=26;z(q)char*q;{return atoi(q);}m(d,l){return Z[ B + X ( f + 3) * d+l *X(f+ 2 )][ A+X ( f ) * d + l* X ( f + 3 ) ] ;}int diff --git a/1991/buzzard/buzzard.c b/1991/buzzard/buzzard.c index c2b28a2d6..1c7c24cf6 100644 --- a/1991/buzzard/buzzard.c +++ b/1991/buzzard/buzzard.c @@ -1,7 +1,7 @@ #include #define X(s) (!(s&3)-((s&3)==2)) #define W while -char Z[82][82],A,B,f,g=26;z(q)char**q;{return atoi(q);}m(d,l){return +char Z[82][82],A,B,f,g=26;z(q)char*q;{return atoi(q);}m(d,l){return Z[ B + X ( f + 3) * d+l *X(f+ 2 )][ A+X ( f ) * d + l* X ( f + 3 ) ] ;}int