mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
628e2fe933
commit
092035d883
8 changed files with 57 additions and 73 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue