luna/Format: Make output_(pure_)integer_data take a const reference to vstate
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-01-22 17:36:02 +01:00
parent 7f8a8cdcaf
commit 8cb9c14b1e
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -241,7 +241,7 @@ static usize to_string(usize value, usize base, char* buf, usize max, bool upper
return i;
}
static Result<void> output_integer_data(conv_state& vstate, format_state& state, char* buf, usize len)
static Result<void> output_integer_data(const conv_state& vstate, format_state& state, char* buf, usize len)
{
if (!(vstate.flags & FLAG_ZERO_PAD)) TRY(start_pad(vstate, state, len));
@ -254,7 +254,7 @@ static Result<void> output_integer_data(conv_state& vstate, format_state& state,
return {};
}
static void output_pure_integer_data(conv_state& vstate, pure_format_state& state, char* buf, usize len)
static void output_pure_integer_data(const conv_state& vstate, pure_format_state& state, char* buf, usize len)
{
if (!(vstate.flags & FLAG_ZERO_PAD)) pure_start_pad(vstate, state, len);
@ -268,7 +268,7 @@ static void output_pure_integer_data(conv_state& vstate, pure_format_state& stat
template <typename ReturnType, typename FormatStateType>
static ReturnType output_integer_generic(char specifier, conv_state& vstate, FormatStateType& state, usize value,
bool negative,
ReturnType (*output_data)(conv_state&, FormatStateType&, char*, usize))
ReturnType (*output_data)(const conv_state&, FormatStateType&, char*, usize))
{
usize base = 10;
bool uppercase = false;