From fe6a598021984cb3877a36cba81e9c542d9f9547 Mon Sep 17 00:00:00 2001 From: Alexander Shiryaev Date: Thu, 15 Nov 2012 12:11:50 +0400 Subject: [PATCH] FD_ZERO --- Trurl-based/_Linux_/Comm/Mod/TCP.odc | Bin 19240 -> 19240 bytes Trurl-based/_Linux_/Lin/Mod/Net.txt | 5 ++-- Trurl-based/_Linux_/Lin/Mod/Termios.txt | 20 +++++++-------- .../_Linux_/Lin/Mod/gen-Net/Net.txt.templ | 5 ++-- .../Lin/Mod/gen-Termios/Termios.txt.templ | 20 +++++++-------- Trurl-based/_OpenBSD_/Comm/Mod/TCP.odc | Bin 19332 -> 19332 bytes Trurl-based/_OpenBSD_/Lin/Mod/Net.txt | 2 +- Trurl-based/_OpenBSD_/Lin/Mod/Termios.txt | 24 +++++++++--------- .../_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ | 2 +- .../Lin/Mod/gen-Termios/Termios.txt.templ | 24 +++++++++--------- 10 files changed, 50 insertions(+), 52 deletions(-) diff --git a/Trurl-based/_Linux_/Comm/Mod/TCP.odc b/Trurl-based/_Linux_/Comm/Mod/TCP.odc index 770b4456fbf8596442f37db38aaafbfc6202d80b..f904fc2985d0824aa262aec5f97fa86f6b7682db 100644 GIT binary patch delta 121 zcmZ26jd8^^#tkjZ%;tJ5liQi^f$0pE*0H*f>GV*=!v^ zYO^Z)Atgf}S3iy7)Dlf=g&@}eSH}1_1WGdJw__+FM6sMMGD!BM70O{z=SOqIvh3Z;s1y4U`jZ94i MS3j4{5?TU^06LH=VgLXD diff --git a/Trurl-based/_Linux_/Lin/Mod/Net.txt b/Trurl-based/_Linux_/Lin/Mod/Net.txt index 5636fe7..738f28a 100644 --- a/Trurl-based/_Linux_/Lin/Mod/Net.txt +++ b/Trurl-based/_Linux_/Lin/Mod/Net.txt @@ -149,7 +149,6 @@ MODULE LinNet ["libc.so.6"]; (* /usr/include/i386-linux-gnu/bits/typesizes.h *) __FD_SETSIZE = 1024; - __NFDBITS = SIZE(SET) * 8; TYPE SOCKET* = INTEGER; @@ -215,7 +214,7 @@ MODULE LinNet ["libc.so.6"]; (* /usr/include/i386-linux-gnu/sys/select.h *) __fd_mask = SET; - fd_set* = ARRAY [untagged] __FD_SETSIZE DIV __NFDBITS OF __fd_mask; + fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask; VAR h_errno*: INTEGER; @@ -244,7 +243,7 @@ MODULE LinNet ["libc.so.6"]; PROCEDURE FD_ZERO (VAR set: Net.fd_set); VAR i: INTEGER; BEGIN - i := 0; WHILE i < LEN(set) DO set[i] := {}; INC(i) END + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 END FD_ZERO; PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); diff --git a/Trurl-based/_Linux_/Lin/Mod/Termios.txt b/Trurl-based/_Linux_/Lin/Mod/Termios.txt index 8e07bf3..f682c36 100644 --- a/Trurl-based/_Linux_/Lin/Mod/Termios.txt +++ b/Trurl-based/_Linux_/Lin/Mod/Termios.txt @@ -133,16 +133,16 @@ MODULE LinTermios ["libc.so.6"]; END; (* POSIX.1 *) - PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; - PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; - PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; + PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; + PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; - PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; + PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; + PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; END LinTermios. diff --git a/Trurl-based/_Linux_/Lin/Mod/gen-Net/Net.txt.templ b/Trurl-based/_Linux_/Lin/Mod/gen-Net/Net.txt.templ index ea54461..756fa5e 100644 --- a/Trurl-based/_Linux_/Lin/Mod/gen-Net/Net.txt.templ +++ b/Trurl-based/_Linux_/Lin/Mod/gen-Net/Net.txt.templ @@ -31,7 +31,6 @@ MODULE LinNet ["libc.so.6"]; %%defs-netdb%% (* /usr/include/i386-linux-gnu/bits/typesizes.h *) __FD_SETSIZE = 1024; - __NFDBITS = SIZE(SET) * 8; TYPE SOCKET* = INTEGER; @@ -97,7 +96,7 @@ MODULE LinNet ["libc.so.6"]; (* /usr/include/i386-linux-gnu/sys/select.h *) __fd_mask = SET; - fd_set* = ARRAY [untagged] __FD_SETSIZE DIV __NFDBITS OF __fd_mask; + fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask; VAR h_errno*: INTEGER; @@ -126,7 +125,7 @@ MODULE LinNet ["libc.so.6"]; PROCEDURE FD_ZERO (VAR set: Net.fd_set); VAR i: INTEGER; BEGIN - i := 0; WHILE i < LEN(set) DO set[i] := {}; INC(i) END + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 END FD_ZERO; PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); diff --git a/Trurl-based/_Linux_/Lin/Mod/gen-Termios/Termios.txt.templ b/Trurl-based/_Linux_/Lin/Mod/gen-Termios/Termios.txt.templ index 5f5f06d..561461a 100644 --- a/Trurl-based/_Linux_/Lin/Mod/gen-Termios/Termios.txt.templ +++ b/Trurl-based/_Linux_/Lin/Mod/gen-Termios/Termios.txt.templ @@ -25,16 +25,16 @@ MODULE LinTermios ["libc.so.6"]; END; (* POSIX.1 *) - PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; - PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; - PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; + PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; + PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; - PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; + PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; + PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; END LinTermios. diff --git a/Trurl-based/_OpenBSD_/Comm/Mod/TCP.odc b/Trurl-based/_OpenBSD_/Comm/Mod/TCP.odc index a281fd8430537097759eb06702135c79ca112607..0e430cf9d9fca72011d81753222ba465da515a7d 100644 GIT binary patch delta 121 zcmZpf&e$@YaYG9;v$-D2kr)iFfD#no9O6UYS$MrXz8_vp}N*u!PC!KBU4ks M)z4*ffR>3O04ISeumAu6 diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/Net.txt b/Trurl-based/_OpenBSD_/Lin/Mod/Net.txt index 7c5df4e..95c7e4c 100644 --- a/Trurl-based/_OpenBSD_/Lin/Mod/Net.txt +++ b/Trurl-based/_OpenBSD_/Lin/Mod/Net.txt @@ -257,7 +257,7 @@ MODULE LinNet ["libc.so.66.0"]; PROCEDURE FD_ZERO (VAR set: Net.fd_set); VAR i: INTEGER; BEGIN - i := 0; WHILE i < LEN(set) DO set[i] := {}; INC(i) END + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 END FD_ZERO; PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/Termios.txt b/Trurl-based/_OpenBSD_/Lin/Mod/Termios.txt index 459b6b6..159fe77 100644 --- a/Trurl-based/_OpenBSD_/Lin/Mod/Termios.txt +++ b/Trurl-based/_OpenBSD_/Lin/Mod/Termios.txt @@ -133,22 +133,22 @@ MODULE LinTermios ["libc.so.66.0"]; END; (* POSIX.1 *) - PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; - PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; - PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; + PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; + PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; - PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; + PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; + PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; (* extensions *) (* - PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER; - PROCEDURE [ccall] cfmakeraw* (VAR tp: termios); + PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER; + PROCEDURE [ccall] cfmakeraw* (VAR tp: termios); *) END LinTermios. diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ index 6d16b28..0be10b6 100644 --- a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ +++ b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ @@ -127,7 +127,7 @@ MODULE LinNet ["libc.so.66.0"]; PROCEDURE FD_ZERO (VAR set: Net.fd_set); VAR i: INTEGER; BEGIN - i := 0; WHILE i < LEN(set) DO set[i] := {}; INC(i) END + i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0 END FD_ZERO; PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set); diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ index ebb67e8..81760c5 100644 --- a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ +++ b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ @@ -24,22 +24,22 @@ MODULE LinTermios ["libc.so.66.0"]; END; (* POSIX.1 *) - PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; - PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; - PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; - PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] cfgetispeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetispeed* (VAR tp: termios; ispeed: speed_t): INTEGER; + PROCEDURE [ccall] cfgetospeed* (VAR tp: termios): speed_t; + PROCEDURE [ccall] cfsetospeed* (VAR tp: termios; ospeed: speed_t): INTEGER; + PROCEDURE [ccall] tcgetattr* (fd: INTEGER; VAR tp: termios): INTEGER; + PROCEDURE [ccall] tcsetattr* (fd: INTEGER; action: INTEGER; VAR tp: termios): INTEGER; - PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; - PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; - PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; + PROCEDURE [ccall] tcdrain* (fd: INTEGER): INTEGER; + PROCEDURE [ccall] tcflow* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcflush* (fd: INTEGER; action: INTEGER): INTEGER; + PROCEDURE [ccall] tcsendbreak* (fd: INTEGER; len: INTEGER): INTEGER; (* extensions *) (* - PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER; - PROCEDURE [ccall] cfmakeraw* (VAR tp: termios); + PROCEDURE [ccall] cfsetspeed* (VAR tp: termios; speed: speed_t): INTEGER; + PROCEDURE [ccall] cfmakeraw* (VAR tp: termios); *) END LinTermios. -- 2.29.2