From d155a3fde88bdfa602247522c34dd99745d9b80d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:18:18 -0700 Subject: [PATCH] Fixes in 2000/primenum - int main from void main To make the entry more portable the void main was changed to int main. The no arg check was NOT fixed: this is a documented feature not a bug and should not be fixed. If one wants to fix it for personal enjoyment (if they can get pleasure from a couple seconds :-) ) they may do so but it is not to be committed. --- 2000/primenum/primenum.c | 4 ++-- thanks-for-fixes.md | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/2000/primenum/primenum.c b/2000/primenum/primenum.c index ab228e996..a64a1c1b4 100644 --- a/2000/primenum/primenum.c +++ b/2000/primenum/primenum.c @@ -1,8 +1,8 @@ -#define BeginProgram void main(int argc, char *argv[]) +#define BeginProgram int main(int argc, char *argv[]) #define CloseBrace } #define CommandLineArgument -1 #define Declare int i,j,n,Flag=1; -#define EndOfProgram return; +#define EndOfProgram return 0; #define False 0; #define ForLoop ;for #define GetCommandLineArgument n=atoi(argv[1]); diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index b74ca8a4b..de4dc0211 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1657,6 +1657,11 @@ itself a one-line like the code is in the original entry. Now it looks much more like the original entry but with the two fixes. +## [2000/primenum](2000/primenum/primenum.c) ([README.md](2000/primenum/README.md])) + +Cody made this more portable by changing the `void main` to `int main`. + + ## [2000/thadgavin](2000/thadgavin/thadgavin.c) ([README.md](2000/thadgavin/README.md])) Cody fixed the code and added an appropriate make rule so that the SDL version