diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1998-06-23 14:47:51 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1998-06-23 14:47:51 +0000 |
commit | 36d17274f42b1d5e62dbb1d05e32291f003f8c4f (patch) | |
tree | c3802b07be0b5df3faf5d814bcd3e817d54e5f97 /otherlibs/unix/termios.c | |
parent | df00b2c58d350db5e64e1becd76816c626268289 (diff) |
Simplification de terminal_io_descr, certains compilos C avaient du mal avec l'ancien code
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1994 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/termios.c')
-rw-r--r-- | otherlibs/unix/termios.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/otherlibs/unix/termios.c b/otherlibs/unix/termios.c index 1f0ffa332..6c97c86f5 100644 --- a/otherlibs/unix/termios.c +++ b/otherlibs/unix/termios.c @@ -30,7 +30,6 @@ enum { Input, Output }; #define oflags ((long)(&terminal_status.c_oflag)) #define cflags ((long)(&terminal_status.c_cflag)) #define lflags ((long)(&terminal_status.c_lflag)) -#define cc(n) ((long)(&terminal_status.c_cc[n])) /* Number of fields in the terminal_io record field. Cf. unix.mli */ @@ -72,16 +71,16 @@ static long terminal_io_descr[] = { Bool, lflags, ECHOK, Bool, lflags, ECHONL, /* Control characters */ - Char, cc(VINTR), - Char, cc(VQUIT), - Char, cc(VERASE), - Char, cc(VKILL), - Char, cc(VEOF), - Char, cc(VEOL), - Char, cc(VMIN), - Char, cc(VTIME), - Char, cc(VSTART), - Char, cc(VSTOP), + Char, VINTR, + Char, VQUIT, + Char, VERASE, + Char, VKILL, + Char, VEOF, + Char, VEOL, + Char, VMIN, + Char, VTIME, + Char, VSTART, + Char, VSTOP, End }; @@ -89,7 +88,6 @@ static long terminal_io_descr[] = { #undef oflags #undef cflags #undef lflags -#undef cc struct speedtable_entry ; @@ -158,8 +156,8 @@ static void encode_terminal_status(value *dst) } break; } case Char: - { unsigned char * src = (unsigned char *) (*pc++); - *dst = Val_int(*src); + { int which = *pc++; + *dst = Val_int(terminal_status.c_cc[which]); break; } } } @@ -213,8 +211,8 @@ static void decode_terminal_status(value *src) ok: break; } case Char: - { unsigned char * dst = (unsigned char *) (*pc++); - *dst = Int_val(*src); + { int which = *pc++; + terminal_status.c_cc[which] = Int_val(*src); break; } } } |