Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MdePkg/Include/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ typedef char* VA_LIST;
#define VA_END(Marker) (Marker = (VA_LIST) 0)
#define VA_COPY(Dest, Start) ((void)((Dest) = (Start)))

#elif defined(__GNUC__) || defined(__clang__) //SI?
#elif defined(__GNUC__) || defined(__clang__)

#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)
//
Expand Down
2 changes: 1 addition & 1 deletion rEFIt_UEFI/Platform/APFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EFI_GUID APFSPartitionUUIDExtract(
}
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
//Check that vendor-assigned EFI_GUID defines APFS Container Partition
if ( ApfsSignatureUUID == *(const EFI_GUID *)((UINT8 *)DevicePath+0x04) ) {
if ( ApfsSignatureUUID == *(EFI_GUID *)((UINT8 *)DevicePath+0x04) ) {
return *(EFI_GUID *)((UINT8 *)DevicePath+0x14);
}
}
Expand Down
5 changes: 0 additions & 5 deletions rEFIt_UEFI/PlatformEFI/cpp_util/operatorNewDelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ void operator delete ( void* ptr ) noexcept
FreePool(ptr);
}

void operator delete[](void* ptr) noexcept
{
FreePool(ptr);
}

#ifdef _MSC_VER
void _cdecl operator delete (void * ptr, unsigned __int64 count)
#else
Expand Down
9 changes: 2 additions & 7 deletions rEFIt_UEFI/PlatformPOSIX+EFI/cpp_util/operatorNewDelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ void operator delete ( void* ptr ) noexcept
{
// ++operator_delete_count1;
// MemLogf(false, 0, "operator delete(%llx) %lld\n", uintptr_t(ptr), operator_delete_count1);
FreePool(ptr);
}

void operator delete[](void* ptr) noexcept
{
FreePool(ptr);
return FreePool(ptr);
}

#ifdef _MSC_VER
Expand All @@ -64,7 +59,7 @@ void operator delete (void * ptr, UINTN count)
{
// ++operator_delete_count2;
// MemLogf(false, 0, "operator delete(%llx, %lld) %lld\n", uintptr_t(ptr), count, operator_delete_count2);
FreePool(ptr);
return FreePool(ptr);
}


Expand Down
9 changes: 2 additions & 7 deletions rEFIt_UEFI/PlatformPOSIX/cpp_util/operatorNewDelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ void operator delete ( void* ptr ) noexcept
{
// ++operator_delete_count1;
// MemLogf(false, 0, "operator delete(%llx) %lld\n", uintptr_t(ptr), operator_delete_count1);
FreePool(ptr);
}

void operator delete[](void* ptr) noexcept
{
FreePool(ptr);
return FreePool(ptr);
}

#ifdef _MSC_VER
Expand All @@ -64,7 +59,7 @@ void operator delete (void * ptr, UINTN count)
{
// ++operator_delete_count2;
// MemLogf(false, 0, "operator delete(%llx, %lld) %lld\n", uintptr_t(ptr), count, operator_delete_count2);
FreePool(ptr);
return FreePool(ptr);
}


Expand Down
28 changes: 12 additions & 16 deletions rEFIt_UEFI/cpp_foundation/XStringAbstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,8 @@ class __String {
}

ThisXStringClass subString(size_t pos, size_t count) const {
size_t len = length();
if (pos >= len || count == 0) return ThisXStringClass();
if (count > len - pos) count = len - pos;
// if ( pos > length() ) return ThisXStringClass();
// if ( count > length()-pos ) count = length()-pos;

ThisXStringClass ret;

Expand Down Expand Up @@ -1015,11 +1014,11 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {
*this = S;
}

~XStringAbstract() {
// DBG_XSTRING("Destructor :%ls\n", data());
if (m_allocatedSize > 0)
delete[] super::__m_data;
}
~XStringAbstract() {
// DBG_XSTRING("Destructor :%ls\n", data());
if (m_allocatedSize > 0)
delete super::__m_data;
}

#ifdef XSTRING_CACHING_OF_SIZE
/* ctor */
Expand Down Expand Up @@ -1086,13 +1085,10 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {
#endif
/* Copy Assign */
XStringAbstract &operator=(const XStringAbstract &S) {
if (this == &S) {
return *this;
}
if (S.data() && S.m_allocatedSize == 0) {
// S points to a litteral
if (m_allocatedSize > 0) {
delete[] super::__m_data;
delete super::__m_data;
m_allocatedSize = 0;
}
super::__m_data =
Expand All @@ -1110,7 +1106,7 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {
/* Copy Assign */
XStringAbstract &operator=(const ls_t &S) {
if (m_allocatedSize > 0) {
delete[] super::__m_data;
delete super::__m_data;
m_allocatedSize = 0;
}
super::__m_data = (T *)S.data(); // because it's a litteral, we don't copy.
Expand Down Expand Up @@ -1635,7 +1631,7 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {
/* size is in number of technical chars, NOT in bytes */
ThisXStringClass &stealValueFrom(T *S, size_t allocatedSize) {
if (m_allocatedSize > 0)
delete[] super::__m_data;
delete super::__m_data;
super::__m_data = S;
#ifdef XSTRING_CACHING_OF_SIZE
super::__m_size = utf_size_of_utf_string(super::__m_data, super::__m_data);
Expand All @@ -1648,7 +1644,7 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {
// a future realloc may fail as EDK want the old size.
ThisXStringClass &stealValueFrom(T *S) {
if (m_allocatedSize > 0)
delete[] super::__m_data;
delete super::__m_data;
super::__m_data = S;
#ifdef XSTRING_CACHING_OF_SIZE
super::__m_size = utf_size_of_utf_string(super::__m_data, super::__m_data);
Expand All @@ -1661,7 +1657,7 @@ class XStringAbstract : public __String<T, ThisXStringClass, ThisLStringClass> {

ThisXStringClass &stealValueFrom(ThisXStringClass *S) {
if (m_allocatedSize > 0)
delete[] super::__m_data;
delete super::__m_data;
#ifdef XSTRING_CACHING_OF_SIZE
super::__m_size = S->size();
#endif
Expand Down
8 changes: 1 addition & 7 deletions rEFIt_UEFI/refit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,14 +1686,8 @@ void LOADER_ENTRY::StartLoader()
(UINT8 *)SysRoot;

size_t i1 = forceKext.rindexOf("\\") + 1;
if (i1 == MAX_XSIZE) i1 = 0;
size_t i2 = forceKext.rindexOf(".");
XStringW identifier;
if (i2 != MAX_XSIZE && i2 > i1) {
identifier = forceKext.subString(i1, i2 - i1);
} else {
identifier = forceKext.subString(i1, MAX_XSIZE);
}
XStringW identifier = forceKext.subString(i1, i2 - i1);
OC_STRING_ASSIGN(
mOpenCoreConfiguration.Kernel.Force.Values[kextIdx]->Identifier,
S8Printf("%ls", identifier.wc_str()).c_str());
Expand Down
Loading