From aa1427f18e9b1b183e5e08512ad3a4f338ed00c5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:13:59 -0800 Subject: [PATCH] Minor fixes in 1998/dlowe The program (both main and alt versions) had main()'s return type as void. To make it more portable, like another entry (that I was asked to make this same change), I changed it to int. --- 1998/dlowe/dlowe.alt.c | 4 ++-- 1998/dlowe/dlowe.c | 4 ++-- thanks-for-fixes.md | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/1998/dlowe/dlowe.alt.c b/1998/dlowe/dlowe.alt.c index efe783ab2..06d351cb0 100644 --- a/1998/dlowe/dlowe.alt.c +++ b/1998/dlowe/dlowe.alt.c @@ -2,7 +2,7 @@ #define PO(o,t)\ (((o>64)&&(o<91))?(((t>96)&&(t<123))?(t-32):(t)):(((t>64)&&(t<91))?(t+32):(t))) - void main() { char *poo="poot", + int main() { char *poo="poot", *Poo="pootpoot" ,O[9],o;int t, T;(t=0)|| (*O='\0');while( (o= getc( stdin ))!=( EOF))if (((o> 64)&& (o< 91)) ||(( o>96 )&&(o <123 ))) ( @@ -14,5 +14,5 @@ ("%c", PO(*(O +T),*( poo+T) -) ); printf( "%c", o ) ; } else printf("%s%c", O, o); ( t =0) || (*O='\0'); } } +) ); printf( "%c", o ) ; } else printf("%s%c", O, o); ( t =0) || (*O='\0'); } return 0;} diff --git a/1998/dlowe/dlowe.c b/1998/dlowe/dlowe.c index 5466711fb..9e9d29108 100644 --- a/1998/dlowe/dlowe.c +++ b/1998/dlowe/dlowe.c @@ -2,7 +2,7 @@ #define PO(o,t)\ (((o>64)&&(o<91))?(((t>96)&&(t<123))?(t-32):(t)):(((t>64)&&(t<91))?(t+32):(t))) - void main() { char *poo= "poot", + int main() { char *poo= "poot", *Poo="pootpoot" ,O[9];int o,t,T,p;(t=p =0)||(*O='\0');while ((o= getc( stdin ))!=( EOF))if ((p== 0)&& (((o>64 )&& ( o<91 )) || ((o> 96 ) &&(o< 123) ))) ( @@ -15,4 +15,4 @@ +T),*( poo+T) ) ) ; printf( "%c" , o ) ; } else printf ( "%s%c" , O , o ) ; ( t = 0 ) || ( -* O = '\0' ) ; ( o == 60 ) && ( ++p ) ; ( o == 62 ) && (p!=0) && ( --p ) ; } } +* O = '\0' ) ; ( o == 60 ) && ( ++p ) ; ( o == 62 ) && (p!=0) && ( --p ) ; } return 0;} diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 1b4438249..d48f0025b 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2061,6 +2061,9 @@ done in modern systems) to be `_int`. ## [1998/dlowe](1998/dlowe/dlowe.c) ([README.md](1998/dlowe/README.md])) +Cody made the program more portable by changing the void return type of `main()` +to be `int` (in both versions). + Cody added the scripts [try.sh](1998/dlowe/try.sh), [pootify.sh](1998/dlowe/pootify.sh) and [pootify.cgi.sh](1998/dlowe/pootify.cgi.sh) for a fun example use of the