1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Type consistency tweaks

Better type consistency when returning enums flowcntrl_e and
parity_e. See also PR #92.
This commit is contained in:
Nick Patavalis
2018-02-10 10:04:14 +02:00
parent 6d8bf34e9f
commit a412f6583a
3 changed files with 17 additions and 11 deletions

View File

@ -66,6 +66,7 @@ const char *parity_str[] = {
[P_ODD] = "odd",
[P_MARK] = "mark",
[P_SPACE] = "space",
[P_ERROR] = "invalid parity mode",
};
/* flow control modes names */
@ -74,6 +75,7 @@ const char *flow_str[] = {
[FC_RTSCTS] = "RTS/CTS",
[FC_XONXOFF] = "xon/xoff",
[FC_OTHER] = "other",
[FC_ERROR] = "invalid flow control mode",
};
/**********************************************************************/
@ -850,7 +852,7 @@ baud_down (int baud)
return nb;
}
int
enum flowcntrl_e
flow_next (int flow)
{
switch(flow) {
@ -871,7 +873,7 @@ flow_next (int flow)
return flow;
}
int
enum parity_e
parity_next (int parity)
{
switch(parity) {
@ -1212,7 +1214,9 @@ int tty_q_push(const char *s, int len) {
int
do_command (unsigned char c)
{
int newbaud, newflow, newparity, newbits, newstopbits;
int newbaud, newbits, newstopbits;
enum flowcntrl_e newflow;
enum parity_e newparity;
const char *xfr_cmd;
char *fname;
unsigned char hexbuf[HEXBUF_SZ];