From patchwork Mon Nov 23 07:38:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10467 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 52139BE08A for ; Mon, 23 Nov 2020 07:38:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F9086334C; Mon, 23 Nov 2020 08:38:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="pRipBaTR"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ED7AE632B2 for ; Mon, 23 Nov 2020 08:38:37 +0100 (CET) Received: by mail-wr1-x42f.google.com with SMTP id b6so17595145wrt.4 for ; Sun, 22 Nov 2020 23:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ulb2sJuTBbnF03P2gKhOiyCPKEujg0gr7XFejXSRJME=; b=pRipBaTRGaF/ZphEHbxznaOL0l4n+DQTniJLBSi97anfoK9d1laRjcc1pETTldpwD4 NarCgqLDQ+FgJ8EyN5ta+l5qkh6NaCahqdhfFCfzuG967mjLxPoDSvspwBLmIe3zA+c1 p5wEHfVs4mJvEuVH35DTXUarPRxYabAIqbiE3YHsRBAN4g3HSHoIGKdYoixj6ub31eGB KDqfvG21DAfDUsxcjmq1EU6WhP0KSCzBOAvofYO05XqylR3xKgOzee55yYFO14KeYTEC VlPgCk/Qarg2mcPsYZ8DGHx6yLWD4SeZEs6O2+omRtHYFY2qxfVihvNHaQ2PJipu7Ig0 4LJw== 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=Ulb2sJuTBbnF03P2gKhOiyCPKEujg0gr7XFejXSRJME=; b=i4BOMshtftbk87UXJysBWMUvBpHs2YlMqS2u8pPrlnqb6N6H3qfKVbc2n4bbzPORGb CFBB+hz7jS1lLePEewoNGTYloppJg3x+QDDL/FH0ejVeEal+FyBk3kQqKXN/ntjbXvcC fiRPHaQjal1vDadQY9rWjNafy1bxmk+gk9ayLWnoWbYtLE8NBcjM5Zrpyhx8tMnxBlwf AnAc0g5CA6I+nNUi2OmBs1r6yfxBvh5zw2FmHiyYf+Y1u9WrXnH3uDE91gPtTZfWRgSf TtuqaTeDWOcj6/pyxmglhLY23VZRTSU6/ENEgwCkhcAykPcHN4Am1XpAsimB9EUCVQdb H5sQ== X-Gm-Message-State: AOAM531vj0VfGLl2p+IgVDN2vDCiZNGuszCt5rI7ZyZI4yo7ZdLPKfYZ /YjB+2OvP64QL7INZE8xTwjZ07lP0CZ1meoO X-Google-Smtp-Source: ABdhPJyj2orV20O2uNaILg11mHzDKcBY43ZBSC6UWAncQV+ZeCiD6A5XLbdSj3M7ioyXwLFCyEgOgQ== X-Received: by 2002:adf:a343:: with SMTP id d3mr29500501wrb.91.1606117117490; Sun, 22 Nov 2020 23:38:37 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id h15sm17841822wrw.15.2020.11.22.23.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 23:38:36 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Nov 2020 07:38:02 +0000 Message-Id: <20201123073804.3125-9-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201123073804.3125-1-david.plowman@raspberrypi.com> References: <20201123073804.3125-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/10] libcamera: src: ipa: raspberrypi: agc: Fix uninitialised members in Agc constructor 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Use memset in the constructor for embedded structures, it is tidier and initialises everything. We use the initialiser list for other members. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 2533727e..d7d37055 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -153,16 +153,15 @@ void AgcConfig::Read(boost::property_tree::ptree const ¶ms) Agc::Agc(Controller *controller) : AgcAlgorithm(controller), metering_mode_(nullptr), exposure_mode_(nullptr), constraint_mode_(nullptr), - frame_count_(0), lock_count_(0) -{ - ev_ = status_.ev = 1.0; - flicker_period_ = status_.flicker_period = 0.0; - fixed_shutter_ = status_.fixed_shutter = 0; - fixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0; - // set to zero initially, so we can tell it's not been calculated - status_.total_exposure_value = 0.0; - status_.target_exposure_value = 0.0; - status_.locked = false; + frame_count_(0), lock_count_(0), + ev_(1.0), flicker_period_(0.0), + fixed_shutter_(0), fixed_analogue_gain_(0.0) +{ + memset(&awb_, 0, sizeof(awb_)); + // Setting status_.total_exposure_value_ to zero initially tells us + // it's not been calculated yet (i.e. Process hasn't yet run). + memset(&status_, 0, sizeof(status_)); + status_.ev = ev_; } char const *Agc::Name() const