[vlc-devel] [PATCH 02/19] charset: move documentation to vlc_charset.h

Kartik Ohri kartikohri13 at gmail.com
Thu Jul 23 15:18:17 CEST 2020


Move documentation for VLC API methods us_strtod, us_strtof,
us_atof, us_vasprintf and us_asprintf from src/text/charset.c
to include/vlc_charset.h.
---
 include/vlc_charset.h | 25 +++++++++++++++++++++++++
 src/text/charset.c    | 24 ------------------------
 2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/include/vlc_charset.h b/include/vlc_charset.h
index 0ec1734dc9..1f8e7f6f90 100644
--- a/include/vlc_charset.h
+++ b/include/vlc_charset.h
@@ -349,10 +349,35 @@ static inline char *FromLatin1 (const char *latin)
  * \defgroup c_locale C/POSIX locale functions
  * @{
  */
+
+/**
+ * us_strtod() has the same prototype as ANSI C strtod() but it uses the
+ * POSIX/C decimal format, regardless of the current numeric locale.
+ */
 VLC_API double us_strtod( const char *, char ** ) VLC_USED;
+
+/**
+ * us_strtof() has the same prototype as ANSI C strtof() but it uses the
+ * POSIX/C decimal format, regardless of the current numeric locale.
+ */
 VLC_API float us_strtof( const char *, char ** ) VLC_USED;
+
+/**
+ * us_atof() has the same prototype as ANSI C atof() but it expects a dot
+ * as decimal separator, regardless of the system locale.
+ */
 VLC_API double us_atof( const char * ) VLC_USED;
+
+/**
+ * us_vasprintf() has the same prototype as vasprintf(), but doesn't use
+ * the system locale.
+ */
 VLC_API int us_vasprintf( char **, const char *, va_list );
+
+/**
+ * us_asprintf() has the same prototype as asprintf(), but doesn't use
+ * the system locale.
+ */
 VLC_API int us_asprintf( char **, const char *, ... ) VLC_USED;
 /** @} */
 /** @} */
diff --git a/src/text/charset.c b/src/text/charset.c
index 0cb2322654..a901e1a9f5 100644
--- a/src/text/charset.c
+++ b/src/text/charset.c
@@ -43,10 +43,6 @@
 #include "libvlc.h"
 #include <vlc_charset.h>
 
-/**
- * us_strtod() has the same prototype as ANSI C strtod() but it uses the
- * POSIX/C decimal format, regardless of the current numeric locale.
- */
 double us_strtod( const char *str, char **end )
 {
     locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
@@ -61,11 +57,6 @@ double us_strtod( const char *str, char **end )
     return res;
 }
 
-
-/**
- * us_strtof() has the same prototype as ANSI C strtof() but it uses the
- * POSIX/C decimal format, regardless of the current numeric locale.
- */
 float us_strtof( const char *str, char **end )
 {
     locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
@@ -80,21 +71,11 @@ float us_strtof( const char *str, char **end )
     return res;
 }
 
-
-/**
- * us_atof() has the same prototype as ANSI C atof() but it expects a dot
- * as decimal separator, regardless of the system locale.
- */
 double us_atof( const char *str )
 {
     return us_strtod( str, NULL );
 }
 
-
-/**
- * us_vasprintf() has the same prototype as vasprintf(), but doesn't use
- * the system locale.
- */
 int us_vasprintf( char **ret, const char *format, va_list ap )
 {
     locale_t loc = newlocale( LC_NUMERIC_MASK, "C", NULL );
@@ -111,11 +92,6 @@ int us_vasprintf( char **ret, const char *format, va_list ap )
     return i_rc;
 }
 
-
-/**
- * us_asprintf() has the same prototype as asprintf(), but doesn't use
- * the system locale.
- */
 int us_asprintf( char **ret, const char *format, ... )
 {
     va_list ap;
-- 
2.25.1



More information about the vlc-devel mailing list