Patch Detail
Show a patch.
GET /api/1.1/patches/793/?format=api
{ "id": 793, "url": "https://patchwork.libcamera.org/api/1.1/patches/793/?format=api", "web_url": "https://patchwork.libcamera.org/patch/793/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20190325234736.12533-2-niklas.soderlund@ragnatech.se>", "date": "2019-03-25T23:47:34", "name": "[libcamera-devel,1/3] cam: options: Create separate enum for OptionValue types", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "80a800c8f2d2f6e908ffc192724dbb2a87d5c270", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/793/mbox/", "series": [ { "id": 218, "url": "https://patchwork.libcamera.org/api/1.1/series/218/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=218", "date": "2019-03-25T23:47:35", "name": "cam: options: Add support for repeatable options", "version": 1, "mbox": "https://patchwork.libcamera.org/series/218/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/793/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/793/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D7CBB6110E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2019 00:47:46 +0100 (CET)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 62099073-4f58-11e9-846a-005056917a89;\n\tTue, 26 Mar 2019 00:47:43 +0100 (CET)" ], "X-Halon-ID": "62099073-4f58-11e9-846a-005056917a89", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Mar 2019 00:47:34 +0100", "Message-Id": "<20190325234736.12533-2-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190325234736.12533-1-niklas.soderlund@ragnatech.se>", "References": "<20190325234736.12533-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 1/3] cam: options: Create separate enum\n\tfor OptionValue types", "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, 25 Mar 2019 23:47:47 -0000" }, "content": "In preparation for support of multiple instances of the same option,\ncreate a separate enum for the OptionValue types as it will diverge from\nenum OptionType.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/cam/options.cpp | 16 ++++++++--------\n src/cam/options.h | 11 +++++++++--\n 2 files changed, 17 insertions(+), 10 deletions(-)", "diff": "diff --git a/src/cam/options.cpp b/src/cam/options.cpp\nindex 655aa36bb9c93b85..497833397d894f82 100644\n--- a/src/cam/options.cpp\n+++ b/src/cam/options.cpp\n@@ -248,27 +248,27 @@ void KeyValueParser::usage(int indent)\n */\n \n OptionValue::OptionValue()\n-\t: type_(OptionNone)\n+\t: type_(ValueNone)\n {\n }\n \n OptionValue::OptionValue(int value)\n-\t: type_(OptionInteger), integer_(value)\n+\t: type_(ValueInteger), integer_(value)\n {\n }\n \n OptionValue::OptionValue(const char *value)\n-\t: type_(OptionString), string_(value)\n+\t: type_(ValueString), string_(value)\n {\n }\n \n OptionValue::OptionValue(const std::string &value)\n-\t: type_(OptionString), string_(value)\n+\t: type_(ValueString), string_(value)\n {\n }\n \n OptionValue::OptionValue(const KeyValueParser::Options &value)\n-\t: type_(OptionKeyValue), keyValues_(value)\n+\t: type_(ValueKeyValue), keyValues_(value)\n {\n }\n \n@@ -289,7 +289,7 @@ OptionValue::operator KeyValueParser::Options() const\n \n int OptionValue::toInteger() const\n {\n-\tif (type_ != OptionInteger)\n+\tif (type_ != ValueInteger)\n \t\treturn 0;\n \n \treturn integer_;\n@@ -297,7 +297,7 @@ int OptionValue::toInteger() const\n \n std::string OptionValue::toString() const\n {\n-\tif (type_ != OptionString)\n+\tif (type_ != ValueString)\n \t\treturn std::string();\n \n \treturn string_;\n@@ -305,7 +305,7 @@ std::string OptionValue::toString() const\n \n KeyValueParser::Options OptionValue::toKeyValues() const\n {\n-\tif (type_ != OptionKeyValue)\n+\tif (type_ != ValueKeyValue)\n \t\treturn KeyValueParser::Options();\n \n \treturn keyValues_;\ndiff --git a/src/cam/options.h b/src/cam/options.h\nindex 745f4a4a3a433f9e..b33a90fc6058febf 100644\n--- a/src/cam/options.h\n+++ b/src/cam/options.h\n@@ -79,13 +79,20 @@ private:\n class OptionValue\n {\n public:\n+\tenum ValueType {\n+\t\tValueNone,\n+\t\tValueInteger,\n+\t\tValueString,\n+\t\tValueKeyValue,\n+\t};\n+\n \tOptionValue();\n \tOptionValue(int value);\n \tOptionValue(const char *value);\n \tOptionValue(const std::string &value);\n \tOptionValue(const KeyValueParser::Options &value);\n \n-\tOptionType type() const { return type_; }\n+\tValueType type() const { return type_; }\n \n \toperator int() const;\n \toperator std::string() const;\n@@ -96,7 +103,7 @@ public:\n \tKeyValueParser::Options toKeyValues() const;\n \n private:\n-\tOptionType type_;\n+\tValueType type_;\n \tint integer_;\n \tstd::string string_;\n \tKeyValueParser::Options keyValues_;\n", "prefixes": [ "libcamera-devel", "1/3" ] }