htons moved to types; -- noch

Former-commit-id: 9d92942027
This commit is contained in:
norayr 2015-03-19 21:07:37 +04:00
parent ffbd45b735
commit 99d0d1c0db
2 changed files with 7 additions and 8 deletions

View file

@ -26,13 +26,6 @@ BEGIN
END DoSmth;
PROCEDURE htons(in: Int16; VAR out : Int16);
BEGIN
out[0] := in[1];
out[1] := in[0];
END htons;
PROCEDURE ZeroByteArr(VAR a : ARRAY OF S.BYTE);
VAR i : LONGINT;
BEGIN
@ -61,7 +54,7 @@ BEGIN
types.IntegerToInt16(sockets.AfInet, afinet);
types.IntegerToInt16(Port, port);
htons(port, port0); (* only necessary on little endian computers *)
types.htons(port, port0); (* only necessary on little endian computers *)
ServAddr.SinFamily := afinet;
ServAddr.SinPort := port0;
ZeroByteArr(ServAddr.SinZero);

View file

@ -29,4 +29,10 @@ TYPE
int16[1] := intarr[1];*) (* this will work for little endian -- noch *)
END IntegerToInt16;
PROCEDURE htons*(in: Int16; VAR out : Int16);
BEGIN
out[0] := in[1];
out[1] := in[0];
END htons;
END types.