diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index 4ba8c1e97..baef145d7 100755 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -104,7 +104,11 @@ MEM_STRUCTURE gRAM; #define SMBIOS_PTR SIGNATURE_32('_','S','M','_') #define MAX_TABLE_SIZE 512 -#define smbios_offsetof(s,m) ( (SMBIOS_TABLE_STRING) ((UINT8*)&((s*)0)->m - (UINT8*)0)) +//#define smbios_offsetof(s,m) ( (SMBIOS_TABLE_STRING) ((UINT8*)&((s*)0)->m - (UINT8*)0)) +#ifndef smbios_offsetof +# define smbios_offsetof(TYPE, MEMBER) ((SMBIOS_TABLE_STRING)((size_t) &((TYPE *)0)->MEMBER)) +#endif + SMBIOS_TABLE_STRING SMBIOS_TABLE_TYPE0_STR_IDX[] = { smbios_offsetof(SMBIOS_TABLE_TYPE0, Vendor), diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index cdc0e69b7..ebdeac034 100644 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -33,7 +33,7 @@ template int XStringAbstract__startWith(const S* src, const O* other, bool ignoreCase) { - size_t nb = 0; +// size_t nb = 0; const S* src2 = src; const O* other2 = other; @@ -50,7 +50,7 @@ int XStringAbstract__startWith(const S* src, const O* other, bool ignoreCase) if ( src_char32 != other_char32 ) return false; src2 = get_char32_from_string(src2, &src_char32); other2 = get_char32_from_string(other2, &other_char32); - nb += 1; +// nb += 1; }; return src_char32 != 0; } @@ -89,7 +89,7 @@ int XStringAbstract__compare(const S* src, const O* other, bool ignoreCase) if ( other == NULL || *other == 0 ) return 1; // size_t len_s = length_of_utf_string(src); // size_t len_other = length_of_utf_string(other); - size_t nb = 0; +// size_t nb = 0; const S* src2 = src; const O* other2 = other; @@ -105,7 +105,7 @@ int XStringAbstract__compare(const S* src, const O* other, bool ignoreCase) if ( src_char32 != other_char32 ) break; src2 = get_char32_from_string(src2, &src_char32); other2 = get_char32_from_string(other2, &other_char32); - nb += 1; +// nb += 1; }; if ( src_char32 == other_char32 ) return 0; return src_char32 > other_char32 ? 1 : -1;