From 55798ccbe6f2f8e27cddca2bc332c671efded229 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 7 May 2023 04:28:58 -0700 Subject: [PATCH] Simplify macOS fix to 1984/anonymous It turns out I did not need to add a prototype to read() prior to main(); all that needed to be done is to specify the args (specifically the buffer, a void *, in the function (when defining it). Shortened it a bit by use of implicit ints where allowed. --- 1984/anonymous/README.md | 9 ++++----- 1984/anonymous/anonymous.c | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/1984/anonymous/README.md b/1984/anonymous/README.md index 22ccd5ad9..020009c80 100644 --- a/1984/anonymous/README.md +++ b/1984/anonymous/README.md @@ -16,11 +16,10 @@ make all ``` [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work -under macOS. The fix was to prototype `read()` prior to being defined and not -using `int, int, int` as the entry does. Instead the second arg is a `void *`. -In the `read()` function (which actually calls `write(2)`) the `i` (which is the -`void *`) has to be cast to an `int`. This solves the problem. Thank you Cody for -your assistance! +under macOS. The fix was to not use implicit `int`s in the `read()` function as +it once did. Instead the second arg is a `void *`. In the `read()` function +(which actually calls `write(2)`) the `i` (which is the `void *`) has to be cast +to an `int`. This solves the problem. Thank you Cody for your assistance! ## Judges' remarks: diff --git a/1984/anonymous/anonymous.c b/1984/anonymous/anonymous.c index 8deda1980..7f7e3aed8 100644 --- a/1984/anonymous/anonymous.c +++ b/1984/anonymous/anonymous.c @@ -1,2 +1,2 @@ -int read(int,void*,int);i;main(){for(;i["]