[{"id":1752569,"web_url":"http://patchwork.ozlabs.org/comment/1752569/","msgid":"<f67298fe-c675-636b-5684-353b5bdba894@denx.de>","list_archive_url":null,"date":"2017-08-21T09:19:48","subject":"Re: [swupdate] [PATCH resent] archival/gun: Fix Wsign-compare\n\tcompiler warnings","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/","name":"Stefano Babic","email":"sbabic@denx.de"},"content":"On 17/08/2017 16:23, Christian Storm wrote:\n> Fix Wsign-compare according to latest version of gun.c from\n> https://github.com/madler/zlib/blob/master/examples/gun.c\n> \n> Signed-off-by: Christian Storm <christian.storm@siemens.com>\n> ---\n>  archival/gun.c | 20 ++++++++++----------\n>  1 file changed, 10 insertions(+), 10 deletions(-)\n> \n> diff --git a/archival/gun.c b/archival/gun.c\n> index 67ac9bf..ade0379 100644\n> --- a/archival/gun.c\n> +++ b/archival/gun.c\n> @@ -82,7 +82,7 @@ static unsigned in(void *in_desc, unsigned char **buf)\n>      } while (ret != 0 && len < SIZE);\n>      percent = (unsigned int)(((double)(me->total - me->nbytes)) * 100 /\n>  \t\t    (me->total ? me->total : 1));\n> -    if (percent != me->percent) {\n> +    if (percent != (unsigned int)me->percent) {\n>  \tme->percent = percent;\n>  \tswupdate_progress_update(percent);\n>      }\n> @@ -179,7 +179,7 @@ static int lunpipe(unsigned have, unsigned char *next, struct ind *indp,\n>                    int outfile, z_stream *strm)\n>  {\n>      int last;                   /* last byte read by NEXT(), or -1 if EOF */\n> -    int chunk;                  /* bytes left in current chunk */\n> +    unsigned chunk;             /* bytes left in current chunk */\n>      int left;                   /* bits left in rem */\n>      unsigned rem;               /* unused bits from input */\n>      int bits;                   /* current bits per code */\n> @@ -460,10 +460,10 @@ static int gunpipe(z_stream *strm, int infile, unsigned long *offs, int nbytes,\n>  \n>          /* check trailer */\n>          ret = Z_BUF_ERROR;\n> -        if (NEXT() != (outd.crc & 0xff) ||\n> -            NEXT() != ((outd.crc >> 8) & 0xff) ||\n> -            NEXT() != ((outd.crc >> 16) & 0xff) ||\n> -            NEXT() != ((outd.crc >> 24) & 0xff)) {\n> +        if (NEXT() != (int)(outd.crc & 0xff) ||\n> +            NEXT() != (int)((outd.crc >> 8) & 0xff) ||\n> +            NEXT() != (int)((outd.crc >> 16) & 0xff) ||\n> +            NEXT() != (int)((outd.crc >> 24) & 0xff)) {\n>              /* crc error */\n>              if (last != -1) {\n>                  strm->msg = (char *)\"incorrect data check\";\n> @@ -471,10 +471,10 @@ static int gunpipe(z_stream *strm, int infile, unsigned long *offs, int nbytes,\n>              }\n>              break;\n>          }\n> -        if (NEXT() != (outd.total & 0xff) ||\n> -            NEXT() != ((outd.total >> 8) & 0xff) ||\n> -            NEXT() != ((outd.total >> 16) & 0xff) ||\n> -            NEXT() != ((outd.total >> 24) & 0xff)) {\n> +        if (NEXT() != (int)(outd.total & 0xff) ||\n> +            NEXT() != (int)((outd.total >> 8) & 0xff) ||\n> +            NEXT() != (int)((outd.total >> 16) & 0xff) ||\n> +            NEXT() != (int)((outd.total >> 24) & 0xff)) {\n>              /* length error */\n>              if (last != -1) {\n>                  strm->msg = (char *)\"incorrect length check\";\n> \n\nApplied to -master, thanks !\n\nBest regards,\nStefano Babic","headers":{"Return-Path":"<swupdate+bncBAABBOWL5LGAKGQECSAC3PQ@googlegroups.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=googlegroups.com\n\t(client-ip=2a00:1450:400c:c0c::23d;\n\thelo=mail-wr0-x23d.google.com;\n\tenvelope-from=swupdate+bncbaabbowl5lgakgqecsac3pq@googlegroups.com;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=googlegroups.com header.i=@googlegroups.com\n\theader.b=\"mf52BqYh\"; dkim-atps=neutral"],"Received":["from mail-wr0-x23d.google.com (mail-wr0-x23d.google.com\n\t[IPv6:2a00:1450:400c:c0c::23d])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xbSnn1GRRz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 21 Aug 2017 19:19:57 +1000 (AEST)","by mail-wr0-x23d.google.com with SMTP id z91sf3742497wrc.2\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 21 Aug 2017 02:19:56 -0700 (PDT)","by 10.28.150.151 with SMTP id y145ls2766wmd.3.canary-gmail; Mon, 21\n\tAug 2017 02:19:53 -0700 (PDT)","from mail-out.m-online.net (mail-out.m-online.net.\n\t[2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id\n\tg21si1377152wmd.0.2017.08.21.02.19.53\n\tfor <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 21 Aug 2017 02:19:53 -0700 (PDT)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xbSnj4dCLz1r97B;\n\tMon, 21 Aug 2017 11:19:53 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xbSnj3Ppcz3jgYl;\n\tMon, 21 Aug 2017 11:19:53 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id PjVuOzMPYjdP; Mon, 21 Aug 2017 11:19:52 +0200 (CEST)","from babic.homelinux.org\n\t(host-88-217-136-221.customer.m-online.net [88.217.136.221])\n\t(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tMon, 21 Aug 2017 11:19:52 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id F2B7A45404AE;\n\tMon, 21 Aug 2017 11:19:51 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id bCEANf6zfRWm; Mon, 21 Aug 2017 11:19:48 +0200 (CEST)","from [192.168.178.132] (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id BEAE2454019C;\n\tMon, 21 Aug 2017 11:19:48 +0200 (CEST)"],"ARC-Seal":["i=2; a=rsa-sha256; t=1503307194; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=C7y+v+ZYDodHT86bd/7Ft5au5rHKLNGAKyWdHJ4i/r42aHuJ7Uf421pzUiVwf2uTH9\n\tWVqmgxuTB+/PtgJcDum+ot7Hw6ztFj0YffFRp5LYdSvp1W+Wz9g8cXj1EetExY2RExH+\n\ta2fDv/WiovvEaeH1Jm1Hj4C2w2mg2ZkaBCuK71WN5tEtAgX7ddgPLy120Eyu6JfJDJKj\n\thfH99EOpomLhXBGyKWC4YALICRxwMHuHZYab9XupJCOpoqnCD0mwFlkPZG9JfajpyYl3\n\tQXDl537hvH6yCrtidA4DWJeNjmfKBhwNcCYm/q0jHZ5mHrW+t9dK/0xkPwoW8O+q/ErU\n\tGv8Q==","i=1; a=rsa-sha256; t=1503307193; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=J7QBjOQMOjlMxDIyrjtCu9Mq1Juvh57rufvdsDJuBg46JAtmp8twr0lb/9MM9Rwp+n\n\tmY0Rs3D9h0SHuJ+TC3uqSvqe0NjQyDwR9V5kR9cAtKTbZBqMOk4c7H9QWN0FdgFknkv/\n\twS3ZbgI+eL8Qwn8PHtcpxdHCF6db0F7JWVO4HAFDL0Ka5MIuX+IG70klYXsqx9yIPPUn\n\t7NBPZl2CAV3CM8FYCs5hSAgV371fOoZ9yGgDIL2+uy4l23/rTRq1meKM1ALfQ4NpRHJG\n\tVniAyu6XxAoPEUvmWRzuhfczIjavkh8V0P+wUvDEWfQo8QL8QOskDzLctKnmVdXukpW0\n\tf4IQ=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n\t:list-id:mailing-list:precedence:content-language:in-reply-to\n\t:mime-version:user-agent:date:message-id:from:references:to:subject\n\t:arc-authentication-results:arc-message-signature:sender\n\t:dkim-signature:arc-authentication-results;\n\tbh=9hmrkqHKiDslrqgd736JF8QMg9ejNpxSoUOj+cU1O+M=;\n\tb=JAWT7CmmPT0C6A8Mu+nt8gBgPTDmhTz6DE9FJ/laIgZwP7zNuwQPtg340eXzEmhNY9\n\tOnJDe3dOZfjnFTZsj+mrqAx2PlsXDJely75IxU7TE5yYSt0tvH23y1gUUfj9iZYF9vHQ\n\tV6gtz/jPQMd3TYJAu4iHThDsuu8jckY3KuiaXvZ8EroDMJ+rme8okHxl7NBeJwhHmySC\n\tj0SZrKed1muVoMFepi8kfZHdVFW0wsXkxK4D+H1f8m+HsSAsf1mnC88ch/Nh90RKcQDD\n\tz/xygQrhmWbBB0tRgN2Gr49LL2C+peCmrIY1SeR+JT7xzpAvn3R3c5HLXG1ZXLMsa0Iq\n\tNlMw==","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=content-transfer-encoding:content-language:in-reply-to:mime-version\n\t:user-agent:date:message-id:from:references:to:subject\n\t:arc-authentication-results;\n\tbh=NfIrG/AOLmJ2dxqAob3TBEWil7Zu6RRVjdgsXjjoXhA=;\n\tb=Pve+5vZ850eTf9LBgJ5NQnmRPilCMRz2azIb3E8vHapGid4j9oNGrHYKhV240YjZZN\n\tHq84cW3uzdgC9e/uV2LTdgnHVZtlQe8HvTAV1korEoGBlDa5NBZSGxLjH4H6MSpiBkmB\n\t9TOqTbJjsfeEXJMGLX1eKzPqjIcwrIMLbECWFQOYpe6Ofk1mdKHRi8s3LvggrvkBTsYR\n\trsfo1wnXd8O8vM+iLvaMn9g61sHQBpuI9j8TMOMtDl8NtHQ5YRDvcxkYbPM6wokKJjz1\n\tsG/9HU7pzwgHbHHFw6a7heaGWs5BcydPbM/EcZo98EXg973gwADAxLQLZFR3LjQiNxan\n\tmHvA=="],"ARC-Authentication-Results":["i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted\n\tnor denied by best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de","i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted\n\tnor denied by best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=googlegroups.com; s=20161025;\n\th=sender:subject:to:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:x-original-sender\n\t:x-original-authentication-results:precedence:mailing-list:list-id\n\t:list-post:list-help:list-archive:list-subscribe:list-unsubscribe;\n\tbh=9hmrkqHKiDslrqgd736JF8QMg9ejNpxSoUOj+cU1O+M=;\n\tb=mf52BqYhecvYRNlEP18gYgjYUDdI7whpCHVoU6HWTdTpOXQYBgKrCHOfDUMdDfNGIm\n\tQ1+wkkaiTGVsNq0fXVaH+JkF58U3S9+2oGMx3z0vYWxp+J90aA2pzI8BnFfxoWRyYgG2\n\tIimYNxhbf+NqoZ5snXz6smevG/tDEA/uoOfvsKrddDstivN4re11qMZJZaAq3U2BGEhS\n\t1DpFZgbP3tQCEA/+21j0mDaIwsqOr5JHKWaaaaKIRSzM/XODvVaVlOizuOLMuFbCIwoS\n\tVcG04G1KoI9jTdXO4vVkuMAR+GS/FydBVWFZkExTyIvcsOhv1afWvQfcq83W9ZunOVFQ\n\tU7sQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=sender:x-gm-message-state:subject:to:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:x-original-sender:x-original-authentication-results:precedence\n\t:mailing-list:list-id:x-spam-checked-in-group:list-post:list-help\n\t:list-archive:list-subscribe:list-unsubscribe;\n\tbh=9hmrkqHKiDslrqgd736JF8QMg9ejNpxSoUOj+cU1O+M=;\n\tb=gW/ESjtqAaDMQajfKxO8E+5GCcsN8/5Q6I7D0+9lxQYbX4U4daPHFjm85qfzowH3pE\n\tpPBKm0XabmXcD8ibTGthBBgpotP5hQ3vJPxFOB6teTdp8c9ufnR1KhEqM7Uc1MrrgcGs\n\tU4dmPbyQJBd+oImpXaDM6/3RLLdRchKwGEjRBmsIQ9tSw8atk0vx359HzU5iwfiv/NE1\n\tCkcH7tzbLf//dUh/EBJqXdFiWLw39QeuJkhSxMGk/MHqe8wqwoHCEpZGlReMxs1XgYca\n\t2IuZF0GnF0INgR2ANAMfIdRwWI13RgJAlqEsJuH+seyQGS5ATh08aV6UUq+7KIbkvdCC\n\tR63A==","Sender":"swupdate@googlegroups.com","X-Gm-Message-State":"AHYfb5gePeY1eHvRjpsgNAhKiAGBS2mqjBZ7zpxXtX3SPmCHqWt9AKTM\n\tRyjL8oviTaIzDg==","X-Received":["by 10.28.184.143 with SMTP id i137mr15862wmf.13.1503307194268;\n\tMon, 21 Aug 2017 02:19:54 -0700 (PDT)","by 10.28.130.213 with SMTP id e204mr1619829wmd.12.1503307193871; \n\tMon, 21 Aug 2017 02:19:53 -0700 (PDT)"],"X-BeenThere":"swupdate@googlegroups.com","Received-SPF":"neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither\n\tpermitted nor denied by best guess record for domain of\n\tsbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; ","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"Subject":"Re: [swupdate] [PATCH resent] archival/gun: Fix Wsign-compare\n\tcompiler warnings","To":"Christian Storm <christian.storm@siemens.com>, swupdate@googlegroups.com","References":"<20170817142355.2483-1-christian.storm@siemens.com>","From":"Stefano Babic <sbabic@denx.de>","Message-ID":"<f67298fe-c675-636b-5684-353b5bdba894@denx.de>","Date":"Mon, 21 Aug 2017 11:19:48 +0200","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":"<20170817142355.2483-1-christian.storm@siemens.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Language":"en-GB","X-Original-Sender":"sbabic@denx.de","X-Original-Authentication-Results":"gmr-mx.google.com;       spf=neutral\n\t(google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied\n\tby best\n\tguess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de","Precedence":"list","Mailing-list":"list swupdate@googlegroups.com;\n\tcontact swupdate+owners@googlegroups.com","List-ID":"<swupdate.googlegroups.com>","X-Spam-Checked-In-Group":"swupdate@googlegroups.com","X-Google-Group-Id":"605343134186","List-Post":"<https://groups.google.com/group/swupdate/post>,\n\t<mailto:swupdate@googlegroups.com>","List-Help":"<https://groups.google.com/support/>,\n\t<mailto:swupdate+help@googlegroups.com>","List-Archive":"<https://groups.google.com/group/swupdate","List-Subscribe":"<https://groups.google.com/group/swupdate/subscribe>,\n\t<mailto:swupdate+subscribe@googlegroups.com>","List-Unsubscribe":"<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n\t<https://groups.google.com/group/swupdate/subscribe>"}}]