Skip to content

Commit 99d0d1c

Browse files
committed
htons moved to types; -- noch
Former-commit-id: 9d92942
1 parent ffbd45b commit 99d0d1c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/test/server/s.Mod

+1-8
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ BEGIN
2626

2727
END DoSmth;
2828

29-
PROCEDURE htons(in: Int16; VAR out : Int16);
30-
BEGIN
31-
out[0] := in[1];
32-
out[1] := in[0];
33-
END htons;
34-
35-
3629
PROCEDURE ZeroByteArr(VAR a : ARRAY OF S.BYTE);
3730
VAR i : LONGINT;
3831
BEGIN
@@ -61,7 +54,7 @@ BEGIN
6154

6255
types.IntegerToInt16(sockets.AfInet, afinet);
6356
types.IntegerToInt16(Port, port);
64-
htons(port, port0); (* only necessary on little endian computers *)
57+
types.htons(port, port0); (* only necessary on little endian computers *)
6558
ServAddr.SinFamily := afinet;
6659
ServAddr.SinPort := port0;
6760
ZeroByteArr(ServAddr.SinZero);

src/test/server/types.Mod

+6
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ TYPE
2929
int16[1] := intarr[1];*) (* this will work for little endian -- noch *)
3030
END IntegerToInt16;
3131

32+
PROCEDURE htons*(in: Int16; VAR out : Int16);
33+
BEGIN
34+
out[0] := in[1];
35+
out[1] := in[0];
36+
END htons;
37+
3238
END types.

0 commit comments

Comments
 (0)