]> git.sur5r.net Git - gsconf/blobdiff - shell_port.c
A bunch of fixes for various compiler warnings
[gsconf] / shell_port.c
index d9400290b6afde6a028f8610eba95dc25b45054b..9ac059d262ef0412c2256b9e01fbd28b59d46330 100644 (file)
@@ -5,13 +5,13 @@ void shell_port(char ** argv, int elem) {
         int n, i, m, o;
         
         if (elem == 1) {
         int n, i, m, o;
         
         if (elem == 1) {
-        
+                printf(" port [show|diag|mirror] \n");
                 return;
         }
         if (strncmp(argv[1], "show", 4) == 0) {
                 printf("Port\tSpeed\t\tBytes In\t\tBytes Out\n");
                 for (n = 0; n< 5; n++) {
                 return;
         }
         if (strncmp(argv[1], "show", 4) == 0) {
                 printf("Port\tSpeed\t\tBytes In\t\tBytes Out\n");
                 for (n = 0; n< 5; n++) {
-                        printf("%i\t%s\t% 8lu\t\t% 8lu\n", n, 
+                        printf("%i\t%s\t%8lu\t\t%8lu\n", n,
                         (settings.portStatistics[n].state == 0x05 ? "1000 Mbit/s" : (settings.portStatistics[n].state == 0x04 ? "100 Mbit/s" : (settings.portStatistics[n].state == 0x03 ? "10 Mbit/s":  (settings.portStatistics[n].state == 0x00 ? "No Cable": "???")))),
                         settings.portStatistics[n].bytesIn,
                         settings.portStatistics[n].bytesOut
                         (settings.portStatistics[n].state == 0x05 ? "1000 Mbit/s" : (settings.portStatistics[n].state == 0x04 ? "100 Mbit/s" : (settings.portStatistics[n].state == 0x03 ? "10 Mbit/s":  (settings.portStatistics[n].state == 0x00 ? "No Cable": "???")))),
                         settings.portStatistics[n].bytesIn,
                         settings.portStatistics[n].bytesOut
@@ -25,7 +25,7 @@ void shell_port(char ** argv, int elem) {
                 
                 n = atoi(argv[2]);
                 
                 
                 n = atoi(argv[2]);
                 
-                if (n < 1 | n > 5) {
+                if ((n < 1) | (n > 5)) {
                         printf("Invalid Port\n");
                         return;
                 }
                         printf("Invalid Port\n");
                         return;
                 }
@@ -66,7 +66,7 @@ void shell_port(char ** argv, int elem) {
                 
                 n = atoi(argv[2]);
                 
                 
                 n = atoi(argv[2]);
                 
-                if (n < 1 | n > 5) {
+                if ((n < 1) | (n > 5)) {
                         printf("Invalid Port %i\n", n);
                         return;
                 }
                         printf("Invalid Port %i\n", n);
                         return;
                 }
@@ -75,7 +75,7 @@ void shell_port(char ** argv, int elem) {
                 
                 for (m = 3; m < elem; m++) {
                         i = atoi(argv[m]);
                 
                 for (m = 3; m < elem; m++) {
                         i = atoi(argv[m]);
-                        if (i < 1 | i > 5) {
+                        if ((i < 1) | (i > 5)) {
                                 printf("Invalid Port %i\n", i);
                                 return;
                         }
                                 printf("Invalid Port %i\n", i);
                                 return;
                         }