summaryrefslogtreecommitdiff
path: root/lib/libc/locale/wcstold.c
Commit message (Collapse)AuthorAgeFilesLines
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Fix error reporting from wcstof()Eric van Gyzen2016-11-201-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When wcstof() skipped initial space and then parsing failed, it set endptr to the first non-space character. Fix it to correctly report failure by setting endptr to the beginning of the input string. The fix is from theraven@, who fixed this bug in wcstod() and wcstold() in r227753. While I'm here: Move assignments out of declarations in wcstod() and wcstold(). This is against my personal preference, but it is our agreed style(9). Set endptr correctly on malloc() failure in all three functions. Remove an incorrect comment: This is pointer arithmetic, so the code was not actually making that assumption. wcstold() advanced the wcp pointer beyond leading whitespace and then reset it back to the beginning of the string. Do not reset it. This seems to have no functional effect, since strtold_l() also skips leading whitespace. I'm making the change to keep this function consistent with wcstof() and wcstod(), and because the C11 spec prescribes the use of iswspace() to skip leading space. Reported by: libc++ unit test for std::stof(std::wstring) MFC after: 8 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=308904
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds aDavid Chisnall2011-11-201-8/+28
| | | | | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor) Notes: svn path=/head/; revision=227753
* Prepare to handle state-dependent encodings. This mainly involves notTim J. Robbins2004-04-071-2/+6
| | | | | | | | taking shortcuts when it comes to storing and passing around conversion states. Notes: svn path=/head/; revision=127998
* Remove unused variables and function declarations. Add missing headers.Jacques Vidrine2004-01-061-2/+2
| | | | Notes: svn path=/head/; revision=124174
* Don't bother passing a freshly-zeroed mbstate to mbsrtowcs() etc.Tim J. Robbins2003-10-311-21/+3
| | | | | | | | | | when the current implementation won't use it, anyway. Just pass NULL. This will need to be changed when state-dependent encodings are supported, but there's no need to take the performance hit in the meantime. Notes: svn path=/head/; revision=121796
* MFp4: Implementations of the wcstof() and wcstold() functions.Tim J. Robbins2003-03-131-0/+84
Notes: svn path=/head/; revision=112177