From patchwork Wed Feb 24 11:53:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25962 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id ACAED44B5C7 for ; Wed, 24 Feb 2021 13:54:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 90D9368AA25; Wed, 24 Feb 2021 13:54:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0262B68A9E8 for ; Wed, 24 Feb 2021 13:54:27 +0200 (EET) Received: by mail-wr1-f49.google.com with SMTP id 7so1628166wrz.0 for ; Wed, 24 Feb 2021 03:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BIZyio3bL3Hl78hRQQ6GHB651tKPC66Nbvx1oXFi76U=; b=uDmEPa95E52cVOkNuCQcCKPAYJ7Kuks/t9GkZDdbXkIenMqLXZ11AtdoBmI4HaKOeq k7saItFvkl+VBzsX0IN6LxEgel+GvW18srQUFMTlEuGn0ZOwgb1sSzogbRbICtF3fekC ZPHoJtqqN+Ck3jP0kQyT89dG8TgWraB6f6xCQ2M+33C7I9I/LV4Vt2+nHrtoxU36kKjy D6zY0CaO1XRUQXKemnSyQIn5ew2PXieH5KOTMKdi925wRpejVXTb46iqWTqyuc6vV8UF BDuuR+qczkawI5Rc/NMzDx+oKfONBnUcvqQalqcnzsYgsmUoywfD7OBgYnmKpq6srpv5 07Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BIZyio3bL3Hl78hRQQ6GHB651tKPC66Nbvx1oXFi76U=; b=OcAm8MeHsnSlW4zFsudfvLACNOHhJ1CfjNoPdJ59bv6SbwqaiTz5BvAloYifLB0BWs 1hPbtgpgIoXlL+ugPtGDb+7DTLZSJ42cSaMrdl3fNCBnVX5nKBloIZQEq3PYwf7eKCPj Z/4anY4Y6l1/FBn4TRdeqmZVZvX6gQN1qpaVXzyO9CopaifAAdpueOHgCigkuewoXKI6 JCZIw/CuatkztcIXgvi5odHzsHkptbHVcXPDF/3y+CllB5xuGw7n1zwtDXuWDfn3mmu0 WEgyh/VPTZe6fF1JBxxOT4JhVINbjvBsJQLQ5PyUDESfaD+iMAcjjLUhPPBPk/WhuoFb urEg== X-Gm-Message-State: AOAM530ymph3fE1yLsvPal/UVIm6In8jjoOxZHJbEjY2qM63SQ8b26RJ 4I/Xk6aa+JknQTHtNqthOoXY6S3bPBU= X-Google-Smtp-Source: ABdhPJytGV9+5MR/WyY4X171kUDGOpkOCcBcjAw1u2SG9YJcZuS0EgV9UyknfBdipJv4w5uquSiphw== X-Received: by 2002:a5d:5043:: with SMTP id h3mr2412055wrt.120.1614167666355; Wed, 24 Feb 2021 03:54:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id k15sm3911776wrn.0.2021.02.24.03.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 03:54:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Feb 2021 12:53:37 +0100 Message-Id: <20210224115341.794293-11-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224115341.794293-1-andreas.rheinhardt@gmail.com> References: <20210224115341.794293-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/15] avutil/spherical: Use av_strstart instead of strncmp X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It makes the intent clearer and avoids calculating the length separately. Signed-off-by: Andreas Rheinhardt --- libavutil/spherical.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/spherical.c b/libavutil/spherical.c index 4a7f3e49ca..ed66344a2f 100644 --- a/libavutil/spherical.c +++ b/libavutil/spherical.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "avstring.h" #include "mem.h" #include "spherical.h" @@ -70,8 +71,7 @@ int av_spherical_from_name(const char *name) int i; for (i = 0; i < FF_ARRAY_ELEMS(spherical_projection_names); i++) { - size_t len = strlen(spherical_projection_names[i]); - if (!strncmp(spherical_projection_names[i], name, len)) + if (av_strstart(name, spherical_projection_names[i], NULL)) return i; }