diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index 06d212e02..418383c3f 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -411,7 +411,7 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume, if (!EFI_ERROR(Status)) { TagDict* PrefDict; - Status = ParseXML((const CHAR8*)PrefBuffer, &PrefDict, PrefBufferLen); + Status = ParseXML(PrefBuffer, &PrefDict, PrefBufferLen); if (!EFI_ERROR(Status)) { const TagDict* dict = PrefDict->dictPropertyForKey("Custom Profile"); if (dict) { diff --git a/rEFIt_UEFI/Platform/KextList.cpp b/rEFIt_UEFI/Platform/KextList.cpp index 2ed318f73..43485547a 100644 --- a/rEFIt_UEFI/Platform/KextList.cpp +++ b/rEFIt_UEFI/Platform/KextList.cpp @@ -36,15 +36,15 @@ XStringW GetBundleVersion(const XStringW& pathUnderSelf) EFI_STATUS Status; XStringW CFBundleVersion; XStringW InfoPlistPath; - CHAR8* InfoPlistPtr = NULL; + UINT8* InfoPlistPtr = NULL; TagDict* InfoPlistDict = NULL; const TagStruct* Prop = NULL; UINTN Size; InfoPlistPath = SWPrintf("%ls\\%ls", pathUnderSelf.wc_str(), L"Contents\\Info.plist"); - Status = egLoadFile(&self.getCloverDir(), InfoPlistPath.wc_str(), (UINT8**)&InfoPlistPtr, &Size); + Status = egLoadFile(&self.getCloverDir(), InfoPlistPath.wc_str(), &InfoPlistPtr, &Size); if (EFI_ERROR(Status)) { InfoPlistPath = SWPrintf("%ls\\%ls", pathUnderSelf.wc_str(), L"Info.plist"); - Status = egLoadFile(&self.getCloverDir(), InfoPlistPath.wc_str(), (UINT8**)&InfoPlistPtr, &Size); + Status = egLoadFile(&self.getCloverDir(), InfoPlistPath.wc_str(), &InfoPlistPtr, &Size); } if(!EFI_ERROR(Status)) { //DBG("about to parse xml file %ls\n", InfoPlistPath.wc_str()); diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 3fdaa55f0..8a4686509 100755 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -893,7 +893,7 @@ LoadNvramPlist( ) { EFI_STATUS Status; - CHAR8 *NvramPtr = NULL; + UINT8 *NvramPtr = NULL; UINTN Size = 0; DBG(" begin load gNvramDict=0x%llX\n", (uintptr_t)gNvramDict); @@ -918,7 +918,7 @@ LoadNvramPlist( // // parse it into gNvramDict // - Status = ParseXML((const CHAR8*)NvramPtr, &gNvramDict, Size); + Status = ParseXML(NvramPtr, &gNvramDict, Size); if(Status != EFI_SUCCESS) { DBG(" parsing error\n"); } diff --git a/rEFIt_UEFI/Platform/Volume.cpp b/rEFIt_UEFI/Platform/Volume.cpp index c0862926f..5615a160a 100644 --- a/rEFIt_UEFI/Platform/Volume.cpp +++ b/rEFIt_UEFI/Platform/Volume.cpp @@ -16,7 +16,7 @@ EFI_STATUS GetRootUUID (IN REFIT_VOLUME *Volume) { EFI_STATUS Status; - CHAR8 *PlistBuffer; + UINT8 *PlistBuffer; UINTN PlistLen; TagDict* Dict; const TagStruct* Prop; @@ -62,25 +62,25 @@ GetRootUUID (IN REFIT_VOLUME *Volume) // Playing Rock, Paper, Scissors to chose which settings to load. if (HasRock && HasPaper && HasScissors) { // Rock wins when all three are around - Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistR, &PlistBuffer, &PlistLen); } else if (HasRock && HasPaper) { // Paper beats rock - Status = egLoadFile(Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistP, &PlistBuffer, &PlistLen); } else if (HasRock && HasScissors) { // Rock beats scissors - Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistR, &PlistBuffer, &PlistLen); } else if (HasPaper && HasScissors) { // Scissors beat paper - Status = egLoadFile(Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistS, &PlistBuffer, &PlistLen); } else if (HasPaper) { // No match - Status = egLoadFile(Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistP, &PlistBuffer, &PlistLen); } else if (HasScissors) { // No match - Status = egLoadFile(Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistS, &PlistBuffer, &PlistLen); } else { // Rock wins by default - Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, SystemPlistR, &PlistBuffer, &PlistLen); } if (!EFI_ERROR(Status)) { diff --git a/rEFIt_UEFI/Platform/kext_inject.cpp b/rEFIt_UEFI/Platform/kext_inject.cpp index 1ed9cdd6f..c4042f0c1 100644 --- a/rEFIt_UEFI/Platform/kext_inject.cpp +++ b/rEFIt_UEFI/Platform/kext_inject.cpp @@ -174,7 +174,7 @@ TagDict* LOADER_ENTRY::getInfoPlist(const EFI_FILE* Root, const XStringW& infoPl Status = egLoadFile(Root, infoPlistPath.wc_str(), &infoDictBuffer, &infoDictBufferLength); if (!EFI_ERROR(Status)) { //double check - if( ParseXML((CHAR8*)infoDictBuffer, &dict, infoDictBufferLength)!=0 ) { + if( ParseXML(infoDictBuffer, &dict, infoDictBufferLength)!=0 ) { MsgLog("Failed to parse Info.plist: %ls\n", infoPlistPath.wc_str()); dict = NULL; } diff --git a/rEFIt_UEFI/Platform/plist/TagDict.h b/rEFIt_UEFI/Platform/plist/TagDict.h index b3c7dbcd5..7845d957a 100644 --- a/rEFIt_UEFI/Platform/plist/TagDict.h +++ b/rEFIt_UEFI/Platform/plist/TagDict.h @@ -63,7 +63,7 @@ public: EFI_STATUS ParseXML( - CONST CHAR8 *buffer, + CONST UINT8 *buffer, TagDict** dict, size_t bufSize ); diff --git a/rEFIt_UEFI/Platform/plist/plist.cpp b/rEFIt_UEFI/Platform/plist/plist.cpp index e8e497bcc..69031a41c 100755 --- a/rEFIt_UEFI/Platform/plist/plist.cpp +++ b/rEFIt_UEFI/Platform/plist/plist.cpp @@ -134,7 +134,7 @@ XBool TagStruct::isFalseOrNn() const // tag pointer and returns the end of the dic, or returns ?? if not found. // -EFI_STATUS ParseXML(const CHAR8* buffer, TagDict** dict, size_t bufSize) +EFI_STATUS ParseXML(const UINT8* buffer, TagDict** dict, size_t bufSize) { EFI_STATUS Status; UINT32 length = 0; @@ -147,7 +147,7 @@ EFI_STATUS ParseXML(const CHAR8* buffer, TagDict** dict, size_t bufSize) if (bufSize) { bufferSize = bufSize; } else { - bufferSize = (UINT32)strlen(buffer); + bufferSize = (UINT32)strlen((CHAR8*)buffer); } DBG("buffer size=%ld\n", bufferSize); if(dict == NULL) { diff --git a/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp b/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp index 322288ffc..df15833e0 100755 --- a/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp +++ b/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp @@ -911,12 +911,12 @@ kk \ int ParseXML_tests() { TagDict* dict = NULL; - EFI_STATUS Status = ParseXML(config_all, &dict, (UINT32)strlen(config_all)); + EFI_STATUS Status = ParseXML((UINT8*)config_all, &dict, (UINT32)strlen(config_all)); if ( !EFI_ERROR(Status) ) { XString8 s; dict->sprintf(0, &s); TagDict* dict2 = NULL; - Status = ParseXML(s.c_str(), &dict2, s.length()); + Status = ParseXML((UINT8*)s.c_str(), &dict2, s.length()); if ( !EFI_ERROR(Status) ) { if ( !(*dict).debugIsEqual(*dict2, "plist"_XS8) ) { // printf("%s", s.c_str()); diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 75088c8c9..415953451 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -455,7 +455,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const XString8 OSVersion; XString8 BuildVersion; EFI_STATUS Status = EFI_NOT_FOUND; - CHAR8* PlistBuffer = NULL; + UINT8* PlistBuffer = NULL; UINTN PlistLen; TagDict* Dict = NULL; const TagDict* DictPointer = NULL; @@ -479,7 +479,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const } if ( plist.notEmpty() ) { // found macOS System - Status = egLoadFile(Volume->RootDir, plist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, plist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { @@ -533,7 +533,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const } } if (FileExists (Volume->RootDir, InstallerPlist)) { - Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { @@ -572,7 +572,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const if (OSVersion.isEmpty()) { InstallerPlist = SWPrintf("\\.IABootFiles\\com.apple.Boot.plist"); // 10.9 - ... if (FileExists (Volume->RootDir, InstallerPlist)) { - Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("Kernel Flags"); if ( Prop != NULL ) { @@ -637,7 +637,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const } } if (FileExists (Volume->RootDir, InstallerPlist)) { - Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, InstallerPlist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { @@ -751,7 +751,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const if ( plist.notEmpty() ) { // found macOS System - Status = egLoadFile(Volume->RootDir, plist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, plist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { @@ -796,7 +796,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const // Detect exact version for OS X Recovery if ( plist.notEmpty() ) { // found macOS System - Status = egLoadFile(Volume->RootDir, plist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + Status = egLoadFile(Volume->RootDir, plist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { @@ -1717,12 +1717,12 @@ XString8 GetAuthRootDmg(const EFI_FILE& dir, const XStringW& path) XStringW plist = SWPrintf("%ls\\com.apple.Boot.plist", path.wc_str()); if ( !FileExists(dir, plist) ) return NullXString8; - CHAR8* PlistBuffer = NULL; + UINT8* PlistBuffer = NULL; UINTN PlistLen; TagDict* Dict = NULL; const TagStruct* Prop = NULL; - EFI_STATUS Status = egLoadFile(&dir, plist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + EFI_STATUS Status = egLoadFile(&dir, plist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("Kernel Flags"); @@ -1764,12 +1764,12 @@ MacOsVersion GetMacOSVersionFromFolder(const EFI_FILE& dir, const XStringW& path } if ( plist.notEmpty() ) { // found macOS System - CHAR8* PlistBuffer = NULL; + UINT8* PlistBuffer = NULL; UINTN PlistLen; TagDict* Dict = NULL; const TagStruct* Prop = NULL; - EFI_STATUS Status = egLoadFile(&dir, plist.wc_str(), (UINT8 **)&PlistBuffer, &PlistLen); + EFI_STATUS Status = egLoadFile(&dir, plist.wc_str(), &PlistBuffer, &PlistLen); if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) { Prop = Dict->propertyForKey("ProductVersion"); if ( Prop != NULL ) { diff --git a/rEFIt_UEFI/libeg/XImage.h b/rEFIt_UEFI/libeg/XImage.h index 2e1d19be3..f663a7940 100644 --- a/rEFIt_UEFI/libeg/XImage.h +++ b/rEFIt_UEFI/libeg/XImage.h @@ -54,11 +54,7 @@ public: XImage& operator= (const XImage& other); -protected: UINTN GetSizeInBytes() const; //in bytes - -public: - void setSizeInPixels(UINTN W, UINTN H); const XArray& GetData() const; diff --git a/rEFIt_UEFI/libeg/XTheme.cpp b/rEFIt_UEFI/libeg/XTheme.cpp index 3cf69e400..0826c7bfc 100644 --- a/rEFIt_UEFI/libeg/XTheme.cpp +++ b/rEFIt_UEFI/libeg/XTheme.cpp @@ -372,9 +372,9 @@ TagDict* XTheme::LoadTheme(const XStringW& TestTheme) DBG("Using vector theme '%ls' (%ls)\n", TestTheme.wc_str(), m_ThemePath.wc_str()); } } else { - Status = egLoadFile(ThemeDir, CONFIG_THEME_FILENAME, (UINT8**)&ThemePtr, &Size); + Status = egLoadFile(ThemeDir, CONFIG_THEME_FILENAME, &ThemePtr, &Size); if (!EFI_ERROR(Status) && (ThemePtr != NULL) && (Size != 0)) { - Status = ParseXML((CHAR8*)ThemePtr, &ThemeDict, 0); + Status = ParseXML(ThemePtr, &ThemeDict, 0); if (EFI_ERROR(Status)) { ThemeDict = NULL; }