diff mbox series

[FFmpeg-devel,v2,25/33] avutil: remove FF_API_D2STR

Message ID 20230204104204.20721-26-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,v2,01/33] avformat/avformat: Remove AVOutputFormat.data_codec | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Anton Khirnov Feb. 4, 2023, 10:41 a.m. UTC
From: James Almer <jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/avstring.c       | 10 ----------
 libavutil/avstring.h       |  9 ---------
 libavutil/tests/avstring.c | 16 ----------------
 libavutil/version.h        |  1 -
 4 files changed, 36 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 5ddbe9219e8..e460b5be7f3 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -139,16 +139,6 @@  end:
     return p;
 }
 
-#if FF_API_D2STR
-char *av_d2str(double d)
-{
-    char *str = av_malloc(16);
-    if (str)
-        snprintf(str, 16, "%f", d);
-    return str;
-}
-#endif
-
 #define WHITESPACES " \n\t\r"
 
 char *av_get_token(const char **buf, const char *term)
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 74aa4cd0e4e..e2602637630 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -157,15 +157,6 @@  static inline size_t av_strnlen(const char *s, size_t len)
  */
 char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
 
-#if FF_API_D2STR
-/**
- * Convert a number to an av_malloced string.
- * @deprecated  use av_asprintf() with "%f" or a more specific format
- */
-attribute_deprecated
-char *av_d2str(double d);
-#endif
-
 /**
  * Unescape the given string until a non escaped terminating char,
  * and return the token corresponding to the unescaped string.
diff --git a/libavutil/tests/avstring.c b/libavutil/tests/avstring.c
index 37a2cf18334..bc0bde358d5 100644
--- a/libavutil/tests/avstring.c
+++ b/libavutil/tests/avstring.c
@@ -109,21 +109,5 @@  int main(void)
     TEST_STRIREPLACE(haystack, needle [2], "Education consists mainly in what we have instead.");
     TEST_STRIREPLACE(haystack, needle [1], "Education consists mainly in what we have instead");
 
-#if FF_API_D2STR
-FF_DISABLE_DEPRECATION_WARNINGS
-    /*Testing av_d2str()*/
-    #define TEST_D2STR(value, expected) \
-        if((ptr = av_d2str(value)) == NULL){ \
-            printf("error, received null pointer!\n"); \
-        } else { \
-            if(strcmp(ptr, expected) != 0) \
-                printf( "expected: %s, received: %s\n", expected, ptr); \
-            av_free(ptr); \
-        }
-    TEST_D2STR(0         ,  "0.000000");
-    TEST_D2STR(-1.2333234, "-1.233323");
-    TEST_D2STR(-1.2333237, "-1.233324");
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
     return 0;
 }
diff --git a/libavutil/version.h b/libavutil/version.h
index 60f96af5df8..38769962cc3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@ 
  * @{
  */
 
-#define FF_API_D2STR                    (LIBAVUTIL_VERSION_MAJOR < 58)
 #define FF_API_DECLARE_ALIGNED          (LIBAVUTIL_VERSION_MAJOR < 58)
 #define FF_API_COLORSPACE_NAME          (LIBAVUTIL_VERSION_MAJOR < 58)
 #define FF_API_AV_MALLOCZ_ARRAY         (LIBAVUTIL_VERSION_MAJOR < 58)