diff options
author | jenglish <jenglish@flightlab.com> | 2013-02-27 23:48:00 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2013-02-27 23:48:00 (GMT) |
commit | 5730db4aa21e4ecaaf7a957f3c506cb5a09fe8de (patch) | |
tree | d04924a678cb59d3df0325c9eaee369e408db1cd /unix | |
parent | 9702d912cc40901c9c27cbb7a46b469e3052c970 (diff) | |
download | tcl-5730db4aa21e4ecaaf7a957f3c506cb5a09fe8de.zip tcl-5730db4aa21e4ecaaf7a957f3c506cb5a09fe8de.tar.gz tcl-5730db4aa21e4ecaaf7a957f3c506cb5a09fe8de.tar.bz2 |
TtyGetBaud(), TtyGetSpeed(): use POSIX speed_t typedef
instead of 'unsigned long'.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixChan.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 5d8c4b2..4937dfd 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -139,8 +139,8 @@ static void TtyGetAttributes(int fd, TtyAttrs *ttyPtr); static int TtyGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); -static int TtyGetBaud(unsigned long speed); -static unsigned long TtyGetSpeed(int baud); +static int TtyGetBaud(speed_t speed); +static speed_t TtyGetSpeed(int baud); static FileState * TtyInit(int fd, int initialize); static void TtyModemStatusStr(int status, Tcl_DString *dsPtr); static int TtyParseMode(Tcl_Interp *interp, const char *mode, @@ -937,7 +937,7 @@ TtyGetOptionProc( } -static const struct {int baud; unsigned long speed;} speeds[] = { +static const struct {int baud; speed_t speed;} speeds[] = { #ifdef B0 {0, B0}, #endif @@ -1033,20 +1033,16 @@ static const struct {int baud; unsigned long speed;} speeds[] = { * * TtyGetSpeed -- * - * Given a baud rate, get the mask value that should be stored in the - * termios, termio, or sgttyb structure in order to select that baud - * rate. + * Given an integer baud rate, get the speed_t value that should be + * used to select that baud rate. * * Results: * As above. * - * Side effects: - * None. - * *--------------------------------------------------------------------------- */ -static unsigned long +static speed_t TtyGetSpeed( int baud) /* The baud rate to look up. */ { @@ -1079,21 +1075,17 @@ TtyGetSpeed( * * TtyGetBaud -- * - * Given a speed mask value from a termios, termio, or sgttyb structure, - * get the baus rate that corresponds to that mask value. + * Return the integer baud rate corresponding to a given speed_t value. * * Results: * As above. If the mask value was not recognized, 0 is returned. * - * Side effects: - * None. - * *--------------------------------------------------------------------------- */ static int TtyGetBaud( - unsigned long speed) /* Speed mask value to look up. */ + speed_t speed) /* Speed mask value to look up. */ { int i; |