From 5565c9db8bc89a962f3d4ec69dfab9a66ec8aab4 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Thu, 1 Sep 2022 14:15:38 -0700 Subject: [PATCH] Replace Addr68k related macros with NativeAligned inline functions --- src/uutils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uutils.c b/src/uutils.c index 0de5d5d..5a6607b 100644 --- a/src/uutils.c +++ b/src/uutils.c @@ -27,7 +27,7 @@ #include // for getenv #include // for strcmp, strcpy, strlen, strncpy #include // for getuid, gethostid, gethostname, getpgrp -#include "adr68k.h" // for Addr68k_from_LADDR +#include "adr68k.h" // for NativeAligned4FromLAddr #include "keyboard.h" // for KBEVENT, KB_ALLUP, RING, KEYEVENTSIZE, MAXKE... #include "lispemul.h" // for LispPTR, DLword, NIL, ATOM_T #include "lspglob.h" @@ -52,12 +52,12 @@ static int lisp_string_to_c_string(LispPTR Lisp, char *C, size_t length) { if (GetTypeNumber(Lisp) != TYPE_ONED_ARRAY) { return (-1); } - arrayp = (OneDArray *)(Addr68k_from_LADDR(Lisp)); + arrayp = (OneDArray *)NativeAligned4FromLAddr(Lisp); if (arrayp->fillpointer >= length) { return (-1); } /* too long */ switch (arrayp->typenumber) { case THIN_CHAR_TYPENUMBER: - base = ((char *)(Addr68k_from_LADDR(arrayp->base))) + ((int)(arrayp->offset)); + base = ((char *)NativeAligned2FromLAddr(arrayp->base)) + ((int)(arrayp->offset)); #ifndef BYTESWAP strncpy(C, base, arrayp->fillpointer); #else @@ -96,13 +96,13 @@ static int c_string_to_lisp_string(char *C, LispPTR Lisp) { length = strlen(C); if (GetTypeNumber(Lisp) != TYPE_ONED_ARRAY) { return (-1); } - arrayp = (OneDArray *)(Addr68k_from_LADDR(Lisp)); + arrayp = (OneDArray *)NativeAligned4FromLAddr(Lisp); if (arrayp->totalsize < length + 1) { return (-1); } /* too short for C string */ switch (arrayp->typenumber) { case THIN_CHAR_TYPENUMBER: - base = ((char *)(Addr68k_from_LADDR(arrayp->base))) + ((int)(arrayp->offset)); + base = ((char *)NativeAligned2FromLAddr(arrayp->base)) + ((int)(arrayp->offset)); #ifndef BYTESWAP strcpy(base, C); #else