]> granicus.if.org Git - strace/blobdiff - term.c
"Modernize" all old-style function parameter declarations
[strace] / term.c
diff --git a/term.c b/term.c
index 5fad3b52f65ccb6780b1b8fe0387381e58ce24f8..23d2317f5161246e265b1c47335555066783700b 100644 (file)
--- a/term.c
+++ b/term.c
@@ -48,7 +48,7 @@
 #include <sys/filio.h>
 #endif
 
-static struct xlat tcxonc_options[] = {
+static const struct xlat tcxonc_options[] = {
        { TCOOFF,       "TCOOFF"        },
        { TCOON,        "TCOON"         },
        { TCIOFF,       "TCIOFF"        },
@@ -57,7 +57,7 @@ static struct xlat tcxonc_options[] = {
 };
 
 #ifdef TCLFLSH
-static struct xlat tcflsh_options[] = {
+static const struct xlat tcflsh_options[] = {
        { TCIFLUSH,     "TCIFLUSH"      },
        { TCOFLUSH,     "TCOFLUSH"      },
        { TCIOFLUSH,    "TCIOFLUSH"     },
@@ -65,7 +65,7 @@ static struct xlat tcflsh_options[] = {
 };
 #endif
 
-static struct xlat baud_options[] = {
+static const struct xlat baud_options[] = {
        { B0,           "B0"            },
        { B50,          "B50"           },
        { B75,          "B75"           },
@@ -140,7 +140,7 @@ static struct xlat baud_options[] = {
        { 0,            NULL            },
 };
 
-static struct xlat modem_flags[] = {
+static const struct xlat modem_flags[] = {
 #ifdef TIOCM_LE
        { TIOCM_LE,     "TIOCM_LE",     },
 #endif
@@ -178,10 +178,7 @@ static struct xlat modem_flags[] = {
 };
 
 
-int
-term_ioctl(tcp, code, arg)
-struct tcb *tcp;
-long code, arg;
+int term_ioctl(struct tcb *tcp, long code, long arg)
 {
        struct termios tios;
 #ifndef FREEBSD
@@ -337,11 +334,10 @@ long code, arg;
        case TIOCMBIS:
        case TIOCMBIC:
        case TIOCMSET:
-               if (umove(tcp, arg, &arg) < 0)
+               if (umove(tcp, arg, &i) < 0)
                        return 0;
                tprintf(", [");
-               if (!printflags(modem_flags, arg))
-                       tprintf("0");
+               printflags(modem_flags, i, "TIOCM_???");
                tprintf("]");
                return 1;
 #endif /* TIOCMGET */
@@ -415,17 +411,9 @@ long code, arg;
        case TIOCGPTN:
 #endif
                tprintf(", ");
-               printnum(tcp, arg, "%d");
+               printnum_int(tcp, arg, "%d");
                return 1;
 
-#if 0
-       /* ioctls with an indirect parameter displayed in hex */
-
-               tprintf(", ");
-               printnum(tcp, arg, "%#x");
-               return 1;
-#endif
-
        /* ioctls with an indirect parameter displayed as a char */
 
 #ifdef TIOCSTI