From a53545c0c81ac71aaa10ae91d080f1640551b5b8 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Wed, 14 Aug 2019 10:18:51 +0200 Subject: Qt: Add macro for g_list_next for C++ Using a simple (type *) cast on g_list_next results in a warning with modern compilers "old-style cast" Adding a warning for g_list_next and data access to avoid the warning A good overview why reinterpret_cast has been used can be found here: https://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-const-cast-and-reinterpret-cast-be-used It is a 1:1 replacement in this case, but does not use any of the new cast styles and therefore should be used with caution. Change-Id: I989f237afc39aaf40133a788b1c0bbd7a51bf974 Reviewed-on: https://code.wireshark.org/review/34284 Petri-Dish: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- ui/qt/rtp_analysis_dialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui/qt/rtp_analysis_dialog.cpp') diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index cf06a6dbb7..935e50fb43 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -1609,10 +1609,10 @@ void RtpAnalysisDialog::findStreams() // register_tap_listener_rtpstream(&tapinfo_, NULL); /* Scan for RTP streams (redissect all packets) */ - rtpstream_scan(&tapinfo_, cap_file_.capFile(), NULL); + rtpstream_scan(&tapinfo_, cap_file_.capFile(), Q_NULLPTR); - for (GList *strinfo_list = g_list_first(tapinfo_.strinfo_list); strinfo_list; strinfo_list = g_list_next(strinfo_list)) { - rtpstream_info_t * strinfo = (rtpstream_info_t*)(strinfo_list->data); + for (GList *strinfo_list = g_list_first(tapinfo_.strinfo_list); strinfo_list; strinfo_list = gxx_list_next(strinfo_list)) { + rtpstream_info_t * strinfo = gxx_list_data(rtpstream_info_t*, strinfo_list); if (rtpstream_id_equal(&(strinfo->id), &(fwd_statinfo_.id),RTPSTREAM_ID_EQUAL_NONE)) { fwd_statinfo_.packet_count = strinfo->packet_count; -- cgit v1.2.3