fix clang 13 compatibility

Signed-off-by: Сергей Исаков <sergey@iMac2017.local>
This commit is contained in:
Сергей Исаков 2022-08-12 22:09:53 +03:00
parent 3fa603faa8
commit 2313e8bac9
2 changed files with 9 additions and 5 deletions

View File

@ -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),

View File

@ -33,7 +33,7 @@
template<typename S, typename O>
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;