From a972e8f2b3615c07b9dad28611c00c158a9b103c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 12 Jun 2014 11:54:21 -0700 Subject: Try to fix a used-but-not-set warning. I'm guessing that GCC is complaining because "device" isn't guaranteed to be set (if there are no interfaces, the body of the loop will never be executed), so do with the list of link-layer header types what's done for the buffer size and snapshot length. But should the column-setting code be executed if the interface isn't found? Change-Id: I8c365a482b8af44cdd1c1a7f41ca611141387c86 Reviewed-on: https://code.wireshark.org/review/2180 Reviewed-by: Guy Harris --- ui/qt/capture_interfaces_dialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index 173faf1269..14df410b3b 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -600,6 +600,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption gint buffer = DEFAULT_CAPTURE_BUFFER_SIZE; #endif guint snap = WTAP_MAX_PACKET_SIZE; + GList *links = NULL; if (index.column() > 1) { interface_t device; @@ -611,6 +612,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption buffer = device.buffer; #endif snap = device.snaplen; + links = device.links; if (interface_name.compare(device.display_name) || device.hidden || device.type == IF_PIPE) { continue; } else { @@ -625,7 +627,7 @@ QWidget* TbInterfacesDelegate::createEditor( QWidget *parent, const QStyleOption GList *list; link_row *temp; QComboBox *cb = new QComboBox(parent); - for (list=device.links; list!=NULL; list=g_list_next(list)) { + for (list=links; list!=NULL; list=g_list_next(list)) { temp = (link_row*)(list->data); cb->addItem(QString("%1").arg(temp->name)); } -- cgit v1.2.3