summaryrefslogtreecommitdiff
path: root/ui/qt/bluetooth_devices_dialog.cpp
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2015-12-01 19:02:04 +0100
committerMichal Labedzki <michal.labedzki@tieto.com>2015-12-17 14:17:27 +0000
commit2da59158a08316c3e755bb38eb155483b1b4b0a4 (patch)
tree580dbeb8ef44f6eaf9b04d4ba6c1f17cccbb7c6b /ui/qt/bluetooth_devices_dialog.cpp
parent682cf6d72a708a8695959d9e67a986c213f4c37b (diff)
downloadwireshark-2da59158a08316c3e755bb38eb155483b1b4b0a4.tar.gz
Try to fix some PVS Studio warnings
V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 626 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 661 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 678 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 689 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 700 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 711 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 728 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 739 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 750 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 761 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 810 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 867 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 889 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 949 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 971 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 1876 V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 1950 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2053 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2056 V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 2122 V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2207 V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2227 V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2275 V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2279 V808 'name' object of 'QString' type was created but was not utilized. bluetooth_devices_dialog.cpp 201 V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_devices_dialog.cpp 337 V807 Decreased performance. Consider creating a pointer to avoid using the 'item->child(i_item)' expression repeatedly. bluetooth_hci_summary_dialog.cpp 648 V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_hci_summary_dialog.cpp 669 Change-Id: Ia81b5f867b2b1e0ee58eed0bd297800774bc37f9 Reviewed-on: https://code.wireshark.org/review/12683 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'ui/qt/bluetooth_devices_dialog.cpp')
-rw-r--r--ui/qt/bluetooth_devices_dialog.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp
index aade4c8a53..063af1bbe3 100644
--- a/ui/qt/bluetooth_devices_dialog.cpp
+++ b/ui/qt/bluetooth_devices_dialog.cpp
@@ -198,7 +198,6 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo
bluetooth_device_tap_t *tap_device = static_cast<bluetooth_device_tap_t *>(const_cast<void *>(data));
QString bd_addr;
QString bd_addr_oui;
- QString name;
const gchar *manuf;
QTreeWidgetItem *item = NULL;
@@ -329,23 +328,26 @@ void BluetoothDevicesDialog::on_tableTreeWidget_itemActivated(QTreeWidgetItem *i
void BluetoothDevicesDialog::on_actionCopy_All_triggered()
{
- QClipboard *clipboard = QApplication::clipboard();
- QString copy;
- QTreeWidgetItemIterator i_item(ui->tableTreeWidget);
+ QClipboard *clipboard = QApplication::clipboard();
+ QString copy;
+ QTreeWidgetItemIterator i_item(ui->tableTreeWidget);
+ QTreeWidgetItem *item;
+
+ item = ui->tableTreeWidget->headerItem();
copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n")
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_bd_addr), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_bd_addr_oui), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_name), -30)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_lmp_version), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_lmp_subversion), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_manufacturer), -30)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_hci_version), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_hci_revision), -20)
- .arg(ui->tableTreeWidget->headerItem()->text(column_number_is_local_adapter), -20);
+ .arg(item->text(column_number_bd_addr), -20)
+ .arg(item->text(column_number_bd_addr_oui), -20)
+ .arg(item->text(column_number_name), -30)
+ .arg(item->text(column_number_lmp_version), -20)
+ .arg(item->text(column_number_lmp_subversion), -20)
+ .arg(item->text(column_number_manufacturer), -30)
+ .arg(item->text(column_number_hci_version), -20)
+ .arg(item->text(column_number_hci_revision), -20)
+ .arg(item->text(column_number_is_local_adapter), -20);
while (*i_item) {
- QTreeWidgetItem *item = static_cast<QTreeWidgetItem*>(*i_item);
+ item = static_cast<QTreeWidgetItem*>(*i_item);
copy += QString("%1 %2 %3 %4 %5 %6 %7 %8 %9\n")
.arg(item->text(column_number_bd_addr), -20)
.arg(item->text(column_number_bd_addr_oui), -20)