tshark: remove redundant casts.
authorDario Lombardo <lomato@gmail.com>
Thu, 3 Jan 2019 16:16:35 +0000 (17:16 +0100)
committerAnders Broman <a.broman58@gmail.com>
Thu, 3 Jan 2019 19:34:10 +0000 (19:34 +0000)
Found by clang-tidy.

Change-Id: I7fe1c3219758d8daf411d094e2df17916f2eb57b
Reviewed-on: https://code.wireshark.org/review/31330
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
tshark.c

index 2367f1aeadd0460003faf947b54cc0faf6e85493..260d9cda8a8b2b82a9cd58b6a10f5cbde7e74aff 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -2573,7 +2573,7 @@ gboolean
 capture_input_new_file(capture_session *cap_session, gchar *new_file)
 {
   capture_options *capture_opts = cap_session->capture_opts;
-  capture_file *cf = (capture_file *) cap_session->cf;
+  capture_file *cf = cap_session->cf;
   gboolean is_tempfile;
   int      err;
 
@@ -2612,9 +2612,9 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
   /* if we are in real-time mode, open the new file now */
   if (do_dissection) {
     /* this is probably unecessary, but better safe than sorry */
-    ((capture_file *)cap_session->cf)->open_type = WTAP_TYPE_AUTO;
+    cap_session->cf->open_type = WTAP_TYPE_AUTO;
     /* Attempt to open the capture file and set up to read from it. */
-    switch(cf_open((capture_file *)cap_session->cf, capture_opts->save_file, WTAP_TYPE_AUTO, is_tempfile, &err)) {
+    switch(cf_open(cap_session->cf, capture_opts->save_file, WTAP_TYPE_AUTO, is_tempfile, &err)) {
     case CF_OK:
       break;
     case CF_ERROR:
@@ -2640,7 +2640,7 @@ capture_input_new_packets(capture_session *cap_session, int to_read)
   int           err;
   gchar        *err_info;
   gint64        data_offset;
-  capture_file *cf = (capture_file *)cap_session->cf;
+  capture_file *cf = cap_session->cf;
   gboolean      filtering_tap_listeners;
   guint         tap_flags;
 
@@ -2807,7 +2807,7 @@ capture_input_drops(capture_session *cap_session _U_, guint32 dropped, char* int
 void
 capture_input_closed(capture_session *cap_session, gchar *msg)
 {
-  capture_file *cf = (capture_file *) cap_session->cf;
+  capture_file *cf = cap_session->cf;
 
   if (msg != NULL)
     fprintf(stderr, "tshark: %s\n", msg);