mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-01-22 21:01:31 +01:00
Fix void* cast and enum cast (prepa C++)
This commit is contained in:
parent
6f04c95981
commit
a79acfcd24
@ -1186,7 +1186,7 @@ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* GetFadt()
|
||||
|
||||
// EFI_STATUS Status;
|
||||
|
||||
RsdPtr = FindAcpiRsdPtr();
|
||||
RsdPtr = (__typeof(RsdPtr))FindAcpiRsdPtr();
|
||||
if (RsdPtr == NULL) {
|
||||
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (VOID **)&RsdPtr);
|
||||
if (RsdPtr == NULL) {
|
||||
|
@ -459,7 +459,7 @@ EFI_STATUS BdsLibConnectMostlyAllEfi()
|
||||
|
||||
if (!Parent) {
|
||||
if (HandleType[Index] & EFI_HANDLE_TYPE_DEVICE_HANDLE) {
|
||||
Status = gBS->HandleProtocol (AllHandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID*)&PciIo);
|
||||
Status = gBS->HandleProtocol (AllHandleBuffer[Index], &gEfiPciIoProtocolGuid, (VOID**)&PciIo);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = PciIo->Pci.Read (PciIo,EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
@ -238,7 +238,7 @@ EFI_STATUS GetBiosDriveCRC32(UINT8 DriveNum,
|
||||
// read first 2 sectors
|
||||
Status = BiosReadSectorsFromDrive(DriveNum, 0, 2, Dap, Buffer);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
*DriveCRC32 = GetCrc32(Buffer, 2 * 512);
|
||||
*DriveCRC32 = GetCrc32((UINT8*)Buffer, 2 * 512);
|
||||
//gBS->CalculateCrc32(Buffer, 2 * 512, DriveCRC32);
|
||||
DBG("Bios drive CRC32 = 0x%x\n", *DriveCRC32);
|
||||
}
|
||||
|
@ -713,15 +713,15 @@ struct Symbol {
|
||||
|
||||
typedef struct Symbol Symbol, *SymbolPtr;
|
||||
|
||||
typedef struct {
|
||||
typedef struct TagStruct {
|
||||
|
||||
UINTN type;
|
||||
CHAR8 *string;
|
||||
UINT8 *data;
|
||||
UINTN dataLen;
|
||||
UINTN offset;
|
||||
VOID *tag;
|
||||
VOID *tagNext;
|
||||
struct TagStruct *tag;
|
||||
struct TagStruct *tagNext;
|
||||
|
||||
} TagStruct, *TagPtr;
|
||||
|
||||
|
@ -421,7 +421,7 @@ ParseLoadOptions (
|
||||
VOID
|
||||
GetBootFromOption(VOID)
|
||||
{
|
||||
UINT8 *Data = SelfLoadedImage->LoadOptions;
|
||||
UINT8 *Data = (UINT8*)SelfLoadedImage->LoadOptions;
|
||||
UINTN Len = SelfLoadedImage->LoadOptionsSize;
|
||||
UINTN NameSize, Name2Size;
|
||||
|
||||
@ -557,7 +557,7 @@ SetBootCurrent(REFIT_MENU_ENTRY *LoadedEntry)
|
||||
// data can be specified in <data></data> base64 encoded
|
||||
// or in <string></string> hex encoded
|
||||
//
|
||||
VOID
|
||||
UINT8
|
||||
*GetDataSetting (
|
||||
IN TagPtr Dict,
|
||||
IN CHAR8 *PropName,
|
||||
@ -5656,7 +5656,7 @@ GetUserSettings(
|
||||
gSettings.PatchDsdtReplace[i] = GetDataSetting (Prop2, "Replace", &Size);
|
||||
DBG (", lenToReplace: %d", Size);
|
||||
gSettings.LenToReplace[i] = (UINT32)Size;
|
||||
gSettings.PatchDsdtTgt[i] = GetDataSetting (Prop2, "TgtBridge", &Size);
|
||||
gSettings.PatchDsdtTgt[i] = (CHAR8*)GetDataSetting (Prop2, "TgtBridge", &Size);
|
||||
DBG (", Target Bridge: %a\n", gSettings.PatchDsdtTgt[i]);
|
||||
if (!gSettings.PatchDsdtMenuItem[i].BValue) {
|
||||
DBG(" patch disabled at config\n");
|
||||
@ -8160,7 +8160,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
mProperties = (UINT8*)(UINTN)BufferPtr;
|
||||
gDeviceProperties = (VOID*)devprop_generate_string (device_inject_string);
|
||||
gDeviceProperties = devprop_generate_string (device_inject_string);
|
||||
gDeviceProperties[device_inject_stringlength] = 0;
|
||||
// DBG (gDeviceProperties);
|
||||
// DBG ("\n");
|
||||
|
@ -421,7 +421,7 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
|
||||
aml_calculate_size(root);
|
||||
|
||||
ssdt = (SSDT_TABLE *)AllocateZeroPool(root->Size);
|
||||
aml_write_node(root, (VOID*)ssdt, 0);
|
||||
aml_write_node(root, (CHAR8*)ssdt, 0);
|
||||
ssdt->Length = root->Size;
|
||||
FixChecksum(ssdt);
|
||||
//ssdt->Checksum = 0;
|
||||
@ -641,7 +641,7 @@ SSDT_TABLE *generate_cst_ssdt(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, U
|
||||
|
||||
ssdt = (SSDT_TABLE *)AllocateZeroPool(root->Size);
|
||||
|
||||
aml_write_node(root, (VOID*)ssdt, 0);
|
||||
aml_write_node(root, (CHAR8*)ssdt, 0);
|
||||
|
||||
ssdt->Length = root->Size;
|
||||
FixChecksum(ssdt);
|
||||
|
@ -31,7 +31,7 @@ BootArgs1 *bootArgs1 = NULL;
|
||||
BootArgs2 *bootArgs2 = NULL;
|
||||
CHAR8 *dtRoot = NULL;
|
||||
UINT32 *dtLength;
|
||||
VOID *KernelData = NULL;
|
||||
UINT8 *KernelData = NULL;
|
||||
UINT32 KernelSlide = 0;
|
||||
BOOLEAN isKernelcache = FALSE;
|
||||
BOOLEAN is64BitKernel = FALSE;
|
||||
@ -1831,9 +1831,9 @@ KernelAndKextPatcherInit(IN LOADER_ENTRY *Entry)
|
||||
|
||||
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
|
||||
if (os_version < AsciiOSVersionToUint64("10.6")) {
|
||||
KernelData = (VOID*)(UINTN)(KernelSlide + KernelRelocBase + 0x00111000);
|
||||
KernelData = (UINT8*)(UINTN)(KernelSlide + KernelRelocBase + 0x00111000);
|
||||
} else {
|
||||
KernelData = (VOID*)(UINTN)(KernelSlide + KernelRelocBase + 0x00200000);
|
||||
KernelData = (UINT8*)(UINTN)(KernelSlide + KernelRelocBase + 0x00200000);
|
||||
}
|
||||
|
||||
// check that it is Mach-O header and detect architecture
|
||||
|
@ -77,7 +77,7 @@ extern BootArgs1 *bootArgs1;
|
||||
extern BootArgs2 *bootArgs2;
|
||||
extern CHAR8 *dtRoot;
|
||||
extern UINT32 *dtLength;
|
||||
extern VOID *KernelData;
|
||||
extern UINT8 *KernelData;
|
||||
extern UINT32 KernelSlide;
|
||||
extern BOOLEAN isKernelcache;
|
||||
extern BOOLEAN is64BitKernel;
|
||||
|
@ -1302,9 +1302,9 @@ VOID SetDMISettingsForModel(MACHINE_TYPES Model, BOOLEAN Redefine)
|
||||
|
||||
MACHINE_TYPES GetModelFromString(CHAR8 *ProductName)
|
||||
{
|
||||
UINTN i;
|
||||
MACHINE_TYPES i;
|
||||
|
||||
for (i = 0; i < MaxMachineType; ++i) {
|
||||
for (i = (MACHINE_TYPES)(0); i < MaxMachineType; i = (MACHINE_TYPES)(i + 1)) {
|
||||
if (AsciiStrCmp (ApplePlatformData[i].productName, ProductName) == 0) {
|
||||
return i;
|
||||
}
|
||||
|
@ -180,16 +180,16 @@ VOID* GetSmbiosTablesFromHob (VOID)
|
||||
EFI_PHYSICAL_ADDRESS *Table;
|
||||
EFI_PEI_HOB_POINTERS GuidHob;
|
||||
|
||||
GuidHob.Raw = GetFirstGuidHob (&gEfiSmbiosTableGuid);
|
||||
GuidHob.Raw = (__typeof(GuidHob.Raw))GetFirstGuidHob (&gEfiSmbiosTableGuid);
|
||||
if (GuidHob.Raw != NULL) {
|
||||
Table = GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
Table = (__typeof(Table))GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
if (Table != NULL) {
|
||||
return (VOID *)(UINTN)*Table;
|
||||
}
|
||||
}
|
||||
GuidHob.Raw = GetFirstGuidHob (&gEfiSmbios3TableGuid);
|
||||
GuidHob.Raw = (__typeof(GuidHob.Raw))GetFirstGuidHob (&gEfiSmbios3TableGuid);
|
||||
if (GuidHob.Raw != NULL) {
|
||||
Table = GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
Table = (__typeof(Table))GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
if (Table != NULL) {
|
||||
return (VOID *)(UINTN)*Table;
|
||||
}
|
||||
@ -2085,14 +2085,14 @@ VOID FinalizeSmbios() //continue
|
||||
BOOLEAN FoundTable3 = FALSE;
|
||||
|
||||
// Get Hob List
|
||||
HobStart.Raw = GetHobList ();
|
||||
HobStart.Raw = (__typeof(HobStart.Raw))GetHobList();
|
||||
|
||||
if (HobStart.Raw != NULL) {
|
||||
// find SMBIOS in hob
|
||||
for (Index = 0; Index < sizeof (gTableGuidArray) / sizeof (*gTableGuidArray); ++Index) {
|
||||
GuidHob.Raw = GetNextGuidHob (gTableGuidArray[Index], HobStart.Raw);
|
||||
GuidHob.Raw = (__typeof(HobStart.Raw))GetNextGuidHob (gTableGuidArray[Index], HobStart.Raw);
|
||||
if (GuidHob.Raw != NULL) {
|
||||
Table = GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
Table = (__typeof(Table))GET_GUID_HOB_DATA (GuidHob.Guid);
|
||||
//TableLength = GET_GUID_HOB_DATA_SIZE (GuidHob);
|
||||
if (Table != NULL) {
|
||||
if (Index != 0) {
|
||||
|
@ -152,8 +152,7 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *FullTitle, IN CHAR16 *LoaderTitl
|
||||
|
||||
Entry->Volume = Volume;
|
||||
Entry->DevicePathString = Volume->DevicePathString;
|
||||
Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" :
|
||||
((Volume->DiskKind == DISK_KIND_EXTERNAL) ? L"USB" : L"HD");
|
||||
Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" : ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? L"USB" : L"HD");
|
||||
|
||||
// create the submenu
|
||||
SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN));
|
||||
|
@ -39,7 +39,6 @@ extern void DumpFloat2 (char* s, float* t, int N);
|
||||
extern EG_IMAGE *BackgroundImage;
|
||||
extern EG_IMAGE *Banner;
|
||||
extern EG_IMAGE *BigBack;
|
||||
extern VOID *fontsDB;
|
||||
extern INTN BanHeight;
|
||||
extern INTN row0TileSize;
|
||||
extern INTN row1TileSize;
|
||||
|
@ -51,7 +51,6 @@
|
||||
#endif
|
||||
|
||||
typedef UINTN size_t;
|
||||
extern VOID *fontsDB;
|
||||
|
||||
#define NSVG_PI (3.14159265358979323846264338327f)
|
||||
#define NSVG_PI_DEG (0.01745329251994f)
|
||||
|
@ -58,9 +58,6 @@
|
||||
#define strlen(s) AsciiStrLen(s)
|
||||
#define strncpy(a,b,n) AsciiSPrint(a,n,"%a",b)
|
||||
|
||||
extern VOID *fontsDB;
|
||||
extern struct NSVGparser *mainParser;
|
||||
|
||||
enum NSVGpaintType {
|
||||
NSVG_PAINT_NONE = 0,
|
||||
NSVG_PAINT_COLOR = 1,
|
||||
@ -571,4 +568,7 @@ struct NSVGrasterizer
|
||||
int width, height, stride;
|
||||
};
|
||||
|
||||
extern NSVGfont *fontsDB;
|
||||
extern struct NSVGparser *mainParser;
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,7 @@
|
||||
//Slice 2011 - 2016 numerous improvements
|
||||
|
||||
#include "libegint.h"
|
||||
#include "nanosvg.h"
|
||||
|
||||
//#include "egemb_font.h"
|
||||
//#define FONT_CELL_WIDTH (7)
|
||||
@ -58,7 +59,7 @@ EG_IMAGE *FontImage = NULL;
|
||||
INTN FontWidth = 9;
|
||||
INTN FontHeight = 18;
|
||||
INTN TextHeight = 19;
|
||||
VOID *fontsDB = NULL;
|
||||
NSVGfont *fontsDB = NULL;
|
||||
|
||||
|
||||
CONST EG_PIXEL SemiWhitePixel = {255, 255, 255, 210}; //semitransparent
|
||||
|
@ -109,8 +109,8 @@ _PPrint (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
_SPrint (
|
||||
IN VOID *Context,
|
||||
IN CHAR16 *Buffer
|
||||
IN POOL_PRINT *Context,
|
||||
IN CHAR16 *Buffer
|
||||
);
|
||||
|
||||
UINTN
|
||||
@ -134,7 +134,7 @@ _PoolCatPrint (
|
||||
(EFIAPI
|
||||
*Output)
|
||||
(
|
||||
VOID *context,
|
||||
POOL_PRINT *context,
|
||||
CHAR16 *str
|
||||
)
|
||||
);
|
||||
@ -142,8 +142,8 @@ _PoolCatPrint (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
_PoolPrint (
|
||||
IN VOID *Context,
|
||||
IN CHAR16 *Buffer
|
||||
IN POOL_PRINT *Context,
|
||||
IN CHAR16 *Buffer
|
||||
);
|
||||
|
||||
VOID
|
||||
@ -205,7 +205,7 @@ _DbgOut (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
_SPrint (
|
||||
IN VOID *Context,
|
||||
IN POOL_PRINT *Context,
|
||||
IN CHAR16 *Buffer
|
||||
)
|
||||
/*++
|
||||
@ -268,7 +268,7 @@ _PoolCatPrint (
|
||||
(EFIAPI
|
||||
*Output)
|
||||
(
|
||||
VOID *context,
|
||||
POOL_PRINT *context,
|
||||
CHAR16 *str
|
||||
)
|
||||
)
|
||||
@ -291,7 +291,7 @@ Returns:
|
||||
PRINT_STATE ps;
|
||||
|
||||
SetMem (&ps, sizeof (ps), 0);
|
||||
ps.Output = Output;
|
||||
ps.Output = (IN EFI_STATUS (EFIAPI *)(VOID *context, CHAR16 *str))Output;
|
||||
ps.Context = spc;
|
||||
ps.fmt.u.pw = fmt;
|
||||
//ps.args = args;
|
||||
@ -1266,8 +1266,8 @@ SetOutputPause (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
_PoolPrint (
|
||||
IN VOID *Context,
|
||||
IN CHAR16 *Buffer
|
||||
IN POOL_PRINT *Context,
|
||||
IN CHAR16 *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ VOID ReinitVolumes(VOID)
|
||||
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &RemainingDevicePath, &WholeDiskHandle);
|
||||
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Volume->WholeDiskBlockIO = WholeDiskHandle;
|
||||
Volume->WholeDiskBlockIO = (__typeof__(Volume->WholeDiskBlockIO))WholeDiskHandle;
|
||||
// get the BlockIO protocol
|
||||
Status = gBS->HandleProtocol(WholeDiskHandle, &gEfiBlockIoProtocolGuid, (VOID **) &Volume->WholeDiskBlockIO);
|
||||
if (EFI_ERROR(Status)) {
|
||||
|
@ -882,7 +882,7 @@ EG_IMAGE * GetSmallHover(IN UINTN Id);
|
||||
// menu module
|
||||
//
|
||||
|
||||
#define MENU_EXIT_ENTER (1)
|
||||
#define MENU_EXIT_ENTER ((ACTION)(1))
|
||||
#define MENU_EXIT_ESCAPE (2)
|
||||
#define MENU_EXIT_DETAILS (3)
|
||||
#define MENU_EXIT_TIMEOUT (4)
|
||||
|
@ -628,7 +628,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
|
||||
/*
|
||||
Start OSName Mac OS X 10.12 End OSName Start OSVendor Apple Inc. End
|
||||
*/
|
||||
InstallerVersion = SearchString(LoadedImage->ImageBase, LoadedImage->ImageSize, "Mac OS X ", 9);
|
||||
InstallerVersion = SearchString((CHAR8*)LoadedImage->ImageBase, LoadedImage->ImageSize, "Mac OS X ", 9);
|
||||
|
||||
if (InstallerVersion != NULL) { // string was found
|
||||
InstallerVersion += 9; // advance to version location
|
||||
@ -678,7 +678,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
|
||||
FilterKextPatches(Entry);
|
||||
FilterKernelPatches(Entry);
|
||||
FilterBootPatches(Entry);
|
||||
if (LoadedImage && !BooterPatch(LoadedImage->ImageBase, LoadedImage->ImageSize, Entry)) {
|
||||
if (LoadedImage && !BooterPatch((UINT8*)LoadedImage->ImageBase, LoadedImage->ImageSize, Entry)) {
|
||||
DBG("Will not patch boot.efi\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user