aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-12-26 18:26:24 -0800
committerGuy Harris <guy@alum.mit.edu>2018-12-27 04:34:29 +0000
commit7eb3e47fa49806ea2cf59f0fa009240fae049a2b (patch)
treed668ff9ceae57934fe33582457fc5169f6e764ba /ui/qt
parentc3a7986b86f5355e6bd1791f70b78c91bcdac247 (diff)
Try to squeeze some bytes out of the frame_data structure.
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/byte_view_tab.cpp2
-rw-r--r--ui/qt/iax2_analysis_dialog.cpp2
-rw-r--r--ui/qt/lbm_lbtrm_transport_dialog.cpp2
-rw-r--r--ui/qt/lbm_lbtru_transport_dialog.cpp2
-rw-r--r--ui/qt/lbm_stream_dialog.cpp2
-rw-r--r--ui/qt/main_window.cpp2
-rw-r--r--ui/qt/main_window_slots.cpp4
-rw-r--r--ui/qt/models/packet_list_model.cpp30
-rw-r--r--ui/qt/models/packet_list_record.cpp2
-rw-r--r--ui/qt/packet_list.cpp6
-rw-r--r--ui/qt/packet_range_group_box.cpp4
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp2
-rw-r--r--ui/qt/rtp_player_dialog.cpp2
-rw-r--r--ui/qt/wireless_timeline.cpp10
14 files changed, 36 insertions, 36 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index 533e128118..bb9a321e2a 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -90,7 +90,7 @@ void ByteViewTab::addTab(const char *name, tvbuff_t *tvb) {
packet_char_enc encoding = PACKET_CHAR_ENC_CHAR_ASCII;
if ( cap_file_ && cap_file_->current_frame )
- encoding = (packet_char_enc)cap_file_->current_frame->flags.encoding;
+ encoding = (packet_char_enc)cap_file_->current_frame->encoding;
QByteArray data;
if ( tvb ) {
diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp
index d097891bb3..4e45127864 100644
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -622,7 +622,7 @@ gboolean Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, str
if (!iax2info) return FALSE;
/* we ignore packets that are not displayed */
- if (pinfo->fd->flags.passed_dfilter == 0)
+ if (pinfo->fd->passed_dfilter == 0)
return FALSE;
/* we ignore packets that carry no data */
diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp
index f6305cea7d..24657869a0 100644
--- a/ui/qt/lbm_lbtrm_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp
@@ -1325,7 +1325,7 @@ void LBMLBTRMTransportDialog::resetTap(void * tap_data)
gboolean LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info)
{
- if (pinfo->fd->flags.passed_dfilter == 1)
+ if (pinfo->fd->passed_dfilter == 1)
{
const lbm_lbtrm_tap_info_t * tapinfo = (const lbm_lbtrm_tap_info_t *)tap_info;
LBMLBTRMTransportDialogInfo * info = (LBMLBTRMTransportDialogInfo *)tap_data;
diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp
index 3d3eefd5cf..2052318134 100644
--- a/ui/qt/lbm_lbtru_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtru_transport_dialog.cpp
@@ -1744,7 +1744,7 @@ void LBMLBTRUTransportDialog::resetTap(void * tap_data)
gboolean LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info)
{
- if (pinfo->fd->flags.passed_dfilter == 1)
+ if (pinfo->fd->passed_dfilter == 1)
{
const lbm_lbtru_tap_info_t * tapinfo = (const lbm_lbtru_tap_info_t *)tap_info;
LBMLBTRUTransportDialogInfo * info = (LBMLBTRUTransportDialogInfo *)tap_data;
diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp
index 24856e299f..732c59d393 100644
--- a/ui/qt/lbm_stream_dialog.cpp
+++ b/ui/qt/lbm_stream_dialog.cpp
@@ -401,7 +401,7 @@ void LBMStreamDialog::resetTap(void * tap_data)
gboolean LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info)
{
- if (pinfo->fd->flags.passed_dfilter == 1)
+ if (pinfo->fd->passed_dfilter == 1)
{
const lbm_uim_stream_tap_info_t * tapinfo = (const lbm_uim_stream_tap_info_t *)stream_info;
LBMStreamDialogInfo * info = (LBMStreamDialogInfo *)tap_data;
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 732352311c..17ca335aeb 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -208,7 +208,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
if (cf->state == FILE_READ_DONE && cf->current_frame) {
ws_info->cf_framenr = cf->current_frame->num;
- ws_info->frame_passed_dfilter = (cf->current_frame->flags.passed_dfilter == 1);
+ ws_info->frame_passed_dfilter = (cf->current_frame->passed_dfilter == 1);
}
else {
ws_info->cf_framenr = 0;
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 9677028c42..b3bdcacf0b 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1160,12 +1160,12 @@ void MainWindow::setMenusForSelectedPacket()
have_frames = capture_file_.capFile()->count > 0;
have_marked = capture_file_.capFile()->marked_count > 0;
another_is_marked = have_marked &&
- !(capture_file_.capFile()->marked_count == 1 && frame_selected && capture_file_.capFile()->current_frame->flags.marked);
+ !(capture_file_.capFile()->marked_count == 1 && frame_selected && capture_file_.capFile()->current_frame->marked);
have_filtered = capture_file_.capFile()->displayed_count > 0 && capture_file_.capFile()->displayed_count != capture_file_.capFile()->count;
have_ignored = capture_file_.capFile()->ignored_count > 0;
have_time_ref = capture_file_.capFile()->ref_time_count > 0;
another_is_time_ref = have_time_ref &&
- !(capture_file_.capFile()->ref_time_count == 1 && frame_selected && capture_file_.capFile()->current_frame->flags.ref_time);
+ !(capture_file_.capFile()->ref_time_count == 1 && frame_selected && capture_file_.capFile()->current_frame->ref_time);
if (capture_file_.capFile()->edt)
{
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp
index 9e57c146f2..0f81d093de 100644
--- a/ui/qt/models/packet_list_model.cpp
+++ b/ui/qt/models/packet_list_model.cpp
@@ -107,7 +107,7 @@ guint PacketListModel::recreateVisibleRows()
foreach (PacketListRecord *record, physical_rows_) {
frame_data *fdata = record->frameData();
- if (fdata->flags.passed_dfilter || fdata->flags.ref_time) {
+ if (fdata->passed_dfilter || fdata->ref_time) {
visible_rows_ << record;
if (number_to_row_.size() <= (int)fdata->num) {
number_to_row_.resize(fdata->num + 10000);
@@ -171,7 +171,7 @@ void PacketListModel::toggleFrameMark(const QModelIndex &fm_index)
frame_data *fdata = record->frameData();
if (!fdata) return;
- if (fdata->flags.marked)
+ if (fdata->marked)
cf_unmark_frame(cap_file_, fdata);
else
cf_mark_frame(cap_file_, fdata);
@@ -201,7 +201,7 @@ void PacketListModel::toggleFrameIgnore(const QModelIndex &i_index)
frame_data *fdata = record->frameData();
if (!fdata) return;
- if (fdata->flags.ignored)
+ if (fdata->ignored)
cf_unignore_frame(cap_file_, fdata);
else
cf_ignore_frame(cap_file_, fdata);
@@ -229,15 +229,15 @@ void PacketListModel::toggleFrameRefTime(const QModelIndex &rt_index)
frame_data *fdata = record->frameData();
if (!fdata) return;
- if (fdata->flags.ref_time) {
- fdata->flags.ref_time=0;
+ if (fdata->ref_time) {
+ fdata->ref_time=0;
cap_file_->ref_time_count--;
} else {
- fdata->flags.ref_time=1;
+ fdata->ref_time=1;
cap_file_->ref_time_count++;
}
cf_reftime_packets(cap_file_);
- if (!fdata->flags.ref_time && !fdata->flags.passed_dfilter) {
+ if (!fdata->ref_time && !fdata->passed_dfilter) {
cap_file_->displayed_count--;
}
record->resetColumns(&cap_file_->cinfo);
@@ -252,8 +252,8 @@ void PacketListModel::unsetAllFrameRefTime()
foreach (PacketListRecord *record, physical_rows_) {
frame_data *fdata = record->frameData();
- if (fdata->flags.ref_time) {
- fdata->flags.ref_time = 0;
+ if (fdata->ref_time) {
+ fdata->ref_time = 0;
}
}
cap_file_->ref_time_count = 0;
@@ -348,7 +348,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
foreach (PacketListRecord *record, physical_rows_) {
frame_data *fdata = record->frameData();
- if (fdata->flags.passed_dfilter || fdata->flags.ref_time) {
+ if (fdata->passed_dfilter || fdata->ref_time) {
visible_rows_ << record;
if (number_to_row_.size() <= (int)fdata->num) {
number_to_row_.resize(fdata->num + 10000);
@@ -566,9 +566,9 @@ QVariant PacketListModel::data(const QModelIndex &d_index, int role) const
case Qt::BackgroundRole:
const color_t *color;
- if (fdata->flags.ignored) {
+ if (fdata->ignored) {
color = &prefs.gui_ignored_bg;
- } else if (fdata->flags.marked) {
+ } else if (fdata->marked) {
color = &prefs.gui_marked_bg;
} else if (fdata->color_filter && recent.packet_list_colorize) {
const color_filter_t *color_filter = (const color_filter_t *) fdata->color_filter;
@@ -578,9 +578,9 @@ QVariant PacketListModel::data(const QModelIndex &d_index, int role) const
}
return ColorUtils::fromColorT(color);
case Qt::ForegroundRole:
- if (fdata->flags.ignored) {
+ if (fdata->ignored) {
color = &prefs.gui_ignored_fg;
- } else if (fdata->flags.marked) {
+ } else if (fdata->marked) {
color = &prefs.gui_marked_fg;
} else if (fdata->color_filter && recent.packet_list_colorize) {
const color_filter_t *color_filter = (const color_filter_t *) fdata->color_filter;
@@ -708,7 +708,7 @@ gint PacketListModel::appendPacket(frame_data *fdata)
physical_rows_ << record;
- if (fdata->flags.passed_dfilter || fdata->flags.ref_time) {
+ if (fdata->passed_dfilter || fdata->ref_time) {
new_visible_rows_ << record;
if (new_visible_rows_.count() < 2) {
// This is the first queued packet. Schedule an insertion for
diff --git a/ui/qt/models/packet_list_record.cpp b/ui/qt/models/packet_list_record.cpp
index 63a636c406..617af34aa2 100644
--- a/ui/qt/models/packet_list_record.cpp
+++ b/ui/qt/models/packet_list_record.cpp
@@ -164,7 +164,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_color)
/* Re-color when the coloring rules are changed via the UI. */
if (dissect_color) {
color_filters_prime_edt(&edt);
- fdata_->flags.need_colorize = 1;
+ fdata_->need_colorize = 1;
}
if (dissect_columns)
col_custom_prime_edt(&edt, cinfo);
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 20701e153b..35a953afbd 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -1784,13 +1784,13 @@ void PacketList::drawFarOverlay()
for (int row = 0; row < pl_rows; row++) {
frame_data *fdata = packet_list_model_->getRowFdata(row);
- if (fdata->flags.marked || fdata->flags.ref_time || fdata->flags.ignored) {
+ if (fdata->marked || fdata->ref_time || fdata->ignored) {
int new_line = row * o_height / pl_rows;
int tick_width = o_width / 3;
// Marked or ignored: left side, time refs: right side.
// XXX Draw ignored ticks in the middle?
- int x1 = fdata->flags.ref_time ? o_width - tick_width : 1;
- int x2 = fdata->flags.ref_time ? o_width - 1 : tick_width;
+ int x1 = fdata->ref_time ? o_width - tick_width : 1;
+ int x2 = fdata->ref_time ? o_width - 1 : tick_width;
painter.drawLine(x1, new_line, x2, new_line);
have_marked_image = true;
diff --git a/ui/qt/packet_range_group_box.cpp b/ui/qt/packet_range_group_box.cpp
index 95588b26f1..fff31a6969 100644
--- a/ui/qt/packet_range_group_box.cpp
+++ b/ui/qt/packet_range_group_box.cpp
@@ -108,7 +108,7 @@ void PacketRangeGroupBox::updateCounts() {
pr_ui_->selectedCapturedLabel->setEnabled(false);
pr_ui_->selectedDisplayedLabel->setEnabled(false);
}
- if ((range_->remove_ignored && can_select && range_->cf->current_frame->flags.ignored) || selected_num < 1) {
+ if ((range_->remove_ignored && can_select && range_->cf->current_frame->ignored) || selected_num < 1) {
pr_ui_->selectedCapturedLabel->setText("0");
pr_ui_->selectedDisplayedLabel->setText("0");
} else {
@@ -222,7 +222,7 @@ void PacketRangeGroupBox::updateCounts() {
displayed_ignored_cnt = range_->displayed_ignored_cnt;
break;
case(range_process_selected):
- ignored_cnt = (can_select && range_->cf->current_frame->flags.ignored) ? 1 : 0;
+ ignored_cnt = (can_select && range_->cf->current_frame->ignored) ? 1 : 0;
displayed_ignored_cnt = ignored_cnt;
break;
case(range_process_marked):
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index 58050211b4..46046cf787 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -665,7 +665,7 @@ gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epa
if (!rtpinfo) return FALSE;
/* we ignore packets that are not displayed */
- if (pinfo->fd->flags.passed_dfilter == 0)
+ if (pinfo->fd->passed_dfilter == 0)
return FALSE;
/* also ignore RTP Version != 2 */
else if (rtpinfo->info_version != 2)
diff --git a/ui/qt/rtp_player_dialog.cpp b/ui/qt/rtp_player_dialog.cpp
index 93148319df..d6d2c1f6e1 100644
--- a/ui/qt/rtp_player_dialog.cpp
+++ b/ui/qt/rtp_player_dialog.cpp
@@ -566,7 +566,7 @@ gboolean RtpPlayerDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_
if (!rtpinfo) return FALSE;
/* we ignore packets that are not displayed */
- if (pinfo->fd->flags.passed_dfilter == 0)
+ if (pinfo->fd->passed_dfilter == 0)
return FALSE;
/* also ignore RTP Version != 2 */
else if (rtpinfo->info_version != 2)
diff --git a/ui/qt/wireless_timeline.cpp b/ui/qt/wireless_timeline.cpp
index 56b1deda23..baac452847 100644
--- a/ui/qt/wireless_timeline.cpp
+++ b/ui/qt/wireless_timeline.cpp
@@ -151,7 +151,7 @@ void WirelessTimeline::mouseReleaseEvent(QMouseEvent *event)
return;
frame_data *fdata = frame_data_sequence_find(cfile.provider.frames, num);
- if (!fdata->flags.passed_dfilter && fdata->prev_dis_num > 0)
+ if (!fdata->passed_dfilter && fdata->prev_dis_num > 0)
num = fdata->prev_dis_num;
cf_goto_frame(&cfile, num);
@@ -584,12 +584,12 @@ WirelessTimeline::paintEvent(QPaintEvent *qpe)
* with all other sub pixels that fall within this
* pixel */
last_x = x;
- accumulate_rgb(rgb, height, fdata->flags.passed_dfilter, width, red, green, blue);
+ accumulate_rgb(rgb, height, fdata->passed_dfilter, width, red, green, blue);
} else {
/* it spans more than 1 pixel.
* first accumulate the part that does fit */
float partial = ((int) x) + 1 - x;
- accumulate_rgb(rgb, height, fdata->flags.passed_dfilter, partial, red, green, blue);
+ accumulate_rgb(rgb, height, fdata->passed_dfilter, partial, red, green, blue);
/* and render it */
render_pixels(p, (int) x, 1, rgb, ratio);
last_x = -1;
@@ -597,14 +597,14 @@ WirelessTimeline::paintEvent(QPaintEvent *qpe)
width -= partial;
/* are there any whole pixels of width left to draw? */
if (width > 1.0) {
- render_rectangle(p, x, width, height, fdata->flags.passed_dfilter, red, green, blue, ratio);
+ render_rectangle(p, x, width, height, fdata->passed_dfilter, red, green, blue, ratio);
x += (int) width;
width -= (int) width;
}
/* is there a partial pixel left */
if (width > 0.0) {
last_x = x;
- accumulate_rgb(rgb, height, fdata->flags.passed_dfilter, width, red, green, blue);
+ accumulate_rgb(rgb, height, fdata->passed_dfilter, width, red, green, blue);
}
}
}