From patchwork Wed Feb 21 02:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 19519 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 058BDBD80A for ; Wed, 21 Feb 2024 02:46:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 24DCE62809; Wed, 21 Feb 2024 03:46:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X7rwsihW"; dkim-atps=neutral Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A085E62800 for ; Wed, 21 Feb 2024 03:46:43 +0100 (CET) Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-29938dcb711so2830978a91.0 for ; Tue, 20 Feb 2024 18:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708483602; x=1709088402; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PlDLnEUHIahZtWdAcvzxq1nZyoq7DXBxomPDzG2q9JU=; b=X7rwsihWcWMdNv1ahT1j2qoW3G2Q5VeF6LtL2TqTQjm3r8Ai5PRKzPogyfVbNG9aPF ekRRmmcZ0EljzGpLllHJJESSxf+A9l+KbDzZKh8WwGt5bwg6b5Zln7gUABZbELdOs0L5 O+oEh86toL5esuotf/pxIUcwL657hFbMUvDr3EDOlMnkhp5SHmb0vdr654DcIYX7m9bj cONAMyqhNPtFCwSs55z3W5zh8t4tdzKjjEmfJxNB8tBRq4beJ4kVBwyedm7zpiyrglAh I0nYhBINVF+kLfQNKb+klrowVqjcukL1UhadjLBXsNbTqXNh6OU2zjKiEiHPpz8OjA2A PMDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708483602; x=1709088402; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PlDLnEUHIahZtWdAcvzxq1nZyoq7DXBxomPDzG2q9JU=; b=JORxQHSGx/RYjuNHYrG0qfO1lMLxgxhwH7ZvoKAQDpk1oupOpkT8c02a2ceDCkINc0 +aKfQNh98GzNG0jU2Ls+LMcw18o0F3a6RvzkW19R7Bp0mFPkH2WxrdirqcuFDGjBn3gs V7ATGMKF5b/sg8BraDLg7GuotqWo3q/UQ4mR4rk5m4m8jlqr4rY3pWZtIzYJl1rEY4lO ZSJPG/dKmtQ5zKL4wTl/LHnXpRKXc9u2cG9TdbqemeYPXxzg+HpWbkc8dwEqa+muGxqs rZkYa7jy1Hv9Ja+NIdiDJJN4sjNhvn6DZFqSqg+3U7hFq6kPlxirstlP4FAtotja0saA cDXA== X-Gm-Message-State: AOJu0Yzfge4PxKE8TvcQmwnXF7b3M7gWLYjI4ObkXOSoX8tHoQngq96O ktqGVcLecRsx4Re6ZAwoz7YbsrmyvCLucWUb69AbS+FWb1df6IUZ0Oj2i0Lr4kk= X-Google-Smtp-Source: AGHT+IGa12+d08PxgZjI+Iqk6UqIpxAlXizuntPQ6v6ke2V9eaXEzqlY7gL9U17zt0XY5UQz2HJAAA== X-Received: by 2002:a17:90a:6c42:b0:299:4d76:be4f with SMTP id x60-20020a17090a6c4200b002994d76be4fmr8272811pjj.2.1708483601620; Tue, 20 Feb 2024 18:46:41 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::696f]) by smtp.gmail.com with ESMTPSA id x11-20020a170902e04b00b001d987bfdd5fsm7039013plx.253.2024.02.20.18.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 18:46:41 -0800 (PST) From: Khem Raj To: libcamera-devel@lists.libcamera.org Subject: [PATCH] rpi: Use alloca instead of variable length arrays Date: Tue, 20 Feb 2024 18:46:38 -0800 Message-ID: <20240221024638.1486832-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Khem Raj Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Clang-18+ diagnoses this as error | ../git/src/ipa/rpi/controller/rpi/alsc.cpp:499:10: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] | 499 | int xLo[X], xHi[X]; | | ^ Signed-off-by: Khem Raj --- src/ipa/rpi/controller/rpi/alsc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/alsc.cpp b/src/ipa/rpi/controller/rpi/alsc.cpp index 8a205c60..8c0ae8eb 100644 --- a/src/ipa/rpi/controller/rpi/alsc.cpp +++ b/src/ipa/rpi/controller/rpi/alsc.cpp @@ -496,8 +496,8 @@ void resampleCalTable(const Array2D &calTableIn, * Precalculate and cache the x sampling locations and phases to save * recomputing them on every row. */ - int xLo[X], xHi[X]; - double xf[X]; + int *xLo = (int*)alloca(X), *xHi = (int*)alloca(X); + double *xf = (double*)alloca(X); double scaleX = cameraMode.sensorWidth / (cameraMode.width * cameraMode.scaleX); double xOff = cameraMode.cropX / (double)cameraMode.sensorWidth;