mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
AK: Consider long and unsigned long as integral types.
Two things I hate about C++:
1. 'int', 'signed int' and 'unsigned int' are two distinct types while
'char, 'signed char' and 'unsigned char' are *three* distinct types.
This is because 'signed int' is an alias for 'int' but 'signed char'
can't be an alias for 'char' because on some weird systems 'char' is
unsigned.
One might think why not do it the other way around, make 'int' an
alias for 'signed int' and 'char' an alias for whatever that is on
the platform, or make 'char' signed on all platforms. But who am I
to ask?
2. 'unsigned long' and 'unsigned long long' are always different types,
even if both are 64 bit numbers.
This commit fixes a few bugs that coming from this.
See Also: 1b3169f405.
This commit is contained in:
@@ -182,13 +182,18 @@ void Formatter<T, typename EnableIf<IsIntegral<T>::value>::Type>::format(StringB
|
||||
|
||||
template struct Formatter<StringView>;
|
||||
template struct Formatter<String>;
|
||||
template struct Formatter<u8, void>;
|
||||
template struct Formatter<u16, void>;
|
||||
template struct Formatter<u32, void>;
|
||||
template struct Formatter<u64, void>;
|
||||
template struct Formatter<i8, void>;
|
||||
template struct Formatter<i16, void>;
|
||||
template struct Formatter<i32, void>;
|
||||
template struct Formatter<i64, void>;
|
||||
template struct Formatter<unsigned char, void>;
|
||||
template struct Formatter<unsigned short, void>;
|
||||
template struct Formatter<unsigned int, void>;
|
||||
template struct Formatter<unsigned long, void>;
|
||||
template struct Formatter<unsigned long long, void>;
|
||||
template struct Formatter<char, void>;
|
||||
template struct Formatter<short, void>;
|
||||
template struct Formatter<int, void>;
|
||||
template struct Formatter<long, void>;
|
||||
template struct Formatter<long long, void>;
|
||||
|
||||
// C++ is weird.
|
||||
template struct Formatter<signed char, void>;
|
||||
|
||||
} // namespace AK
|
||||
|
||||
Reference in New Issue
Block a user