From 27133ac407f6ef62fbf776540b5b83e62f27e509 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Tue, 22 Mar 2022 21:21:26 +0300 Subject: [PATCH] fix unused variable Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/device_inject.cpp | 12 ++++++++---- rEFIt_UEFI/cpp_foundation/XStringAbstract.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index abfe046ef..914390c19 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -171,10 +171,10 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, DevicePath = NextDevicePathNode(DevicePath); if (DevicePath->Type == HARDWARE_DEVICE_PATH && DevicePath->SubType == HW_PCI_DP) { CopyMem(&device->pci_dev_path[NumPaths], DevicePath, sizeof(struct PCIDevPath)); -// DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); + DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); } else { // not PCI path - break the loop - // DBG("not PCI "); + DBG(" break\n"); break; } } @@ -282,9 +282,12 @@ XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer bool SameDevice(DevPropDevice* D1, DevPropDevice* D2) { +// DBG("paths 1=%u 2=%u\n", D1->num_pci_devpaths, D2->num_pci_devpaths); if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false; for (UINT32 x=0; x < D1->num_pci_devpaths; x++) { +// DBG(" funcs 1=%u 2=%u\n", D1->pci_dev_path[x].function, D2->pci_dev_path[x].function); if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false; +// DBG(" devs 1=%u 2=%u\n", D1->pci_dev_path[x].device, D2->pci_dev_path[x].device); if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false; } return true; @@ -297,8 +300,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) XBuffer buffer; buffer.dataSized(len+1); - // DBG("devprop_generate_string\n"); - //TODO здесь нужно сделать join одинаковых устройств StringBuf->entries[i] по признаку ->pci_dev_path[x] (отдельный опретаор сравнения) +// DBG("devprop_generate_string\n"); buffer.S8Catf("%08X%08X%04hX%04hX", SwapBytes32(StringBuf->length), StringBuf->WHAT2, SwapBytes16(StringBuf->numentries), StringBuf->WHAT3); for (int i = 0; i < StringBuf->numentries; i++) { @@ -331,12 +333,14 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) //try to find same devices for (int j=i+1; j < StringBuf->numentries; j++) { if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; + dataptr = StringBuf->entries[j]->data; for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); } StringBuf->entries[j]->data = NULL; } } +// DBG("string=%s\n", buffer.data()); return buffer; } diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index d2e06eb40..cdc0e69b7 100644 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -58,7 +58,7 @@ int XStringAbstract__startWith(const S* src, const O* other, bool ignoreCase) template int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignoreCase) { - size_t nb = 0; +// size_t nb = 0; const S* src2 = src; const O* other2 = other; @@ -75,7 +75,7 @@ int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignor if ( src_char32 != other_char32 ) return false; src2 = get_char32_from_string(src2, &src_char32); other2 = get_char32_from_string(other2, &other_char32); - nb += 1; +// nb += 1; }; return true; }