make genconfig happy

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-02-28 21:12:57 +03:00
parent b6f2478cff
commit bdc977d14f
6 changed files with 37 additions and 31 deletions

View File

@ -38,6 +38,7 @@ cc -o genconfig clover-genconfig.c gfxutil.c -framework CoreFoundation -framewor
#define __DEBUG_LIB_H__ #define __DEBUG_LIB_H__
#define _STRUCT_X86_THREAD_STATE32 #define _STRUCT_X86_THREAD_STATE32
#define _STRUCT_X86_THREAD_STATE64 #define _STRUCT_X86_THREAD_STATE64
#include "../../../rEFIt_UEFI/Platform/Platform.h" #include "../../../rEFIt_UEFI/Platform/Platform.h"
#include <IOKit/IOKitLib.h> #include <IOKit/IOKitLib.h>

View File

@ -103,6 +103,7 @@ extern "C" {
#include "../cpp_foundation/XObjArray.h" #include "../cpp_foundation/XObjArray.h"
#include "../cpp_util/remove_ref.h" #include "../cpp_util/remove_ref.h"
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#define __typeof__(x) decltype(x) #define __typeof__(x) decltype(x)
#endif #endif

View File

@ -5068,14 +5068,14 @@ GetUserSettings(
Prop2 = Prop2->tag; //take a <dict> for this device Prop2 = Prop2->tag; //take a <dict> for this device
if ((Prop2 != NULL) && (Prop2->type == kTagTypeDict)) { if ((Prop2 != NULL) && (Prop2->type == kTagTypeDict)) {
INTN j, PropCount = 0; INTN PropCount = 0;
PropCount = GetTagCount(Prop2); //properties count for this device PropCount = GetTagCount(Prop2); //properties count for this device
// DBG("Add %d properties:\n", PropCount); // DBG("Add %d properties:\n", PropCount);
for (j = 0; j < PropCount; j++) { for (INTN j = 0; j < PropCount; j++) {
Prop3 = NULL; Prop3 = NULL;
DevProps = *Child; DevProps = *Child;
*Child = (__typeof_am__(*Child))AllocateZeroPool(sizeof(**Child)); *Child = (__typeof_am__(*Child))AllocateZeroPool(sizeof(**Child));
//*Child = new (__typeof_am__(**Child)); // *Child = new (__typeof_am__(**Child));
(*Child)->Next = DevProps; (*Child)->Next = DevProps;
if (EFI_ERROR(GetElement(Prop2, j, &Prop3))) { // Prop3 -> <key> if (EFI_ERROR(GetElement(Prop2, j, &Prop3))) { // Prop3 -> <key>
@ -8222,6 +8222,7 @@ SetDevices (LOADER_ENTRY *Entry)
} }
Next = Props->Next; Next = Props->Next;
FreePool(Props); FreePool(Props);
//delete Props;
Props = Next; Props = Next;
} }
Next = Prop->Next; Next = Prop->Next;

View File

@ -1347,7 +1347,7 @@ VOID PatchTableType17()
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->DeviceLocator, (CHAR8*)&deviceLocator[0]); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->DeviceLocator, (CHAR8*)&deviceLocator[0]);
if ((gRAM.User[UserIndex].InUse) && (gRAM.User[UserIndex].ModuleSize > 0)) { if ((gRAM.User[UserIndex].InUse) && (gRAM.User[UserIndex].ModuleSize > 0)) {
if (iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) { if (iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) {
CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.User[UserIndex].Vendor)+1); // this will never be freed. Will be solved when using a string object. CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.User[UserIndex].Vendor)+1);
AsciiStrCpy(vendor, gRAM.User[UserIndex].Vendor); AsciiStrCpy(vendor, gRAM.User[UserIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.User[UserIndex].Vendor = vendor; gRAM.User[UserIndex].Vendor = vendor;
@ -1670,7 +1670,7 @@ VOID PatchTableType17()
(AsciiStrnCmp(gRAM.SPD[SPDIndex].Vendor, "NoName", 6) == 0)) { (AsciiStrnCmp(gRAM.SPD[SPDIndex].Vendor, "NoName", 6) == 0)) {
DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %a\n", gRAM.SMBIOS[SMBIOSIndex].Vendor); DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %a\n", gRAM.SMBIOS[SMBIOSIndex].Vendor);
CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object. CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object.
AsciiStrCpy(vendor, gRAM.SMBIOS[SMBIOSIndex].Vendor); AsciiStrCpyS(vendor, 64, gRAM.SMBIOS[SMBIOSIndex].Vendor);
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor);
gRAM.SMBIOS[SMBIOSIndex].Vendor = vendor; gRAM.SMBIOS[SMBIOSIndex].Vendor = vendor;
} }

View File

@ -267,11 +267,10 @@ unsigned XImage::FromSVG(const CHAR8 *SVGData, UINTN FileDataLength, float scale
{ {
NSVGimage *SVGimage; NSVGimage *SVGimage;
NSVGparser* p; NSVGparser* p;
EFI_STATUS Status;
NSVGrasterizer* rast = nsvgCreateRasterizer(); NSVGrasterizer* rast = nsvgCreateRasterizer();
if (!rast) return 1; if (!rast) return 1;
char *input = AsciiStrCpy(SVGData); char *input = (__typeof__(input))AllocateCopyPool(AsciiStrSize(SVGData), SVGData);
if (!input) return 2; if (!input) return 2;
p = nsvgParse(input, 72, 1.f); //the parse will change input contents p = nsvgParse(input, 72, 1.f); //the parse will change input contents

View File

@ -68,7 +68,9 @@
// Experimental <-- // Experimental <--
#include "libeg.h" #include "libeg.h"
#ifdef _cplusplus
#include "../cpp_foundation/XObjArray.h" #include "../cpp_foundation/XObjArray.h"
#endif
#define REFIT_DEBUG (2) #define REFIT_DEBUG (2)
#define Print if ((!GlobalConfig.Quiet) || (GlobalConfig.TextOnly)) Print #define Print if ((!GlobalConfig.Quiet) || (GlobalConfig.TextOnly)) Print
@ -694,7 +696,9 @@ extern BOOLEAN MainAnime;
extern GUI_ANIME *GuiAnime; extern GUI_ANIME *GuiAnime;
extern REFIT_VOLUME *SelfVolume; extern REFIT_VOLUME *SelfVolume;
#ifdef _cplusplus
extern XObjArray<REFIT_VOLUME> Volumes; extern XObjArray<REFIT_VOLUME> Volumes;
#endif
//extern UINTN VolumesCount; //extern UINTN VolumesCount;
extern EG_IMAGE *Banner; extern EG_IMAGE *Banner;