mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-01-11 19:22:14 +01:00
Get rid of AsciiPrintf used with %d
This commit is contained in:
parent
c8f3a40532
commit
6d54a4c0b6
@ -5894,7 +5894,7 @@ GetUserSettings(
|
||||
if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) {
|
||||
snprintf (SlotDevice->SlotName, 31, "%s", Prop2->string);
|
||||
} else {
|
||||
AsciiSPrint (SlotDevice->SlotName, 31, "PCI Slot %d", DeviceN);
|
||||
snprintf (SlotDevice->SlotName, 31, "PCI Slot %lld", DeviceN);
|
||||
}
|
||||
|
||||
DBG (" - %s\n", SlotDevice->SlotName);
|
||||
|
@ -2073,18 +2073,18 @@ static INT32 devprop_add_nvidia_template(DevPropDevice *device, INTN n_ports)
|
||||
}
|
||||
|
||||
for (pnum = 0; pnum < n_ports; pnum++) {
|
||||
AsciiSPrint(nkey, 24, "@%d,name", pnum);
|
||||
snprintf(nkey, 24, "@%lld,name", pnum);
|
||||
snprintf(nval, 24, "NVDA,Display-%c", (char)(65+pnum));
|
||||
//DBG("Nvidia: insert [%s : %s]\n", nkey, nval);
|
||||
devprop_add_value(device, nkey, (UINT8*)nval, 14);
|
||||
|
||||
AsciiSPrint(nkey, 24, "@%d,compatible", pnum);
|
||||
snprintf(nkey, 24, "@%lld,compatible", pnum);
|
||||
devprop_add_value(device, nkey, (UINT8*)"NVDA,NVMac", 10);
|
||||
|
||||
AsciiSPrint(nkey, 24, "@%d,device_type", pnum);
|
||||
snprintf(nkey, 24, "@%lld,device_type", pnum);
|
||||
devprop_add_value(device, nkey, (UINT8*)"display", 7);
|
||||
|
||||
AsciiSPrint(nkey, 24, "@%d,display-cfg", pnum);
|
||||
snprintf(nkey, 24, "@%lld,display-cfg", pnum);
|
||||
if (pnum == 0) {
|
||||
devprop_add_value(device, nkey, (gSettings.Dcfg[0] != 0) ? &gSettings.Dcfg[0] : default_dcfg_0, DCFG0_LEN);
|
||||
} else {
|
||||
@ -2472,7 +2472,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
if ((devices_number == 1) &&
|
||||
((gSettings.BootDisplay >= 0) && (gSettings.BootDisplay < (INT8)n_ports))) {
|
||||
CHAR8 nkey[24];
|
||||
AsciiSPrint(nkey, 24, "@%d,AAPL,boot-display", gSettings.BootDisplay);
|
||||
snprintf(nkey, 24, "@%d,AAPL,boot-display", gSettings.BootDisplay);
|
||||
devprop_add_value(device, nkey, (UINT8*)&boot_display, 4);
|
||||
DBG("Nvidia: BootDisplay: %d\n", gSettings.BootDisplay);
|
||||
}
|
||||
|
@ -1348,9 +1348,9 @@ VOID PatchTableType17()
|
||||
newSmbiosTable.Type17->DeviceSet = bank + 1;
|
||||
newSmbiosTable.Type17->MemoryArrayHandle = mHandle16;
|
||||
if (isMacPro) {
|
||||
AsciiSPrint(deviceLocator, 10, "DIMM%d", gRAMCount + 1);
|
||||
snprintf(deviceLocator, 10, "DIMM%d", gRAMCount + 1);
|
||||
} else {
|
||||
AsciiSPrint(deviceLocator, 10, "DIMM%d", bank);
|
||||
snprintf(deviceLocator, 10, "DIMM%d", bank);
|
||||
AsciiSPrint(bankLocator, 10, "BANK %llu", Index % channels);
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->BankLocator, (CONST CHAR8*)&bankLocator[0]);
|
||||
}
|
||||
@ -1680,7 +1680,7 @@ VOID PatchTableType17()
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, gRAM.SMBIOS[SMBIOSIndex].Vendor);
|
||||
}
|
||||
|
||||
AsciiSPrint(gSettings.MemorySpeed, 64, "%d", newSmbiosTable.Type17->Speed);
|
||||
snprintf(gSettings.MemorySpeed, 64, "%d", newSmbiosTable.Type17->Speed);
|
||||
|
||||
// Assume DDR3 unless explicitly set to DDR2/DDR/DDR4
|
||||
if ((newSmbiosTable.Type17->MemoryType != MemoryTypeDdr2) &&
|
||||
@ -1691,12 +1691,12 @@ VOID PatchTableType17()
|
||||
|
||||
//now I want to update deviceLocator and bankLocator
|
||||
if (isMacPro) {
|
||||
AsciiSPrint(deviceLocator, 10, "DIMM%d", gRAMCount + 1);
|
||||
snprintf(deviceLocator, 10, "DIMM%d", gRAMCount + 1);
|
||||
// AsciiSPrint(bankLocator, 10, "");
|
||||
bankLocator[0] = 0;
|
||||
} else {
|
||||
AsciiSPrint(deviceLocator, 10, "DIMM%d", bank);
|
||||
AsciiSPrint(bankLocator, 10, "BANK %d", Index % channels);
|
||||
snprintf(deviceLocator, 10, "DIMM%d", bank);
|
||||
snprintf(bankLocator, 10, "BANK %llu", Index % channels);
|
||||
}
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->DeviceLocator, (CONST CHAR8*)&deviceLocator[0]);
|
||||
if (isMacPro) {
|
||||
|
@ -347,7 +347,7 @@ VOID QuickSort(VOID* Array, INTN Low, INTN High, INTN Size, INTN (*compare)(CONS
|
||||
// I = (INTN)X;
|
||||
// D = (float)I;
|
||||
// Fract = fabsf((X - D) * 1000000.0f);
|
||||
// AsciiSPrint(S, N, "%D.%06D", I, (INTN)Fract);
|
||||
// snprintf(S, N, "%D.%06D", I, (INTN)Fract);
|
||||
//}
|
||||
#endif
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user