From: Wolfgang Denk <wd@denx.de>
To: roland.gaudig-oss@weidmueller.com
Cc: u-boot@lists.denx.de,
"Roland Gaudig" <roland.gaudig@weidmueller.com>,
"Marek Behún" <marek.behun@nic.cz>,
"Simon Glass" <sjg@chromium.org>
Subject: Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal
Date: Wed, 23 Jun 2021 08:03:01 +0200 [thread overview]
Message-ID: <223201.1624428181@gemini.denx.de> (raw)
In-Reply-To: <20210622135042.133904-2-roland.gaudig-oss@weidmueller.com>
Dear Roland,
In message <20210622135042.133904-2-roland.gaudig-oss@weidmueller.com> you wrote:
>
> This patch extends the setexpr command with a dec operator to
> convert an input value to decimal.
...
> + /* hexadecimal to decimal conversion: "setexpr name dec value" */
> + if (argc == 4 && (strcmp(argv[2], "dec") == 0)) {
> + w = cmd_get_data_size(argv[3], 4);
> + a = get_arg(argv[3], w);
> + return env_set_ulong(argv[1], a);
> + }
Should there not be a test for 4 arguments and the third _not_ being
"dec" ? Like "setexpr foo hex 42" ?
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
A wise man asks himself the reason for his mistakes, while a fool
will ask others.
next prev parent reply other threads:[~2021-06-23 6:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 13:50 [PATCH v1 0/1] cmd: setexpr: add dec operation for converting variable to decimal roland.gaudig-oss
2021-06-22 13:50 ` [PATCH v1 1/1] " roland.gaudig-oss
2021-06-22 19:25 ` Simon Glass
2021-06-22 19:30 ` Sean Anderson
2021-06-23 0:09 ` Simon Glass
2021-06-23 6:08 ` Wolfgang Denk
2021-06-25 12:57 ` Tom Rini
2021-06-23 6:03 ` Wolfgang Denk [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-06-23 8:20 Roland Gaudig (OSS)
2021-06-23 8:53 Roland Gaudig (OSS)
2021-06-23 9:43 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=223201.1624428181@gemini.denx.de \
--to=wd@denx.de \
--cc=marek.behun@nic.cz \
--cc=roland.gaudig-oss@weidmueller.com \
--cc=roland.gaudig@weidmueller.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox