[libc-commits] [libc] [libc] WIP. Add strfrom* floating-point functions to libc (PR #84629)

via libc-commits libc-commits at lists.llvm.org
Sat Mar 9 05:50:26 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e710523e408ce64c15fddf9f7dbe1248795c20d7 86107bc315450a6c8b13552cbe15369c35355ea0 -- libc/src/stdlib/strfromd.cpp libc/src/stdlib/strfromd.h libc/src/stdlib/strfromf.cpp libc/src/stdlib/strfromf.h libc/src/stdlib/strfroml.cpp libc/src/stdlib/strfroml.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/stdlib/strfromd.cpp b/libc/src/stdlib/strfromd.cpp
index 1ad8959e11..ec296a8d27 100644
--- a/libc/src/stdlib/strfromd.cpp
+++ b/libc/src/stdlib/strfromd.cpp
@@ -1,4 +1,5 @@
-//===-- Implementation of strfromd ------------------------------------------===//
+//===-- Implementation of strfromd
+//------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/src/stdlib/strfromd.h b/libc/src/stdlib/strfromd.h
index 170f374322..cb9908c17c 100644
--- a/libc/src/stdlib/strfromd.h
+++ b/libc/src/stdlib/strfromd.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for strfromd ------------------------*- C++ -*-===//
+//===-- Implementation header for strfromd ------------------------*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -13,7 +14,8 @@
 
 namespace LIBC_NAMESPACE {
 
-int strfromd(const char *__restrict s, size_t n, const char *__restrict format, double fp);
+int strfromd(const char *__restrict s, size_t n, const char *__restrict format,
+             double fp);
 
 } // namespace LIBC_NAMESPACE
 
diff --git a/libc/src/stdlib/strfromf.cpp b/libc/src/stdlib/strfromf.cpp
index 8af876c91b..29c7139ed2 100644
--- a/libc/src/stdlib/strfromf.cpp
+++ b/libc/src/stdlib/strfromf.cpp
@@ -1,4 +1,5 @@
-//===-- Implementation of strfromf ------------------------------------------===//
+//===-- Implementation of strfromf
+//------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/src/stdlib/strfromf.h b/libc/src/stdlib/strfromf.h
index 8ed0653229..ee88b49291 100644
--- a/libc/src/stdlib/strfromf.h
+++ b/libc/src/stdlib/strfromf.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for strfromf ------------------------*- C++ -*-===//
+//===-- Implementation header for strfromf ------------------------*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -13,7 +14,8 @@
 
 namespace LIBC_NAMESPACE {
 
-int strfromf(const char *__restrict s, size_t n, const char *__restrict format, float fp);
+int strfromf(const char *__restrict s, size_t n, const char *__restrict format,
+             float fp);
 
 } // namespace LIBC_NAMESPACE
 
diff --git a/libc/src/stdlib/strfroml.cpp b/libc/src/stdlib/strfroml.cpp
index 690f286f99..9efa57d64f 100644
--- a/libc/src/stdlib/strfroml.cpp
+++ b/libc/src/stdlib/strfroml.cpp
@@ -1,4 +1,5 @@
-//===-- Implementation of strfroml ------------------------------------------===//
+//===-- Implementation of strfroml
+//------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/src/stdlib/strfroml.h b/libc/src/stdlib/strfroml.h
index 6794014894..0f3e446d72 100644
--- a/libc/src/stdlib/strfroml.h
+++ b/libc/src/stdlib/strfroml.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for strfroml ------------------------*- C++ -*-===//
+//===-- Implementation header for strfroml ------------------------*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -13,7 +14,8 @@
 
 namespace LIBC_NAMESPACE {
 
-int strfroml(const char *__restrict s, size_t n, const char *__restrict format, long double fp);
+int strfroml(const char *__restrict s, size_t n, const char *__restrict format,
+             long double fp);
 
 } // namespace LIBC_NAMESPACE
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/84629


More information about the libc-commits mailing list