Fix cppcheck style: scope of variable can be reduced

Fix the following cppcheck warnings:
[libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced
[libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced
[utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
This commit is contained in:
Philippe Teuwen
2013-03-06 00:35:36 +01:00
parent 3f5a3fd58f
commit 4769392157
4 changed files with 5 additions and 7 deletions

View File

@@ -353,9 +353,8 @@ nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], const size_
const struct nfc_driver_list *pndl = nfc_drivers;
while (pndl) {
const struct nfc_driver *ndr = pndl->driver;
size_t _device_found = 0;
if ((ndr->scan_type == NOT_INTRUSIVE) || ((context->allow_intrusive_scan) && (ndr->scan_type == INTRUSIVE))) {
_device_found = ndr->scan(context, connstrings + (device_found), connstrings_len - (device_found));
size_t _device_found = ndr->scan(context, connstrings + (device_found), connstrings_len - (device_found));
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%ld device(s) found using %s driver", (unsigned long) _device_found, ndr->name);
if (_device_found > 0) {
device_found += _device_found;