diff options
author | Jan Kaisrlik <j.kaisrlik@seznam.cz> | 2014-03-15 19:58:40 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-03-19 17:08:32 +0000 |
commit | 2aebb94aa6dcd741ebd0ad3d5a48091424dd87db (patch) | |
tree | 3c727bc9e5361c737de3918b57186e008e955766 /ui/qt/summary_dialog.cpp | |
parent | 7e423a3a1f136ede404b7af40c96279e5a7c7940 (diff) | |
download | wireshark-2aebb94aa6dcd741ebd0ad3d5a48091424dd87db.tar.gz |
fix of bug 9836. Avg. packet size in Statistics -> Summary is rounded to nearest. GTK QT
Change-Id: I34e84e6cf4587fee999764435fa1a407c8aa04bb
Reviewed-on: https://code.wireshark.org/review/687
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'ui/qt/summary_dialog.cpp')
-rw-r--r-- | ui/qt/summary_dialog.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ui/qt/summary_dialog.cpp b/ui/qt/summary_dialog.cpp index e480301cdb..3913678903 100644 --- a/ui/qt/summary_dialog.cpp +++ b/ui/qt/summary_dialog.cpp @@ -570,9 +570,8 @@ void SummaryDialog::UpdateValues() ui->tbDisplay->setItem(ui->tbDisplay->rowCount()-1, 0, new QTableWidgetItem(tr("Avg. packet size"))); if (summary_.packet_count > 1) { - output = output.sprintf(tr("%.3f bytes").toStdString().c_str(), - /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */ - (float) ((gint64) summary_.bytes)/summary_.packet_count); + output = output.sprintf(tr("%" G_GUINT64_FORMAT " bytes").toStdString().c_str(), + (guint64) ((double)summary_.bytes/summary_.packet_count + 0.5)); } else @@ -584,9 +583,8 @@ void SummaryDialog::UpdateValues() if (summary_.dfilter && summary_.filtered_count > 1) { - output = output.sprintf(tr("%.3f bytes").toStdString().c_str(), - /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */ - (float) ((gint64) summary_.filtered_bytes)/summary_.filtered_count); + output = output.sprintf(tr("%" G_GUINT64_FORMAT " bytes").toStdString().c_str(), + (guint64) ((double)summary_.filtered_bytes/summary_.filtered_count + 0.5)); } else { @@ -597,9 +595,8 @@ void SummaryDialog::UpdateValues() if (summary_.marked_count > 1) { - output = output.sprintf(tr("%.3f bytes").toStdString().c_str(), - /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */ - (float) ((gint64) summary_.marked_bytes)/summary_.marked_count); + output = output.sprintf(tr("%" G_GUINT64_FORMAT " bytes").toStdString().c_str(), + (guint64) ((double)summary_.marked_bytes/summary_.marked_count + 0.5)); } else { |