From ce6430e35e137b981cb18e286e546eae3c1f6b3c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 17 Apr 2017 17:17:01 -0700 Subject: Eliminate an unneded member of a wtap_dumper. The only place the time stamp precision is used is in the libpcap code, where it determines whether to write out microsecond-precision or nanosecond-precision time stamps; we can determine that by looking at the type/subtype field, which is also part of that structure, so do that. We weren't setting it consistently - we were only setting it in libpcap and a few other capture file writers, and not in other capture file writers - and none of the writers other than libpcap used it. Change-Id: If53779cf4823ca936b8bf3e8a7dbcfea5850e652 Reviewed-on: https://code.wireshark.org/review/21171 Reviewed-by: Guy Harris --- wiretap/btsnoop.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'wiretap/btsnoop.c') diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c index ac48c3b5f3..998c9589b8 100644 --- a/wiretap/btsnoop.c +++ b/wiretap/btsnoop.c @@ -402,19 +402,6 @@ gboolean btsnoop_dump_open_h1(wtap_dumper *wdh, int *err) wdh->subtype_write = btsnoop_dump_h1; /* Write the file header. */ - switch (wdh->file_type_subtype) { - - case WTAP_FILE_TYPE_SUBTYPE_BTSNOOP: - wdh->tsprecision = WTAP_TSPREC_USEC; - break; - - default: - /* We should never get here - our open routine - should only get called for the types above. */ - *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; - return FALSE; - } - if (!wtap_dump_file_write(wdh, btsnoop_magic, sizeof btsnoop_magic, err)) return FALSE; @@ -443,19 +430,6 @@ gboolean btsnoop_dump_open_h4(wtap_dumper *wdh, int *err) wdh->subtype_write = btsnoop_dump_h4; /* Write the file header. */ - switch (wdh->file_type_subtype) { - - case WTAP_FILE_TYPE_SUBTYPE_BTSNOOP: - wdh->tsprecision = WTAP_TSPREC_USEC; - break; - - default: - /* We should never get here - our open routine - should only get called for the types above. */ - *err = WTAP_ERR_UNWRITABLE_FILE_TYPE; - return FALSE; - } - if (!wtap_dump_file_write(wdh, btsnoop_magic, sizeof btsnoop_magic, err)) return FALSE; -- cgit v1.2.1