mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-01 14:16:47 +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:
@@ -48,12 +48,6 @@
|
|||||||
#include "inlnPS2.h"
|
#include "inlnPS2.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OS5
|
|
||||||
#define ToMem memmove
|
|
||||||
#else
|
|
||||||
#define ToMem memcpy
|
|
||||||
#endif /* !OS5 */
|
|
||||||
|
|
||||||
#define TCPhostlookup 0
|
#define TCPhostlookup 0
|
||||||
#define TCPservicelookup 1
|
#define TCPservicelookup 1
|
||||||
#define TCPsocket 2
|
#define TCPsocket 2
|
||||||
@@ -126,7 +120,7 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
|
|||||||
LispStringToCString(nameConn, namestring, 100);
|
LispStringToCString(nameConn, namestring, 100);
|
||||||
host = gethostbyname(namestring);
|
host = gethostbyname(namestring);
|
||||||
if (!host) return (NIL);
|
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:
|
host_ok:
|
||||||
sock = LispNumToCInt(proto);
|
sock = LispNumToCInt(proto);
|
||||||
result = socket(AF_INET, SOCK_STREAM, 0);
|
result = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|||||||
@@ -46,12 +46,6 @@
|
|||||||
#define MAX_HOSTNAME_LENGTH 100
|
#define MAX_HOSTNAME_LENGTH 100
|
||||||
#define UDP_DATA_BLOCK_SIZE 1000
|
#define UDP_DATA_BLOCK_SIZE 1000
|
||||||
|
|
||||||
#ifdef OS5
|
|
||||||
#define ToMem memmove
|
|
||||||
#else
|
|
||||||
#define ToMem memcpy
|
|
||||||
#endif /* OS5 */
|
|
||||||
|
|
||||||
LispPTR rpc(LispPTR *args)
|
LispPTR rpc(LispPTR *args)
|
||||||
{
|
{
|
||||||
#ifndef DOS
|
#ifndef DOS
|
||||||
@@ -130,7 +124,7 @@ LispPTR rpc(LispPTR *args)
|
|||||||
/* Resolve the host address. */
|
/* Resolve the host address. */
|
||||||
if (hp) {
|
if (hp) {
|
||||||
sin1.sin_family = hp->h_addrtype;
|
sin1.sin_family = hp->h_addrtype;
|
||||||
ToMem((caddr_t)&sin1.sin_addr, hp->h_addr, hp->h_length);
|
memcpy((caddr_t)&sin1.sin_addr, hp->h_addr, hp->h_length);
|
||||||
} else
|
} else
|
||||||
goto handle_error;
|
goto handle_error;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user