From: Guy Harris Date: Thu, 23 Oct 2014 22:30:11 +0000 (-0700) Subject: Use a bit less generic name than "map". X-Git-Tag: libpcap-1.7.0-bp~1^2~13 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/02a9662eb8c21955873280f328934c1c2e971a09 Use a bit less generic name than "map". --- diff --git a/pcap-linux.c b/pcap-linux.c index daded9a7..7844ce5c 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -5456,12 +5456,12 @@ enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device) static const struct { int soft_timestamping_val; int pcap_tstamp_val; -} map[3] = { +} sof_ts_type_map[3] = { { SOF_TIMESTAMPING_SOFTWARE, PCAP_TSTAMP_HOST }, { SOF_TIMESTAMPING_SYS_HARDWARE, PCAP_TSTAMP_ADAPTER }, { SOF_TIMESTAMPING_RAW_HARDWARE, PCAP_TSTAMP_ADAPTER_UNSYNCED } }; -#define NUM_SOF_TIMESTAMPING_TYPES (sizeof map / sizeof map[0]) +#define NUM_SOF_TIMESTAMPING_TYPES (sizeof sof_ts_type_map / sizeof sof_ts_type_map[0]) #ifdef ETHTOOL_GET_TS_INFO /* @@ -5509,15 +5509,15 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf) num_ts_types = 0; for (i = 0; i < NUM_SOF_TIMESTAMPING_TYPES; i++) { - if (info.so_timestamping & map[i].soft_timestamping_val) + if (info.so_timestamping & sof_ts_type_map[i].soft_timestamping_val) num_ts_types++; } handle->tstamp_type_count = num_ts_types; if (num_ts_types != 0) { handle->tstamp_type_list = malloc(num_ts_types * sizeof(u_int)); for (i = 0, j = 0; i < NUM_SOF_TIMESTAMPING_TYPES; i++) { - if (info.so_timestamping & map[i].soft_timestamping_val) { - handle->tstamp_type_list[j] = map[i].pcap_tstamp_val; + if (info.so_timestamping & sof_ts_type_map[i].soft_timestamping_val) { + handle->tstamp_type_list[j] = sof_ts_type_map[i].pcap_tstamp_val; j++; } } @@ -5537,7 +5537,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf _U_) handle->tstamp_type_count = NUM_SOF_TIMESTAMPING_TYPES; handle->tstamp_type_list = malloc(NUM_SOF_TIMESTAMPING_TYPES * sizeof(u_int)); for (i = 0, j = 0; i < NUM_SOF_TIMESTAMPING_TYPES; i++) - handle->tstamp_type_list[i] = map[i].pcap_tstamp_val; + handle->tstamp_type_list[i] = sof_ts_type_map[i].pcap_tstamp_val; return 0; } #endif /* ETHTOOL_GET_TS_INFO */