From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33D7DC4743C for ; Wed, 23 Jun 2021 06:09:02 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BC5760FDA for ; Wed, 23 Jun 2021 06:09:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BC5760FDA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5AC7829D7; Wed, 23 Jun 2021 08:08:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1624428539; bh=DJMWlOqaaYVz9FD9jMPhmKA2aN1uETHhVZrkX3f66oE=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=APb/SCXGpcEnUq1mc6U+uxRqVryIEf/tvSg6QXEWoH3pq6+jI3cWTSbvWb8hWsvRX UG7vw6KRA3Jrcrgodimb2ZzYB/vaTVhbG92MJzTd8eVke0McW645X5fK7WfohTEAgc fie/5TKjiKGX3/3y7TNbb8nxXjbA0bY80ECGek3Zii+mRset3iB9EL2XQGJnV2C4L5 gqpPI5fI4dR7XN5VBU/CoeWENkNLIglaNASfmU6sbaSRrAVr90GPD8yNEk5VjjnOvK 74VqotlwoQUJ1yPMzRqbQqck/KLcJ9JEoLAlW1K0wO2A4AoyRS/uTLV8EVace/XDZ/ WhWkLRg4xC02g== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id A473E829B5 for ; Wed, 23 Jun 2021 08:08:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1624428536; bh=DJMWlOqaaYVz9FD9jMPhmKA2aN1uETHhVZrkX3f66oE=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=zdYJ7KbYnnHnZZ126ZKCgaCSOdYT0QpdauSVw9nyRRhXB8G5IGUarhBmXhk11rvUo CqfJQY6KOZw/SIBgYC3OyGW+VPwYalHMPTQNrCojO05gPq5FVld0NUTaO/ywTrPtoq mhIha6BS1szH71tkOMt2hWv4LM7GKn/OVE8X33EJI2g7mdxi7ybOtzDendVTE2CJm5 veIGoLk5I+ipihuP7Vu4BCmvahWlFx/bcxlgxDp9noRP1hQDZvozAYJVUy9QXI5RzN ebNqLkWUW3AcXxL9yVHg/ho7WpMcLqeu4okl0nFCiCCkOH2bwVF/RQ45mIDSA1T1sv WNPiOIaLIXhZA== Received: by janitor.denx.de (Postfix, from userid 108) id 61E3CA0262; Wed, 23 Jun 2021 08:08:56 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id B3F37A0163; Wed, 23 Jun 2021 08:08:50 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 5922F24011D; Wed, 23 Jun 2021 08:08:50 +0200 (CEST) To: Simon Glass cc: Sean Anderson , roland.gaudig-oss@weidmueller.com, U-Boot Mailing List , Roland Gaudig , =?UTF-8?B?TWFyZWsgQmVow7pu?= From: Wolfgang Denk Subject: Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: References: <20210622135042.133904-1-roland.gaudig-oss@weidmueller.com> <20210622135042.133904-2-roland.gaudig-oss@weidmueller.com> <573f7c82-985c-cf55-ac75-b55dc408e3e4@seco.com> Comments: In-reply-to Simon Glass message dated "Tue, 22 Jun 2021 18:09:54 -0600." Date: Wed, 23 Jun 2021 08:08:50 +0200 Message-ID: <223298.1624428530@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear Simon, In message you wrote: > > > > 0m123 ? ('m' for deciMal). > > > > Perhaps 0d123? Though I would prefer to remove many of the implicit > > assumptions of hex input. > > Right, we can't use 'd' because it is valid hex. > > I believe hex is the right default. We just need an easy way to use decimal. Maybe we should make this more general and support an even wirder range of formats? Instead of just converting to decimal, we could pass a format string for sprintf() ? Like: # setexpr foo fmt %d $value ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Question: How does one get fresh air into a Russian church? Answer: One clicks on an icon, and a window opens!