diff --git a/2001/coupard/Makefile b/2001/coupard/Makefile index fb4155958..1ae233869 100644 --- a/2001/coupard/Makefile +++ b/2001/coupard/Makefile @@ -38,7 +38,7 @@ include ../../var.mk # Common C compiler warnings to silence # -CSILENCE= -Wno-empty-body -Wno-pointer-sign -Wno-return-type -Wno-deprecated-non-prototype +CSILENCE= -Wno-empty-body -Wno-pointer-sign -Wno-return-type -Wno-deprecated-non-prototype -Wno-implicit-int # Common C compiler warning flags # @@ -124,8 +124,7 @@ ALT_TARGET= all: data ${TARGET} @${TRUE} -.PHONY: all alt data everything diff_orig_prog diff_prog_orig \ - diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig \ +.PHONY: all alt data everything orig_prog_diff alt_prog_diff \ clean clobber install love haste waste maker easter_egg \ sandwich supernova deep_magic magic charon pluto @@ -147,47 +146,18 @@ data: ${DATA} everything: all alt @${TRUE} - -##################### -# make a difference # -##################### -# # diff orig source and source # -diff_orig_prog: ${PROG}.orig.c ${PROG}.c +orig_prog_diff: ${PROG}.orig.c ${PROG}.c @-${DIFF} -u ${PROG}.orig.c ${PROG}.c -# diff source and orig source -# -diff_prog_orig: ${PROG}.c ${PROG}.orig.c - @-${DIFF} -u ${PROG}.c ${PROG}.orig.c - # diff alt source and source # -diff_alt_prog: ${PROG}.c +alt_prog_diff: ${PROG}.c @-if [[ -e ${PROG}.alt.c ]]; then \ ${DIFF} -u ${PROG}.alt.c ${PROG}.c; \ fi -# diff source and alt source -# -diff_prog_alt: ${PROG}.c - @-if [[ -e ${PROG}.alt.c ]]; then \ - ${DIFF} -u ${PROG}.c ${PROG}.alt.c; \ - fi - -# diff orig and alt -# -diff_orig_alt: ${PROG}.orig.c - @-if [[ -e ${PROG}.alt.c ]]; then \ - ${DIFF} -u ${PROG}.orig.c ${PROG}.alt.c; \ - fi - -diff_alt_orig: - @-if [[ -e ${PROG}.alt.c ]]; then \ - ${DIFF} -u ${PROG}.alt.c ${PROG}.orig.c; \ - fi - ############### # utility rules diff --git a/2001/coupard/coupard.c b/2001/coupard/coupard.c index 558e41be4..b5cf042b3 100644 --- a/2001/coupard/coupard.c +++ b/2001/coupard/coupard.c @@ -28,7 +28,7 @@ $",p[6789]; int o[]={145,1145,1745,2545,3045,4045,4345,5145,5745,6369},i=0,j=0,l=0; -void e(int n,int h){ +void e(n,h){ for(j=0;n>0;n-=!(p[j++]^9)); for(;!n&&j[p]^9;j++)write(1,p+p[j][o],o[p[j]+1]-p[j][o]); for(i=0;i` for `mmap()` and `munmap()`. - have `main()` call another function which is no longer a recursive function; @@ -1530,9 +1553,15 @@ Finally to see from start to finish: git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c ``` +or to not use `git`: + +```sh +make diff_orig_prog +``` + Cody also added a [program](anonymous.bed.c) like [anonymous.ten.c](anonymous.ten.c) [Ten Green Bottles](https://en.wikipedia.org/wiki/Ten_Green_Bottles) but which -sings [Ten in the Bed](https://allnurseryrhymes.com/ten-in-the-bed/). +sings [Ten in the Bed](https://allnurseryrhymes.com/ten-in-the-bed/) instead. As well he added the [try.me.sh](2001/anonymous/try.me.sh) so that one can attempt to use the program as it was designed but if compiling as 32-bit fails @@ -1607,19 +1636,19 @@ void e(n,h){ ``` -One fix would be to disable that warning. Another one might be to change the C -standard. The one that was done, to make it more portable, was to just add 'int' -to the function parameters. +The easiest fix is to just disable the warning which is what was done. +Originally the code was changed to use `int` but to make it more like the +original this was undone. -Thanks go to Yusuke for providing a proper command line for macOS (to do with -sound; see his [/2013/endoh3/README.md](2013/endoh3/README.md) entry where he -also refers to sound devices in macOS). +Yusuke for providing a proper command line for macOS (to do with sound; see his +[/2013/endoh3/README.md](2013/endoh3/README.md) entry where he also refers to +sound devices in macOS). ## [2001/ctk](2001/ctk/ctk.c) ([README.md](2001/ctk/README.md])) The ANSI escape codes were no longer valid but Yusuke provided a patch to fix -the ANSI escape codes. This works with macOS as well. +the ANSI escape codes. Cody tested this for macOS and it works fine. ## [2001/dgbeards](2001/dgbeards/dgbeards.c) ([README.md](2001/dgbeards/README.md]))