From 65eb9385f6d1b7e20ae3f661e6dc1952ba3fbd2d Mon Sep 17 00:00:00 2001 From: DTB Date: Mon, 4 Dec 2023 20:15:38 -0700 Subject: [PATCH] now builds --- rot13/rot-ascii.c | 2 +- rot13/rot-ascii.h | 2 +- rot13/rot-unicode.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rot13/rot-ascii.c b/rot13/rot-ascii.c index 94668f0..4bd9e7a 100644 --- a/rot13/rot-ascii.c +++ b/rot13/rot-ascii.c @@ -7,7 +7,7 @@ caesar_lower(CHAR c, size_t r){ static char alpha_lower[] = "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz"; - return : alpha_lower[c - alpha_lower[0] + return alpha_lower[c - alpha_lower[0] + r % 26 /* length of alphabet */]; } diff --git a/rot13/rot-ascii.h b/rot13/rot-ascii.h index 6ff2a5d..7163f1e 100644 --- a/rot13/rot-ascii.h +++ b/rot13/rot-ascii.h @@ -1,4 +1,4 @@ -#define CHHR int +typedef int CHAR; #include /* isalpha(3), islower(3), isupper(3) */ #define ISALPHA(a) (((a) < 0x80) && isalpha(a)) #define ISLOWER(a) (((a) < 0x80) && islower(a)) diff --git a/rot13/rot-unicode.h b/rot13/rot-unicode.h index d95d028..1d4d5b9 100644 --- a/rot13/rot-unicode.h +++ b/rot13/rot-unicode.h @@ -1,5 +1,5 @@ #include /* UChar32 */ -#define CHAR UChar32 +typedef UChar32 CHAR; #include /* u_islower(3), u_isupper(3) */ #include /* isalpha(3) */ #define ISALPHA(a) (((a) < 0x80) && isalpha(a))