From patchwork Tue Sep 22 12:17:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Sionneau X-Patchwork-Id: 1369037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=kalray.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kalray.eu header.i=@kalray.eu header.a=rsa-sha256 header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=TzU5NdXE; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BwgLQ5h7Tz9sSC for ; Tue, 22 Sep 2020 22:17:50 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id CE43010350; Tue, 22 Sep 2020 14:17:30 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mib.mailinblack.com (mib.mailinblack.com [185.7.73.95]) by helium.openadk.org (Postfix) with ESMTPS id A793F102E3 for ; Tue, 22 Sep 2020 14:17:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mib.mailinblack.com (Postfix) with ESMTP id 45EFF328D82 for ; Tue, 22 Sep 2020 12:17:18 +0000 (UTC) Received: from mib.mailinblack.com (localhost [127.0.0.1]) by mib.mailinblack.com with SMTP (Mib Daemon ) id KFDXBFPC for devel@uclibc-ng.org; Tue, 22 Sep 2020 12:17:18 +0000 (UTC) Received: from zimbra2.kalray.eu (zimbra2.kalray.eu [92.103.151.219]) by mib.mailinblack.com (Postfix) with ESMTPS id 1A838328DE5 for ; Tue, 22 Sep 2020 12:17:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id C34A527E1091 for ; Tue, 22 Sep 2020 14:17:17 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id O3cGaSCvVOMA; Tue, 22 Sep 2020 14:17:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 1621F27E1068; Tue, 22 Sep 2020 14:17:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 1621F27E1068 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1600777037; bh=DwDeL6Pifq8WSq2p8pA01rppv53+7AMYWMgLM1WU1S0=; h=From:To:Date:Message-Id; b=TzU5NdXEsVNPkq4uBrYWGARXLZXm51Sq4MzlSEDAseAcUnOYENDUOLwltZdVr0dIg PdpWaDDFFDrleofTVQyjPpFklzfUYON18EQsy6X+p6A63nz654dGzzeu/cA6V8pD4N 8K8WbFeF09zTV3Usb9pWD7QKJFp/oTx9ckOgbjPs= X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nWmTT0hwUwkc; Tue, 22 Sep 2020 14:17:17 +0200 (CEST) Received: from junon.lin.mbt.kalray.eu (unknown [192.168.37.161]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 0258C27E1056; Tue, 22 Sep 2020 14:17:17 +0200 (CEST) From: Yann Sionneau To: devel@uclibc-ng.org Date: Tue, 22 Sep 2020 14:17:00 +0200 Message-Id: <20200922121703.12838-4-ysionneau@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200922121703.12838-1-ysionneau@kalray.eu> References: <20200922121703.12838-1-ysionneau@kalray.eu> Subject: [uclibc-ng-devel] [PATCH 3/6] Fix warning about macro redefinition X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Fixes this: libc/misc/internals/tempname.c: In function 'brain_damaged_fillrand': libc/misc/internals/tempname.c:155:0: warning: "L" redefined #define L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS) In file included from ./libpthread/nptl/sysdeps/unix/sysv/linux/lowlevellock.h:24:0, from ./include/bits/libc-lock.h:35, from ./include/bits/stdio-lock.h:22, from ./include/bits/uClibc_mutex.h:73, from ./include/bits/uClibc_stdio.h:83, from ./include/stdio.h:71, from libc/misc/internals/tempname.c:35: ./libc/sysdeps/linux/kvx/sysdep.h:40:0: note: this is the location of the previous definition # define L(name) $L##name Signed-off-by: Yann Sionneau --- libc/misc/internals/tempname.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c index ca87b0c06..d3a8ccbd8 100644 --- a/libc/misc/internals/tempname.c +++ b/libc/misc/internals/tempname.c @@ -152,12 +152,12 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len) for (i = 0; i < len; ++i) { rh = high % NUM_LETTERS; high /= NUM_LETTERS; -#define L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS) - k = (low % NUM_LETTERS) + (L * rh); -#undef L -#define H ((UINT32_MAX / NUM_LETTERS) + ((UINT32_MAX % NUM_LETTERS + 1) / NUM_LETTERS)) - low = (low / NUM_LETTERS) + (H * rh) + (k / NUM_LETTERS); -#undef H +#define _L ((UINT32_MAX % NUM_LETTERS + 1) % NUM_LETTERS) + k = (low % NUM_LETTERS) + (_L * rh); +#undef _L +#define _H ((UINT32_MAX / NUM_LETTERS) + ((UINT32_MAX % NUM_LETTERS + 1) / NUM_LETTERS)) + low = (low / NUM_LETTERS) + (_H * rh) + (k / NUM_LETTERS); +#undef _H k %= NUM_LETTERS; buf[i] = letters[k]; }