diff --git a/1991/fine/Makefile b/1991/fine/Makefile index 16c4a2602..824f491c1 100644 --- a/1991/fine/Makefile +++ b/1991/fine/Makefile @@ -59,7 +59,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -D'main(a,b)'='int main(a,b)char**b;' +CDEFINE= -D'main(a,b)'='int main(a,b)char**b;' -DB='(int)b' # Include files that are needed to compile # diff --git a/1991/fine/README.md b/1991/fine/README.md index ff808b861..eff0752fc 100644 --- a/1991/fine/README.md +++ b/1991/fine/README.md @@ -33,8 +33,8 @@ This filter, 80 chars plus a newline, fits into a single line on most terminals (unless your terminal has a line wrap mis-feature :-)). Note in 2023: fixing this entry to work with modern systems increased the size, -originally to 106 characters but dropped down to 85 with clever use of the -Makefile and removal of a cast that was not strictly necessary. +originally to 106 characters but it was dropped back down to 80 with clever use +of the Makefile. This entry is likely one of the smallest C implementations of this filter, excluding programs that resort to command line or include diff --git a/1991/fine/fine.c b/1991/fine/fine.c index 5209bdb35..cf555e934 100644 --- a/1991/fine/fine.c +++ b/1991/fine/fine.c @@ -1 +1 @@ -main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|((int)b+12)%26+1:a);} +main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&B<27?a&96|(B+12)%26+1:a);} diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index ec40f530c..17e78bfd0 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1233,12 +1233,19 @@ entry was fixed. It has not been done in all. ## [1991/fine](1991/fine/fine.c) ([README.md](1991/fine/README.md)) Cody made it look much more like the original entry even after the fix that -increased the count in characters from 80 to 106, getting it back down to just 85. +increased the count in characters from 80 to 106, getting it back down to just +85 (and later back down to 80, see below). + This was done by redefining `main` at the compiler line so that it looks like the original where one didn't have to worry about the type of args of main() and there were other fewer restrictions and also by removing a cast that was not strictly necessary (this does create a new warning: `ordered comparison -between pointer and integer ('char **' and 'int')` but it works just fine). +between pointer and integer ('char **' and 'int')` but it works just `fine`). + +That was `fine` as well but Cody decided to drop it back down to its original 80 +which also resolved the warning described above. This was by more clever use of +the Makefile which now has a `-DB=(int)b` so that `B` can be used in place where +`(int)b` used to be necessary. Cody also added the [try.sh](1991/fine/try.sh) script which feeds the program some fun input for fun but mostly different output. He added a great string from