1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-29 21:21:08 +00:00

Remove ToMem macro. (#120)

We can always use `memcpy` to copy from a `hostent` struct to a
`sockaddr_in` struct as they will not be overlapping.
This commit is contained in:
Bruce Mitchener
2020-12-23 13:57:40 +07:00
committed by GitHub
parent 8b67b6b75a
commit a6ef508a7c
2 changed files with 2 additions and 14 deletions

View File

@@ -48,12 +48,6 @@
#include "inlnPS2.h"
#endif
#ifdef OS5
#define ToMem memmove
#else
#define ToMem memcpy
#endif /* !OS5 */
#define TCPhostlookup 0
#define TCPservicelookup 1
#define TCPsocket 2
@@ -126,7 +120,7 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
LispStringToCString(nameConn, namestring, 100);
host = gethostbyname(namestring);
if (!host) return (NIL);
ToMem((char *)&farend.sin_addr, (char *)host->h_addr, host->h_length);
memcpy((char *)&farend.sin_addr, (char *)host->h_addr, host->h_length);
host_ok:
sock = LispNumToCInt(proto);
result = socket(AF_INET, SOCK_STREAM, 0);