From 5d52e1673483c6ed146ced3c7c086594c0a484ac Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Sun, 21 Jul 2013 20:48:30 +0000 Subject: Add helper function to epan_session which can be used to get absolute timestamp of given frame. Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number. This patch reduce size of frame_data by 8B (amd64) This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13) svn path=/trunk/; revision=50765 --- ui/gtk/graph_analysis.c | 6 +++--- ui/gtk/packet_list_store.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ui/gtk') diff --git a/ui/gtk/graph_analysis.c b/ui/gtk/graph_analysis.c index 9521803cb4..3665964fa5 100644 --- a/ui/gtk/graph_analysis.c +++ b/ui/gtk/graph_analysis.c @@ -450,7 +450,7 @@ dialog_graph_dump_to_file(char *pathname, graph_analysis_data_t *user_data) g_string_printf(label_string, "|%.3f", nstime_to_sec(&gai->fd->rel_ts)); #endif /* Write the time, using the same format as in the time col */ - set_fd_time(gai->fd, time_str); + set_fd_time(cfile.epan, gai->fd, time_str); g_string_printf(label_string, "|%s", time_str); enlarge_string(label_string, 10, ' '); fprintf(of, "%s", label_string->str); @@ -775,7 +775,7 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) g_snprintf(label_string, MAX_LABEL, "%.3f", nstime_to_sec(&user_data->dlg.items[display_items-1].fd->rel_ts)); #endif /* Write the time, using the same format as in th etime col */ - set_fd_time(user_data->dlg.items[display_items-1].fd, time_str); + set_fd_time(cfile.epan, user_data->dlg.items[display_items-1].fd, time_str); g_snprintf(label_string, MAX_LABEL, "%s", time_str); layout = gtk_widget_create_pango_layout(user_data->dlg.draw_area_time, label_string); middle_layout = gtk_widget_create_pango_layout(user_data->dlg.draw_area_time, label_string); @@ -968,7 +968,7 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) g_snprintf(label_string, MAX_LABEL, "%.3f", nstime_to_sec(&user_data->dlg.items[current_item].fd->rel_ts)); #endif /* Draw the time */ - set_fd_time(user_data->dlg.items[current_item].fd, time_str); + set_fd_time(cfile.epan, user_data->dlg.items[current_item].fd, time_str); g_snprintf(label_string, MAX_LABEL, "%s", time_str); pango_layout_set_text(layout, label_string, -1); pango_layout_get_pixel_size(layout, &label_width, &label_height); diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c index e7cb64bef8..4aeca56045 100644 --- a/ui/gtk/packet_list_store.c +++ b/ui/gtk/packet_list_store.c @@ -935,7 +935,7 @@ packet_list_compare_custom(gint sort_id, gint text_sort_id, PacketListRecord *a, hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[sort_id]); if (hfi == NULL) { - return frame_data_compare(a->fdata, b->fdata, COL_NUMBER); + return frame_data_compare(cfile.epan, a->fdata, b->fdata, COL_NUMBER); } else if ((hfi->strings == NULL) && (((IS_FT_INT(hfi->type) || IS_FT_UINT(hfi->type)) && ((hfi->display == BASE_DEC) || (hfi->display == BASE_DEC_HEX) || @@ -982,11 +982,11 @@ packet_list_compare_records(gint sort_id, gint text_sort_id, PacketListRecord *a gint ret; if (text_sort_id == -1) /* based on frame_data ? */ - return frame_data_compare(a->fdata, b->fdata, cfile.cinfo.col_fmt[sort_id]); + return frame_data_compare(cfile.epan, a->fdata, b->fdata, cfile.cinfo.col_fmt[sort_id]); ret = _packet_list_compare_records(sort_id, text_sort_id, a, b); if (ret == 0) - ret = frame_data_compare(a->fdata, b->fdata, COL_NUMBER); + ret = frame_data_compare(cfile.epan, a->fdata, b->fdata, COL_NUMBER); return ret; } -- cgit v1.2.3