/Users/buildslave/jenkins/workspace/coverage/llvm-project/libcxx/src/charconv.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===----------------------------------------------------------------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #include <charconv> |
10 | | #include <string.h> |
11 | | |
12 | | #include "include/to_chars_floating_point.h" |
13 | | |
14 | | _LIBCPP_BEGIN_NAMESPACE_STD |
15 | | |
16 | | #ifndef _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10 |
17 | | |
18 | | namespace __itoa |
19 | | { |
20 | | |
21 | | _LIBCPP_FUNC_VIS char* |
22 | | __u32toa(uint32_t value, char* buffer) noexcept |
23 | 0 | { |
24 | 0 | return __base_10_u32(buffer, value); |
25 | 0 | } |
26 | | |
27 | | _LIBCPP_FUNC_VIS char* |
28 | | __u64toa(uint64_t value, char* buffer) noexcept |
29 | 0 | { |
30 | 0 | return __base_10_u64(buffer, value); |
31 | 0 | } |
32 | | |
33 | | } // namespace __itoa |
34 | | |
35 | | #endif // _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10 |
36 | | |
37 | | // The original version of floating-point to_chars was written by Microsoft and |
38 | | // contributed with the following license. |
39 | | |
40 | | // Copyright (c) Microsoft Corporation. |
41 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
42 | | |
43 | | // This implementation is dedicated to the memory of Mary and Thavatchai. |
44 | | |
45 | 0 | to_chars_result to_chars(char* __first, char* __last, float __value) { |
46 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, __value, chars_format{}, 0); |
47 | 0 | } |
48 | | |
49 | 0 | to_chars_result to_chars(char* __first, char* __last, double __value) { |
50 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, __value, chars_format{}, 0); |
51 | 0 | } |
52 | | |
53 | 0 | to_chars_result to_chars(char* __first, char* __last, long double __value) { |
54 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, static_cast<double>(__value), |
55 | 0 | chars_format{}, 0); |
56 | 0 | } |
57 | | |
58 | 0 | to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt) { |
59 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, __value, __fmt, 0); |
60 | 0 | } |
61 | | |
62 | 0 | to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt) { |
63 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, __value, __fmt, 0); |
64 | 0 | } |
65 | | |
66 | 0 | to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt) { |
67 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, static_cast<double>(__value), |
68 | 0 | __fmt, 0); |
69 | 0 | } |
70 | | |
71 | 0 | to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision) { |
72 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(__first, __last, __value, __fmt, |
73 | 0 | __precision); |
74 | 0 | } |
75 | | |
76 | 0 | to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision) { |
77 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(__first, __last, __value, __fmt, |
78 | 0 | __precision); |
79 | 0 | } |
80 | | |
81 | 0 | to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision) { |
82 | 0 | return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>( |
83 | 0 | __first, __last, static_cast<double>(__value), __fmt, __precision); |
84 | 0 | } |
85 | | |
86 | | _LIBCPP_END_NAMESPACE_STD |