mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
AK: Break String::number() overloads into i/l/ll and u/ul/ull
Now that we're trying to be more portable, we can't only rely on using i32/u32 and i64/u64 since different systems have different combinations of int/long/long long and unsigned/unsigned long/unsigned long long.
This commit is contained in:
parent
5b7924b9e7
commit
90b1dafeff
2 changed files with 31 additions and 20 deletions
19
AK/String.h
19
AK/String.h
|
@ -231,19 +231,12 @@ public:
|
|||
}
|
||||
|
||||
static String format(const char*, ...);
|
||||
static String number(u64);
|
||||
static String number(u32);
|
||||
static String number(i32);
|
||||
static String number(i64);
|
||||
|
||||
static String number(size_t n)
|
||||
{
|
||||
if constexpr(sizeof(size_t) == 4)
|
||||
return number((u32)n);
|
||||
else if constexpr(sizeof(size_t) == 8)
|
||||
return number((u64)n);
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
static String number(unsigned);
|
||||
static String number(unsigned long);
|
||||
static String number(unsigned long long);
|
||||
static String number(int);
|
||||
static String number(long);
|
||||
static String number(long long);
|
||||
|
||||
StringView view() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue