{"id":10467,"url":"https://patchwork.libcamera.org/api/patches/10467/?format=json","web_url":"https://patchwork.libcamera.org/patch/10467/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201123073804.3125-9-david.plowman@raspberrypi.com>","date":"2020-11-23T07:38:02","name":"[libcamera-devel,v2,08/10] libcamera: src: ipa: raspberrypi: agc: Fix uninitialised members in Agc constructor","commit_ref":"393f05a9a8044dba26251ba5a4b0827b714cd15f","pull_url":null,"state":"accepted","archived":false,"hash":"6518a63d908dc28efc3a8e072dc3f57453182da4","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10467/mbox/","series":[{"id":1475,"url":"https://patchwork.libcamera.org/api/series/1475/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1475","date":"2020-11-23T07:37:54","name":"Raspberry Pi AGC","version":2,"mbox":"https://patchwork.libcamera.org/series/1475/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10467/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10467/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 52139BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Nov 2020 07:38:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F9086334C;\n\tMon, 23 Nov 2020 08:38:41 +0100 (CET)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED7AE632B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Nov 2020 08:38:37 +0100 (CET)","by mail-wr1-x42f.google.com with SMTP id b6so17595145wrt.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 22 Nov 2020 23:38:37 -0800 (PST)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\th15sm17841822wrw.15.2020.11.22.23.38.36\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 22 Nov 2020 23:38:36 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"pRipBaTR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Ulb2sJuTBbnF03P2gKhOiyCPKEujg0gr7XFejXSRJME=;\n\tb=pRipBaTRGaF/ZphEHbxznaOL0l4n+DQTniJLBSi97anfoK9d1laRjcc1pETTldpwD4\n\tNarCgqLDQ+FgJ8EyN5ta+l5qkh6NaCahqdhfFCfzuG967mjLxPoDSvspwBLmIe3zA+c1\n\tp5wEHfVs4mJvEuVH35DTXUarPRxYabAIqbiE3YHsRBAN4g3HSHoIGKdYoixj6ub31eGB\n\tKDqfvG21DAfDUsxcjmq1EU6WhP0KSCzBOAvofYO05XqylR3xKgOzee55yYFO14KeYTEC\n\tVlPgCk/Qarg2mcPsYZ8DGHx6yLWD4SeZEs6O2+omRtHYFY2qxfVihvNHaQ2PJipu7Ig0\n\t4LJw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Ulb2sJuTBbnF03P2gKhOiyCPKEujg0gr7XFejXSRJME=;\n\tb=i4BOMshtftbk87UXJysBWMUvBpHs2YlMqS2u8pPrlnqb6N6H3qfKVbc2n4bbzPORGb\n\tCFBB+hz7jS1lLePEewoNGTYloppJg3x+QDDL/FH0ejVeEal+FyBk3kQqKXN/ntjbXvcC\n\tfiRPHaQjal1vDadQY9rWjNafy1bxmk+gk9ayLWnoWbYtLE8NBcjM5Zrpyhx8tMnxBlwf\n\tAnAc0g5CA6I+nNUi2OmBs1r6yfxBvh5zw2FmHiyYf+Y1u9WrXnH3uDE91gPtTZfWRgSf\n\tTtuqaTeDWOcj6/pyxmglhLY23VZRTSU6/ENEgwCkhcAykPcHN4Am1XpAsimB9EUCVQdb\n\tH5sQ==","X-Gm-Message-State":"AOAM531vj0VfGLl2p+IgVDN2vDCiZNGuszCt5rI7ZyZI4yo7ZdLPKfYZ\n\t/YjB+2OvP64QL7INZE8xTwjZ07lP0CZ1meoO","X-Google-Smtp-Source":"ABdhPJyj2orV20O2uNaILg11mHzDKcBY43ZBSC6UWAncQV+ZeCiD6A5XLbdSj3M7ioyXwLFCyEgOgQ==","X-Received":"by 2002:adf:a343:: with SMTP id d3mr29500501wrb.91.1606117117490;\n\tSun, 22 Nov 2020 23:38:37 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","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:\n\traspberrypi: agc: Fix uninitialised members in Agc constructor","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Use memset in the constructor for embedded structures, it is tidier\nand initialises everything. We use the initialiser list for other\nmembers.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 19 +++++++++----------\n 1 file changed, 9 insertions(+), 10 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 2533727e..d7d37055 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -153,16 +153,15 @@ void AgcConfig::Read(boost::property_tree::ptree const &params)\n Agc::Agc(Controller *controller)\n \t: AgcAlgorithm(controller), metering_mode_(nullptr),\n \t  exposure_mode_(nullptr), constraint_mode_(nullptr),\n-\t  frame_count_(0), lock_count_(0)\n-{\n-\tev_ = status_.ev = 1.0;\n-\tflicker_period_ = status_.flicker_period = 0.0;\n-\tfixed_shutter_ = status_.fixed_shutter = 0;\n-\tfixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0;\n-\t// set to zero initially, so we can tell it's not been calculated\n-\tstatus_.total_exposure_value = 0.0;\n-\tstatus_.target_exposure_value = 0.0;\n-\tstatus_.locked = false;\n+\t  frame_count_(0), lock_count_(0),\n+\t  ev_(1.0), flicker_period_(0.0),\n+\t  fixed_shutter_(0), fixed_analogue_gain_(0.0)\n+{\n+\tmemset(&awb_, 0, sizeof(awb_));\n+\t// Setting status_.total_exposure_value_ to zero initially tells us\n+\t// it's not been calculated yet (i.e. Process hasn't yet run).\n+\tmemset(&status_, 0, sizeof(status_));\n+\tstatus_.ev = ev_;\n }\n \n char const *Agc::Name() const\n","prefixes":["libcamera-devel","v2","08/10"]}