From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CD28C138350 for ; Sun, 19 Jan 2020 12:37:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30869E0955; Sun, 19 Jan 2020 12:37:21 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 15F31E0955 for ; Sun, 19 Jan 2020 12:37:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0F5CF34E28B for ; Sun, 19 Jan 2020 12:37:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7A0DAED for ; Sun, 19 Jan 2020 12:37:16 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1579436454.f47f9880d7266d2e87b2530ea777e4a104ee1a71.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: main.h X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: f47f9880d7266d2e87b2530ea777e4a104ee1a71 X-VCS-Branch: master Date: Sun, 19 Jan 2020 12:37:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a33903d3-165b-41a9-8b47-306a928ac20f X-Archives-Hash: fa158ffe1a9e7fe9d4d2ab6114c41df7 commit: f47f9880d7266d2e87b2530ea777e4a104ee1a71 Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 19 12:20:54 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 19 12:20:54 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f47f9880 main.h: attempt fix for Coverity 206563 Unintended sign extension Signed-off-by: Fabian Groffen gentoo.org> main.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.h b/main.h index a7fe725..35b95ab 100644 --- a/main.h +++ b/main.h @@ -64,10 +64,10 @@ extern const char *argv0; #endif #define READ_BE_INT32(P) \ - ((((unsigned char *)(P))[0] << 24) | \ - (((unsigned char *)(P))[1] << 16) | \ - (((unsigned char *)(P))[2] << 8 ) | \ - (((unsigned char *)(P))[3])) + (((unsigned int)((unsigned char *)(P))[0] << 24) | \ + ((unsigned int)((unsigned char *)(P))[1] << 16) | \ + ((unsigned int)((unsigned char *)(P))[2] << 8 ) | \ + ((unsigned int)((unsigned char *)(P))[3])) #define WRITE_BE_INT32(P,I) \ { \ ((unsigned char *)(P))[0] = (I & 0xff000000) >> 24; \