From patchwork Sat Feb 4 10:41:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40255 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1869372pzk; Sat, 4 Feb 2023 02:45:30 -0800 (PST) X-Google-Smtp-Source: AK7set/GyFKHT5oxk6bxkNDkxS7toLcnY0JnmctuWAj9KYfaZyYy28PtIzx8Twp/VLngVq6GRg/u X-Received: by 2002:a05:6402:f01:b0:475:dddc:374a with SMTP id i1-20020a0564020f0100b00475dddc374amr15261548eda.18.1675507529893; Sat, 04 Feb 2023 02:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675507529; cv=none; d=google.com; s=arc-20160816; b=AxJ2WgwUtws97+pxKuKZUipF5U60n8VQ0WUYY53drfQux08W3eGWLERiPLP2BVnEut OiQSyfjeNwpcPLTo+tREm8DRgU6bChhZ8HBP3xxsPdH8J5Qk7q5F8oS0DA5CJClm50K/ iPFIULW7ZR0KABCzv/86DmWi2qCGdNhrj5kx2AAAcJlcSgDH63YhDnzReJTIKMRuJZSR HX0wSVqdurhW5UY4Jx4XiGEG/iBLbCKtsEUcWKUpjFgyzW8Smb2tDgmOTLg9fH5VRi9G xQz9WWfRkHjuxI+lBxLPfY3Kp7/0J15NeqEJ/f0sTpUITtp7ZYZft9VRgRE0pUn3nHr2 UA/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=eW1Vd6zrseYV+246o37tmPz2nql1rDiY2jiaiMZKBLs=; b=05YFbORJ8fva1nWtQkvSGKYe2+KPSKGPzA4G38HAdSeOiZvziiTnt1iy9jCJFm0SNB 0o8kV83kg5foEfdHtKJFDjtlJzaT/oLQWs0KXe6vyGq9ZKt9lexYImxkyiohyPn+r0yD UgNq53KbO0mUjuSABN0qC+IrHDH4BJ7q9E4RNFuy8HVGBTRPm/PTAsZNHzMOA9RjjoSX vMu+zoZ0GMWIuryltfRJGxKcjx0ssq6RTsHjXE3hOrjbbU3Ydj9pjaXU17p/XjtEzsdH GGYhz7/KxTRpnGRetfvDaE3cUh8dNLtMpsPDfd/triFQyPCXOVzJICw1Lm0NtnpJxbwi fU1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h11-20020a0564020e8b00b0049e376ac999si5328709eda.529.2023.02.04.02.45.29; Sat, 04 Feb 2023 02:45:29 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 18C3E68BEEE; Sat, 4 Feb 2023 12:44:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0C8268BE75 for ; Sat, 4 Feb 2023 12:44:14 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id AB024240591 for ; Sat, 4 Feb 2023 11:44:14 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id kkPRUu_1opxU for ; Sat, 4 Feb 2023 11:44:12 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 0389E2406CF for ; Sat, 4 Feb 2023 11:44:07 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 3EADE3A05F7 for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2023 11:41:56 +0100 Message-Id: <20230204104204.20721-26-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> References: <20230204104204.20721-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 25/33] avutil: remove FF_API_D2STR X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8kennDseXwVI From: James Almer Signed-off-by: James Almer --- libavutil/avstring.c | 10 ---------- libavutil/avstring.h | 9 --------- libavutil/tests/avstring.c | 16 ---------------- libavutil/version.h | 1 - 4 files changed, 36 deletions(-) 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)