Menu

#5 Remove unnecessary #ifdef block

v1.0 (example)
open
Tim Cook
None
5
2014-09-23
2014-09-23
No

The following #ifdef block can be removed and just use the DUPLEX_ #defines consistently.

$ diff -u nicstat.c.orig nicstat.c
--- nicstat.c.orig  2014-09-23 09:20:19.785286396 -0700
+++ nicstat.c   2014-09-23 09:29:03.990786802 -0700
@@ -2427,17 +2427,10 @@
 duplex_to_string(duplex_t duplex)
 {
    switch (duplex) {
-#ifdef OS_LINUX
    case DUPLEX_HALF:
        return ("half");
    case DUPLEX_FULL:
        return ("full");
-#else
-   case 1:
-       return ("half");
-   case 2:
-       return ("full");
-#endif
    default:
        return ("unkn");
    }

Discussion


Log in to post a comment.