[{"id":1361,"web_url":"https://patchwork.libcamera.org/comment/1361/","msgid":"<20190415201636.GS1980@bigcity.dyn.berto.se>","date":"2019-04-15T20:16:36","subject":"Re: [libcamera-devel] [PATCH 02/11] libcamera: log: Mark\n\tLoggable::_log() methods as const","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2019-04-15 19:56:51 +0300, Laurent Pinchart wrote:\n> The methods don't modify the object instance, mark them as const. This\n> allows using the LOG() macro from a const method of a Loggable object.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/log.h | 5 +++--\n>  src/libcamera/log.cpp       | 5 +++--\n>  2 files changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h\n> index 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);\n> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\n> index 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> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7193660B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 22:16:38 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id r24so16959209ljg.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 13:16:38 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tm19sm6257102lfl.43.2019.04.15.13.16.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 15 Apr 2019 13:16:37 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=2Ftu+XIxlNkh90/vYnvKpU+48Mxq9yykrv3XD4bkW2s=;\n\tb=DGQCWOa5L32uzY9gwhtblIiko9N+YFDVKV+whnvflQObMtw6S9R9gZCb0g893VURUh\n\trqjFFU4J6QnH3egsXQVhcGZInFPOSljw4VANOyYhY3jhfL24gi1AYaoyepaYUhGH8UyN\n\te9NU6+hRirGVEMpcn+FAX6rdewGSdt5cbgdc4KZKFzTTbnx6MYJuZDBBrkhMmGeG+kzd\n\tJuhxlY+BRWN1P3xcwRnDDMNK+Wp5ssKsDYOx3JYC+mUx0Zf5Wg4xrQ5veRG6tPht3T11\n\t7DW8XgeDrOAXBzhos1JoHuQSZ7GYZnB9XHAfYmseif64UbKvtZSJ3HYJWydkDISKCol+\n\t/HJQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=2Ftu+XIxlNkh90/vYnvKpU+48Mxq9yykrv3XD4bkW2s=;\n\tb=IQsYGkRAJE+uxXYPU4SVpURwYZHRjeNOV+Qjw5q8lwSOBOHiD12zkLEsOfQBuBaLSF\n\tLQqOZF7v41uuR2tyt8g3CdO5x7Oxa7KGffw/Vi5w7Wog43SONshrkUfc3uU/rQtVetbL\n\t99ezRrvQSLsGsdqV4v35mKw+r0cjgY7XVn0+0XA9vK76aiu6ab9sDmUjEXMlgt0YL+2n\n\tWpUyT0uCaznXh9zrXHwAJOoq2OCXx8aabX452CJWaEW6IC6JtR0q1P1HTvxNqLP0kVwm\n\tTPctpsb8y473vfrrDQOuDggYc/c7G07Fb4otroyVPXWSoiC0upHr0rYFswtP/gPLhmxR\n\tLGwQ==","X-Gm-Message-State":"APjAAAVRg18w7kpaMkHNZ3mCUzbveqQK67LkE9KCW1FBuHVNJZ4zbfNX\n\tAOOhWUSOy29GhBf2sNXeywWPzBtGGLE=","X-Google-Smtp-Source":"APXvYqzhfXtv36e04AzRzqfPTb62Fybesd28SBfXDOS+szSXV4qeEB6/I5Rc2lLF9dcX5UgMbw9zkA==","X-Received":"by 2002:a2e:9b48:: with SMTP id o8mr25045710ljj.51.1555359397882;\n\tMon, 15 Apr 2019 13:16:37 -0700 (PDT)","Date":"Mon, 15 Apr 2019 22:16:36 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190415201636.GS1980@bigcity.dyn.berto.se>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [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 20:16:38 -0000"}},{"id":1388,"web_url":"https://patchwork.libcamera.org/comment/1388/","msgid":"<20190416145424.tlw7ouyanflq4izv@uno.localdomain>","date":"2019-04-16T14:54:24","subject":"Re: [libcamera-devel] [PATCH 02/11] libcamera: log: Mark\n\tLoggable::_log() methods as const","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Mon, Apr 15, 2019 at 07:56:51PM +0300, Laurent Pinchart wrote:\n> The methods don't modify the object instance, mark them as const. This\n> allows using the LOG() macro from a const method of a Loggable object.\n>\n\nThanks,\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n> Signed-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(-)\n>\n> diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h\n> index 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);\n> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp\n> index 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> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7654460DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 16:53:33 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 0A40740007;\n\tTue, 16 Apr 2019 14:53:32 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Tue, 16 Apr 2019 16:54:24 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190416145424.tlw7ouyanflq4izv@uno.localdomain>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"a7dmutdijksfshh4\"","Content-Disposition":"inline","In-Reply-To":"<20190415165700.22970-3-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [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":"Tue, 16 Apr 2019 14:53:33 -0000"}}]