[{"id":1766397,"web_url":"http://patchwork.ozlabs.org/comment/1766397/","msgid":"<480f3fb5-b99d-8a49-4051-f013bf2fae09@canonical.com>","list_archive_url":null,"date":"2017-09-11T16:51:53","subject":"ACK: [PATCH] lib: fwts_formatting: make width parameter size_t","submitter":{"id":10593,"url":"http://patchwork.ozlabs.org/api/people/10593/","name":"Alex Hung","email":"alex.hung@canonical.com"},"content":"On 2017-09-08 02:43 AM, Colin King wrote:\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> Lengths of string objects should really be size_t rather than int.\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>   src/lib/include/fwts_formatting.h | 2 +-\n>   src/lib/src/fwts_formatting.c     | 8 ++++----\n>   2 files changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/lib/include/fwts_formatting.h b/src/lib/include/fwts_formatting.h\n> index 3431c6aa..036f09e1 100644\n> --- a/src/lib/include/fwts_formatting.h\n> +++ b/src/lib/include/fwts_formatting.h\n> @@ -22,6 +22,6 @@\n>   \n>   #include \"fwts_list.h\"\n>   \n> -fwts_list *fwts_format_text(const char *text, const int width);\n> +fwts_list *fwts_format_text(const char *text, const size_t width);\n>   \n>   #endif\n> diff --git a/src/lib/src/fwts_formatting.c b/src/lib/src/fwts_formatting.c\n> index 3b413bd3..0f661d5c 100644\n> --- a/src/lib/src/fwts_formatting.c\n> +++ b/src/lib/src/fwts_formatting.c\n> @@ -30,9 +30,9 @@\n>    *\tduplicate a portion of a line of text, from start to end up to\n>    *\ta maximum of width characters\n>    */\n> -static char *dup_line(const char *start, const char *end, const int width)\n> +static char *dup_line(const char *start, const char *end, const size_t width)\n>   {\n> -\tint maxlen;\n> +\tsize_t maxlen;\n>   \tchar *buffer;\n>   \tchar *bufptr;\n>   \n> @@ -83,9 +83,9 @@ static char *format_remove_multiple_whitespaces(const char *text)\n>    * \tgiven a text string, format it into a list of lines of\n>    *\ttext to a given width.\n>    */\n> -fwts_list *fwts_format_text(const char *text, const int width)\n> +fwts_list *fwts_format_text(const char *text, const size_t width)\n>   {\n> -\tint linelen = 0;\n> +\tsize_t linelen = 0;\n>   \tchar *lastspace = NULL;\n>   \tchar *tidied_text;\n>   \tchar *linestart;\n> \n\nAcked-by: Alex Hung <alex.hung@canonical.com>","headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrYqg5PwYz9s81;\n\tTue, 12 Sep 2017 02:51:59 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1drRwE-0005TN-IJ; Mon, 11 Sep 2017 16:51:58 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <alex.hung@canonical.com>)\n\tid 1drRwC-0005St-KO\n\tfor fwts-devel@lists.ubuntu.com; Mon, 11 Sep 2017 16:51:56 +0000","from mail-pf0-f198.google.com ([209.85.192.198])\n\tby youngberry.canonical.com with esmtps\n\t(TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.76) (envelope-from <alex.hung@canonical.com>)\n\tid 1drRwC-0003Ga-8Y\n\tfor fwts-devel@lists.ubuntu.com; Mon, 11 Sep 2017 16:51:56 +0000","by mail-pf0-f198.google.com with SMTP id y29so15739310pff.6\n\tfor <fwts-devel@lists.ubuntu.com>;\n\tMon, 11 Sep 2017 09:51:56 -0700 (PDT)","from [192.168.1.125] ([207.102.104.225])\n\tby smtp.gmail.com with ESMTPSA id\n\ty6sm17160365pfg.150.2017.09.11.09.51.53\n\tfor <fwts-devel@lists.ubuntu.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 09:51:53 -0700 (PDT)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=md0eBEMdNxxU0335333/hfYcnfV0ZYPDvipFVBjE6F8=;\n\tb=t6SBRR5OyXnZHXtvbFqFm1z1o+58NcVaiqrC2PVywfUeV85jQtZZkVF3OT19KjWost\n\tD2sDvqryHzYCnUbyQYD/K7hMixbsKKhsd0B6lunmPo0OqqcmdpGzhQfhxG0eJPCV+pfK\n\t3jymL0b/FlMiEsd2fxwqxOwaoW8j4HT5WN7RrEyzT6Ae9hzt1JrbU7K6xbmpVhMSOoty\n\tPx5WUagL7SuyZjg1R15SLAEJMKs6V4FhqnF/UbYWjmshVjJ9N551S7zgnRUzW66O+C1/\n\tm7Z7oJOczjCVUEBEv2eSkS5SqcQxTglhpnVW0oekV26+sXc8mb+c+ivSmBNrbAJRaLVk\n\tgHUw==","X-Gm-Message-State":"AHPjjUi4tXUSoIE0KPMIBvNgBob4RwHOFarTIjxy17FVM+KdmXMixgKb\n\t4aXsJh4Bk5jwGuF4nMDuEuqv139WV0BkBv1emzmgMflhVOg7w8kGYkg8x0ZukE8pbPNH1JJB9K8\n\tabSFjoGOz8HJ2TDcbnVLvh82mNBGqSzE=","X-Received":["by 10.84.131.101 with SMTP id 92mr7605516pld.97.1505148714670;\n\tMon, 11 Sep 2017 09:51:54 -0700 (PDT)","by 10.84.131.101 with SMTP id 92mr7605512pld.97.1505148714491;\n\tMon, 11 Sep 2017 09:51:54 -0700 (PDT)"],"X-Google-Smtp-Source":"ADKCNb5Nq3w+LunAZX6q9SNaWbmXvoqsY9kpwn8kweRXWIGIP3ZU1bggODz/Yx6zY/p9lZTkTIeLxg==","Subject":"ACK: [PATCH] lib: fwts_formatting: make width parameter size_t","To":"fwts-devel@lists.ubuntu.com","References":"<20170908094354.16144-1-colin.king@canonical.com>","From":"Alex Hung <alex.hung@canonical.com>","Message-ID":"<480f3fb5-b99d-8a49-4051-f013bf2fae09@canonical.com>","Date":"Mon, 11 Sep 2017 09:51:53 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908094354.16144-1-colin.king@canonical.com>","Content-Language":"en-US","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"}},{"id":1772602,"web_url":"http://patchwork.ozlabs.org/comment/1772602/","msgid":"<f013de52-e9b9-4214-8607-4ee986ca2ad8@canonical.com>","list_archive_url":null,"date":"2017-09-21T09:17:13","subject":"ACK: [PATCH] lib: fwts_formatting: make width parameter size_t","submitter":{"id":14061,"url":"http://patchwork.ozlabs.org/api/people/14061/","name":"Ivan Hu","email":"ivan.hu@canonical.com"},"content":"On 09/08/2017 05:43 PM, Colin King wrote:\n> From: Colin Ian King <colin.king@canonical.com>\n> \n> Lengths of string objects should really be size_t rather than int.\n> \n> Signed-off-by: Colin Ian King <colin.king@canonical.com>\n> ---\n>   src/lib/include/fwts_formatting.h | 2 +-\n>   src/lib/src/fwts_formatting.c     | 8 ++++----\n>   2 files changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/lib/include/fwts_formatting.h b/src/lib/include/fwts_formatting.h\n> index 3431c6aa..036f09e1 100644\n> --- a/src/lib/include/fwts_formatting.h\n> +++ b/src/lib/include/fwts_formatting.h\n> @@ -22,6 +22,6 @@\n>   \n>   #include \"fwts_list.h\"\n>   \n> -fwts_list *fwts_format_text(const char *text, const int width);\n> +fwts_list *fwts_format_text(const char *text, const size_t width);\n>   \n>   #endif\n> diff --git a/src/lib/src/fwts_formatting.c b/src/lib/src/fwts_formatting.c\n> index 3b413bd3..0f661d5c 100644\n> --- a/src/lib/src/fwts_formatting.c\n> +++ b/src/lib/src/fwts_formatting.c\n> @@ -30,9 +30,9 @@\n>    *\tduplicate a portion of a line of text, from start to end up to\n>    *\ta maximum of width characters\n>    */\n> -static char *dup_line(const char *start, const char *end, const int width)\n> +static char *dup_line(const char *start, const char *end, const size_t width)\n>   {\n> -\tint maxlen;\n> +\tsize_t maxlen;\n>   \tchar *buffer;\n>   \tchar *bufptr;\n>   \n> @@ -83,9 +83,9 @@ static char *format_remove_multiple_whitespaces(const char *text)\n>    * \tgiven a text string, format it into a list of lines of\n>    *\ttext to a given width.\n>    */\n> -fwts_list *fwts_format_text(const char *text, const int width)\n> +fwts_list *fwts_format_text(const char *text, const size_t width)\n>   {\n> -\tint linelen = 0;\n> +\tsize_t linelen = 0;\n>   \tchar *lastspace = NULL;\n>   \tchar *tidied_text;\n>   \tchar *linestart;\n> \n\n\nAcked-by: Ivan Hu <ivan.hu@canonical.com>","headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyWGS2FXjz9t3w;\n\tThu, 21 Sep 2017 19:17:20 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1duxbj-0001eK-2f; Thu, 21 Sep 2017 09:17:19 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <ivan.hu@canonical.com>)\n\tid 1duxbh-0001dq-Hd\n\tfor fwts-devel@lists.ubuntu.com; Thu, 21 Sep 2017 09:17:17 +0000","from [175.181.226.10] (helo=[192.168.31.95])\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.76) (envelope-from <ivan.hu@canonical.com>)\n\tid 1duxbg-0004Q4-Vn\n\tfor fwts-devel@lists.ubuntu.com; Thu, 21 Sep 2017 09:17:17 +0000"],"Subject":"ACK: [PATCH] lib: fwts_formatting: make width parameter size_t","To":"fwts-devel@lists.ubuntu.com","References":"<20170908094354.16144-1-colin.king@canonical.com>","From":"ivanhu <ivan.hu@canonical.com>","Message-ID":"<f013de52-e9b9-4214-8607-4ee986ca2ad8@canonical.com>","Date":"Thu, 21 Sep 2017 17:17:13 +0800","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170908094354.16144-1-colin.king@canonical.com>","Content-Language":"en-GB","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"}}]