mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 06:22:25 +00:00
htons moved to types; -- noch
This commit is contained in:
parent
b080951180
commit
9d92942027
2 changed files with 7 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue