From patchwork Thu Aug 17 14:23:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 802703 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::23c; helo=mail-lf0-x23c.google.com; envelope-from=swupdate+bncbdd6bwv65qpbb2go23gakgqeo7k47ci@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="ZUHLbkbT"; dkim-atps=neutral Received: from mail-lf0-x23c.google.com (mail-lf0-x23c.google.com [IPv6:2a00:1450:4010:c07::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xY7mW5PVBz9t4P for ; Fri, 18 Aug 2017 00:25:46 +1000 (AEST) Received: by mail-lf0-x23c.google.com with SMTP id g77sf12317lfg.8 for ; Thu, 17 Aug 2017 07:25:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1502979944; cv=pass; d=google.com; s=arc-20160816; b=VvQnSCBOVNble/BzHPOPfVI7JJ3VrfiMgi7Lofzz78Uc74e9+B5xom0fMUJbA0RFXQ /oUyWRV+N3sQfJ5F5Rl2SADar67qx5cxxiTt8oh1Ue/Z7Y7bSqWyJ42PcqUBHeee4r7L ODJl4mUVJcbWbW89Ma4yKxIzy5qZV0NPX8B4EArlaIRXY3b8KPIiVriRAyJUKO5S59nK Hf0WGKKMHWQa0DgTAON0wbBZX+V6leXKUBx/Bw79qQu/wX3bEpoLgyW6ogaF2lHV2RrJ XWBqMLA/b4gc6VavR8VjRPwk0grSwHOsuArDwtvjqHmpor2rGwJXFyyfLITG5BSnTa82 59PQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=rGfl+DrVhwWUy/0hVbuGGRv0TClJ4wZRdjbqeiHqsec=; b=ks6ZNlOsjz80ImhtQCfUQRT7rguXhU5s8zJ5CbzPtfMOSn7VliUu4UrHqFL2dk1y0S YSuzqGm4V4UtkGPmlVWl0jK92w567x5Q5UuZqqUsws+WDxPyZYgEMNGOIH8P3NF8RYD8 XJ2Zv4hM/9Pa2IF2anVjkb425l9EE3QEaKDHHAR5hVlNu/O38ioDJZZWijB7TLjs/3Jw 1E9n9amr59vJfOt66yNUUT0+av0JFbgM3RCWYx6gbXsh9tsyi9sPCN7y5s6Ts2k8jbyA sLDtacy+dec/YpJO6K1m5n7GuVF1Wtw5SCAm62ochob2CltKbMF3pfTasTZ9LerjrtS6 a62A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=rGfl+DrVhwWUy/0hVbuGGRv0TClJ4wZRdjbqeiHqsec=; b=ZUHLbkbTgB+/8m0fZLiTtQrOQEZSe288+qTJnwSTsQUhnhSGTvgWtU9gYIXLdSMgaM qNPntXXCu7XBAmA0euLKlPcBxuryeuNU8IVRwTovAHH81tgijco58/ErKMFWZqAf0T9G 8WtAIW6ISh2gy4I9ZqtJC3w6za5BehYs1XaL+gRZKWkP73ypdt28nML6YjSBI8hjNpy0 DE4LjeUIlNWmtR5WiAm7N+Gij6GZhdTg9wVSPbuxh5MXQeLm2a7CCAW6vlnNC8JrqG7d RuKOCv+MxVOF+vDVd3Trc/SWz734OKnUOrBkHj92EBJ1lfJTnrnAY7JR/GUALTaRsZo1 zaog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=rGfl+DrVhwWUy/0hVbuGGRv0TClJ4wZRdjbqeiHqsec=; b=suy2XFLmdHVHElH+TKupX5wX+rAOJ+ZWCRTt+mqIu6C8+6A7FYwki8pZn/HuJPhCQT sl0b4BuE2nHj0afmjD93e1roPV63qKvEmj2RNgPN6xuBl8Ch4Y/sic2mYrA/78PXCH9l z1zKvVrQPPg1kmcWlE6GtjR9FVzXq/Sb67nZ0wNHvWYBK+BbDl+OGgdgp/VUySJqMEZl qW0KahJ6uBVt7lnB6SmDkYbuqBWl6cvzJVzY8yD3V2sYlT8XxJPXiaa1dwDjDqOryV2t 4lFj5U+PolesbmuKJGDR2nZ/eH3HT8C4iF7lwj7Rlpm5JVkcOYzWuTUHHZy7g0s+1Av/ Q3fg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHYfb5hnRwmyESY9AG3wtYfg6cBVxanv7vRH/+Ihj5UIPRDgc/Kqsh70 FDIRCB6Ov0qQkQ== X-Received: by 10.25.15.37 with SMTP id e37mr636lfi.0.1502979944371; Thu, 17 Aug 2017 07:25:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.25.77.10 with SMTP id a10ls236449lfb.43.gmail; Thu, 17 Aug 2017 07:25:44 -0700 (PDT) X-Received: by 10.46.5.9 with SMTP id 9mr930828ljf.28.1502979944018; Thu, 17 Aug 2017 07:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502979943; cv=none; d=google.com; s=arc-20160816; b=LK1G4pEwvwgTAaJyvMcLh7yr1bfQcPCks9/YGqi5l9NdMiiWA6mbvQXHcn8pjrMxQU s+GakW/3OzxgdVA8qlLhY3oI2ygH70vQ540JW73O9Qt1xs4sJSpULs7933969DD2b1wd u7cGusyyXFyiNs46VMV+eO7+i2eIMEPotljQm6OKTJUi9G5JpPfW0Bex34c2sWG5DWcA XHVWqGedZ1ehc8ECNdOLeyeM9d4x7QmSPWi+ycas9SmCE1Fhg/Y0pzbvvxaSh2aGcohV bw9bFu2M7J/QTUoO6jksSu0M5nmAEbP5wTpbctyX9mNomANbRkoZljZ9/LGvMtJhFIag q7/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=8hoI6wU9FQ7BsUFTgLvqxM3gRSfD7cnOn6DmMkS5++g=; b=w7ANIUFIpqwj1G53gHuZtlZPQFrs9gbK7/Uv0XrLNlTeiAvH/ws8tIJeWUIwBexUql Xx+5X5NDDC95yB119ps01V9bMujGiwg51NHnkL17wcOwKrh2JQYe7Myoy/F83XZ+YxkP SfLCqiaQn/mAY+gJjlK2IwFK48zhsopvMg1Np/X65B7F0F594R1SB8sf0J7s6ELOSIcc I+bPO6eeIjWmHUbyppcceXhgx4DVPsqzV4LQqK9opF6wscYd9Rn0mqkYGcohcE7tF8mX ThRkhEsNGDXlMJAvhH69WQbLDbXYKfvnV3QgDkUSFeZdpHWfN0RC/znZH00mamdnH+9U CVzw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id j199si1646356wmj.4.2017.08.17.07.25.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Aug 2017 07:25:43 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) client-ip=192.35.17.2; Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v7HEPh0a018419 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Aug 2017 16:25:43 +0200 Received: from MD1KR9XC.ww002.siemens.net ([139.25.68.253]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v7HEPhaO000668; Thu, 17 Aug 2017 16:25:43 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH resent] archival/gun: Fix Wsign-compare compiler warnings Date: Thu, 17 Aug 2017 16:23:55 +0200 Message-Id: <20170817142355.2483-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.14.1 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Fix Wsign-compare according to latest version of gun.c from https://github.com/madler/zlib/blob/master/examples/gun.c Signed-off-by: Christian Storm --- archival/gun.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/archival/gun.c b/archival/gun.c index 67ac9bf..ade0379 100644 --- a/archival/gun.c +++ b/archival/gun.c @@ -82,7 +82,7 @@ static unsigned in(void *in_desc, unsigned char **buf) } while (ret != 0 && len < SIZE); percent = (unsigned int)(((double)(me->total - me->nbytes)) * 100 / (me->total ? me->total : 1)); - if (percent != me->percent) { + if (percent != (unsigned int)me->percent) { me->percent = percent; swupdate_progress_update(percent); } @@ -179,7 +179,7 @@ static int lunpipe(unsigned have, unsigned char *next, struct ind *indp, int outfile, z_stream *strm) { int last; /* last byte read by NEXT(), or -1 if EOF */ - int chunk; /* bytes left in current chunk */ + unsigned chunk; /* bytes left in current chunk */ int left; /* bits left in rem */ unsigned rem; /* unused bits from input */ int bits; /* current bits per code */ @@ -460,10 +460,10 @@ static int gunpipe(z_stream *strm, int infile, unsigned long *offs, int nbytes, /* check trailer */ ret = Z_BUF_ERROR; - if (NEXT() != (outd.crc & 0xff) || - NEXT() != ((outd.crc >> 8) & 0xff) || - NEXT() != ((outd.crc >> 16) & 0xff) || - NEXT() != ((outd.crc >> 24) & 0xff)) { + if (NEXT() != (int)(outd.crc & 0xff) || + NEXT() != (int)((outd.crc >> 8) & 0xff) || + NEXT() != (int)((outd.crc >> 16) & 0xff) || + NEXT() != (int)((outd.crc >> 24) & 0xff)) { /* crc error */ if (last != -1) { strm->msg = (char *)"incorrect data check"; @@ -471,10 +471,10 @@ static int gunpipe(z_stream *strm, int infile, unsigned long *offs, int nbytes, } break; } - if (NEXT() != (outd.total & 0xff) || - NEXT() != ((outd.total >> 8) & 0xff) || - NEXT() != ((outd.total >> 16) & 0xff) || - NEXT() != ((outd.total >> 24) & 0xff)) { + if (NEXT() != (int)(outd.total & 0xff) || + NEXT() != (int)((outd.total >> 8) & 0xff) || + NEXT() != (int)((outd.total >> 16) & 0xff) || + NEXT() != (int)((outd.total >> 24) & 0xff)) { /* length error */ if (last != -1) { strm->msg = (char *)"incorrect length check";