core: simplify custom strtod() interface

The strtod_flags() function allowed for fine control of how to
parse strings. However, only two different modes were actually
used: ascii mode ("C" locale) and permissive mode (accept ","
and "." as decimal separator).

The former had already its own function name (ascii_strtod).
Make the latter a separatge function as well (permissive_strtod)
and remove all the flags rigmarole.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-04-23 15:06:28 +08:00 committed by bstoeger
parent 628e2fe933
commit 092035d883
8 changed files with 57 additions and 73 deletions

View file

@ -168,7 +168,7 @@ static enum number_type parse_float(const char *buffer, double &res, const char
first_time = false;
}
/* Try again in permissive mode*/
val = strtod_flags(buffer, &endp, 0);
val = permissive_strtod(buffer, &endp);
}
}