[PATCH 00/15] lib: Add support for a decimal 0m prefix for numbers

Tom Rini trini at konsulko.com
Tue Jul 20 17:04:44 CEST 2021


On Tue, Jul 20, 2021 at 10:00:13AM -0500, Jonathan A. Kollasch wrote:
> On Tue, Jul 20, 2021 at 07:29:24AM -0600, Simon Glass wrote:
> > U-Boot mostly uses hex for value input, largely because addresses are much
> > easier to understand in hex.
> > 
> > But in some cases a hex value is requested, but it is more convenient to
> > provide a decimal value. This may be because the value comes from another
> > source, where its base cannot be controlled.
> > 
> > This series adds support for a 0m prefix to indicate a decimal number. The
> > letter 'm' is chosen because:
> > 
> >    - 'm' as in deciMal
> >    - cannot use a-f since they indicate a hex value (e.g. 0d would be
> >        ambiguous)
> >    - 'l' is harder to read since 1 and l look similar (0l123)
> >    - 't' (as in ten) seems a bit obscure
> 
> NetBSD ddb(4) uses 0t as a prefix for base 10.

Oh no... And per
https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/n--set-number-base-
there's examples of '0t' being decimal and '0n' being decimal.

http://web.mit.edu/~jik/sipbsrc/sun4c_53/lsof/lsof_3.61/00FAQ uses 0t
the same way NetBSD ddb(4) does.
https://docs.oracle.com/cd/E19683-01/806-6545/api-21/index.html is also
using 0t for decimal.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210720/4b0b712d/attachment.sig>


More information about the U-Boot mailing list