Show a patch.

GET /api/1.1/patches/13618/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 13618,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13618/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13618/",
    "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": "<20210906020100.14430-2-laurent.pinchart@ideasonboard.com>",
    "date": "2021-09-06T02:00:34",
    "name": "[libcamera-devel,v2,01/27] libcamera: base: utils: Use size_t for index in utils::enumerate()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8e5367cf2401e36d1b49328e421213534e9732e2",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13618/mbox/",
    "series": [
        {
            "id": 2446,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2446/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2446",
            "date": "2021-09-06T02:00:33",
            "name": "libcamera: Handle fallout of FrameBuffer offset support",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2446/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13618/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13618/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 B96E8BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 02:01:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E9E3460254;\n\tMon,  6 Sep 2021 04:01:22 +0200 (CEST)",
            "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 99B4E60254\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 04:01:21 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 285258D7;\n\tMon,  6 Sep 2021 04:01:21 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rN0/Kt+n\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630893681;\n\tbh=vBG0qyEef7amrs34aZAtJq889C71FrR0QxyyK4EGp8k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rN0/Kt+nohQCqIHoJ60o7UJ7GBjS+iduewajHcAk80aisj/E3oBn6Su+d9F4hrM+y\n\tZb7G4RpCopTwnFyiTkj1R74dP67b7pc0v4FOqhDUo//Yp0xTqvdXDdwWLXi7cS1Fse\n\tgMl4Bw5aWiwVXnkcVmEuJ11AuAin3M/G6Te+UbIw=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  6 Sep 2021 05:00:34 +0300",
        "Message-Id": "<20210906020100.14430-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "In-Reply-To": "<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 01/27] libcamera: base: utils: Use\n\tsize_t for index in utils::enumerate()",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The index generated by utils::enumerate() is an iteration counter, which\nshould thus be positive. Use std::size_t instead of the different_type\nof the container.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/base/utils.h |  4 ++--\n test/utils.cpp                 | 10 +++++-----\n 2 files changed, 7 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\nindex 52301254c2eb..2b761436a99f 100644\n--- a/include/libcamera/base/utils.h\n+++ b/include/libcamera/base/utils.h\n@@ -246,7 +246,7 @@ private:\n \n public:\n \tusing difference_type = typename std::iterator_traits<Base>::difference_type;\n-\tusing value_type = std::pair<const difference_type, base_reference>;\n+\tusing value_type = std::pair<const std::size_t, base_reference>;\n \tusing pointer = value_type *;\n \tusing reference = value_type &;\n \tusing iterator_category = std::input_iterator_tag;\n@@ -275,7 +275,7 @@ public:\n \n private:\n \tBase current_;\n-\tdifference_type pos_;\n+\tstd::size_t pos_;\n };\n \n template<typename Base>\ndiff --git a/test/utils.cpp b/test/utils.cpp\nindex d7f810e95e7a..d65467b5102c 100644\n--- a/test/utils.cpp\n+++ b/test/utils.cpp\n@@ -77,8 +77,8 @@ protected:\n \n \tint testEnumerate()\n \t{\n-\t\tstd::vector<int> integers{ 1, 2, 3, 4, 5 };\n-\t\tint i = 0;\n+\t\tstd::vector<unsigned int> integers{ 1, 2, 3, 4, 5 };\n+\t\tunsigned int i = 0;\n \n \t\tfor (auto [index, value] : utils::enumerate(integers)) {\n \t\t\tif (index != i || value != i + 1) {\n@@ -93,12 +93,12 @@ protected:\n \t\t\t++i;\n \t\t}\n \n-\t\tif (integers != std::vector<int>{ 0, 1, 2, 3, 4 }) {\n+\t\tif (integers != std::vector<unsigned int>{ 0, 1, 2, 3, 4 }) {\n \t\t\tcerr << \"Failed to modify container in enumerated range loop\" << endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tSpan<const int> span{ integers };\n+\t\tSpan<const unsigned int> span{ integers };\n \t\ti = 0;\n \n \t\tfor (auto [index, value] : utils::enumerate(span)) {\n@@ -112,7 +112,7 @@ protected:\n \t\t\t++i;\n \t\t}\n \n-\t\tconst int array[] = { 0, 2, 4, 6, 8 };\n+\t\tconst unsigned int array[] = { 0, 2, 4, 6, 8 };\n \t\ti = 0;\n \n \t\tfor (auto [index, value] : utils::enumerate(array)) {\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "01/27"
    ]
}