From ab5614ae10508a465cc2938bb39018b3f36636aa Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Fri, 4 Mar 2016 09:26:00 -0500 Subject: Clean up modelines and indentation. To quote Icf0831717de10fc615971fa1cf75af2f1ea2d03d: HT tab stops are set every 8 spaces on UN*X; UN*X tools that treat an HT character as tabbing to 4-space tab stops, or that even are configurable but *default* to 4-space tab stops (I'm looking at *you*, Xcode!) are broken. tab-width: 4, tabstop=4, and tabSize=4 are errors if you ever expect anybody to look at your file with a UN*X tool, and every text file will probably be looked at by a UN*X tool at some point, so Don't Do That. Adjust indentation to reflect the mode lines. Change-Id: Ic829541c696e0ddbc45cc109009319859c799066 Reviewed-on: https://code.wireshark.org/review/14340 Reviewed-by: Jeff Morriss --- wsutil/interface.c | 84 +++++++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'wsutil') diff --git a/wsutil/interface.c b/wsutil/interface.c index 07fdb318b5..93ed505fe6 100644 --- a/wsutil/interface.c +++ b/wsutil/interface.c @@ -30,66 +30,66 @@ #include #ifdef HAVE_ARPA_INET_H - #include + #include #endif #ifdef HAVE_IFADDRS_H - #include + #include #endif GSList *local_interfaces_to_list(void) { - GSList *interfaces = NULL; + GSList *interfaces = NULL; #ifdef HAVE_GETIFADDRS - struct ifaddrs *ifap; - struct ifaddrs *ifa; - int family; - char ip[INET6_ADDRSTRLEN]; + struct ifaddrs *ifap; + struct ifaddrs *ifa; + int family; + char ip[INET6_ADDRSTRLEN]; - if (getifaddrs(&ifap)) { - goto end; - } - - interfaces = g_slist_alloc(); + if (getifaddrs(&ifap)) { + goto end; + } - for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { - if (ifa->ifa_addr == NULL) - continue; + interfaces = g_slist_alloc(); - family = ifa->ifa_addr->sa_family; + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { + if (ifa->ifa_addr == NULL) + continue; - memset(ip, 0x0, INET6_ADDRSTRLEN); + family = ifa->ifa_addr->sa_family; - switch (family) { - case AF_INET: - { - struct sockaddr_in *addr4 = (struct sockaddr_in *)ifa->ifa_addr; - ws_inet_ntop4(&addr4->sin_addr, ip, sizeof(ip)); - break; - } + memset(ip, 0x0, INET6_ADDRSTRLEN); - case AF_INET6: - { - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)ifa->ifa_addr; - ws_inet_ntop6(&addr6->sin6_addr, ip, sizeof(ip)); - break; - } + switch (family) { + case AF_INET: + { + struct sockaddr_in *addr4 = (struct sockaddr_in *)ifa->ifa_addr; + ws_inet_ntop4(&addr4->sin_addr, ip, sizeof(ip)); + break; + } - default: - break; + case AF_INET6: + { + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)ifa->ifa_addr; + ws_inet_ntop6(&addr6->sin6_addr, ip, sizeof(ip)); + break; } - /* skip loopback addresses */ - if (!g_strcmp0(ip, "127.0.0.1") || !g_strcmp0(ip, "::1")) - continue; + default: + break; + } - if (*ip) { - interfaces = g_slist_prepend(interfaces, g_strdup(ip)); - } + /* skip loopback addresses */ + if (!g_strcmp0(ip, "127.0.0.1") || !g_strcmp0(ip, "::1")) + continue; + + if (*ip) { + interfaces = g_slist_prepend(interfaces, g_strdup(ip)); } + } end: #endif /* HAVE_GETIFADDRS */ - return interfaces; + return interfaces; } /* @@ -97,10 +97,10 @@ end: * * Local variables: * c-basic-offset: 4 - * tab-width: 4 + * tab-width: 8 * indent-tabs-mode: t * End: * - * vi: set shiftwidth=4 tabstop=4 noexpandtab: - * :indentSize=4:tabSize=4:noTabs=false: + * vi: set shiftwidth=4 tabstop=8 noexpandtab: + * :indentSize=4:tabSize=8:noTabs=false: */ -- cgit v1.2.3