{"id":983,"url":"https://patchwork.libcamera.org/api/patches/983/?format=json","web_url":"https://patchwork.libcamera.org/patch/983/","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":"<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","date":"2019-04-15T16:56:51","name":"[libcamera-devel,02/11] libcamera: log: Mark Loggable::_log() methods as const","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"315ef1255ca8132762fccb79eaf9f5475edd87a1","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/983/mbox/","series":[{"id":250,"url":"https://patchwork.libcamera.org/api/series/250/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=250","date":"2019-04-15T16:56:49","name":"Rockchip ISP pipeline handler","version":1,"mbox":"https://patchwork.libcamera.org/series/250/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/983/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/983/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C651A60DBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 18:57:14 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5C877333\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 18:57:14 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555347434;\n\tbh=dpMsSqVFr8uPm2fOOOAPDZdVkcjiYIyorTtBVSGEX48=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=wMSd1w9oanXfqvO3Xh7I/FX0/1cFK3ltG3RXliH9eAwzou96NdWEL7lb03Y2Kj6n5\n\tdm8RvsAmbrysy2DgKkxnt6mDrLiJlGUSBZbNVrVQn2twnFj/ra+TgcHq/7GdRDiRmm\n\tnS+vQJRLDpXUzcWpUK9T8x3/ZJrP3cNYovGS1yDk=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 15 Apr 2019 19:56:51 +0300","Message-Id":"<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 02/11] libcamera: log: Mark\n\tLoggable::_log() methods as const","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 15 Apr 2019 16:57:15 -0000"},"content":"The methods don't modify the object instance, mark them as const. This\nallows using the LOG() macro from a const method of a Loggable object.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/log.h | 5 +++--\n src/libcamera/log.cpp       | 5 +++--\n 2 files changed, 6 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h\nindex 8ea5a1eb673a..35a6fc105448 100644\n--- a/src/libcamera/include/log.h\n+++ b/src/libcamera/include/log.h\n@@ -76,9 +76,10 @@ protected:\n \tvirtual std::string logPrefix() const = 0;\n \n \tLogMessage _log(const char *file, unsigned int line,\n-\t\t\tLogSeverity severity);\n+\t\t\tLogSeverity severity) const;\n \tLogMessage _log(const char *file, unsigned int line,\n-\t\t\tconst LogCategory &category, LogSeverity severity);\n+\t\t\tconst LogCategory &category,\n+\t\t\tLogSeverity severity) const;\n };\n \n LogMessage _log(const char *file, unsigned int line, LogSeverity severity);\ndiff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\nindex 71cfbc422ba0..77927ec35b62 100644\n--- a/src/libcamera/log.cpp\n+++ b/src/libcamera/log.cpp\n@@ -506,7 +506,7 @@ Loggable::~Loggable()\n  * \\return A log message\n  */\n LogMessage Loggable::_log(const char *fileName, unsigned int line,\n-\t\t\t  LogSeverity severity)\n+\t\t\t  LogSeverity severity) const\n {\n \tLogMessage msg(fileName, line, severity);\n \n@@ -527,7 +527,8 @@ LogMessage Loggable::_log(const char *fileName, unsigned int line,\n  * \\return A log message\n  */\n LogMessage Loggable::_log(const char *fileName, unsigned int line,\n-\t\t\t  const LogCategory &category, LogSeverity severity)\n+\t\t\t  const LogCategory &category,\n+\t\t\t  LogSeverity severity) const\n {\n \tLogMessage msg(fileName, line, category, severity);\n \n","prefixes":["libcamera-devel","02/11"]}