All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Rees <rees@umich.edu>
To: Jan Engelhardt <jengelh@inai.de>
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] strings: helper for maximum decimal encoding of an unsigned integer
Date: Fri, 14 Sep 2012 09:46:37 -0400	[thread overview]
Message-ID: <20120914134637.GA8943@umich.edu> (raw)
In-Reply-To: <alpine.LNX.2.01.1209141456290.18169@frira.zrqbmnf.qr>

Jan Engelhardt wrote:

  >A pure K&R-C version would use a string:
  >#define base10len(i) "\0x1\0x3\0x5\0x8\0x0A\0x0D\0x0F\0x11\0x14"[sizeof(i)]
  >(if I converted them properly into hexadecimal)
  The syntax is \x01\x03\x05...

K&R doesn't have the \x escape, only \0 (octal).

  reply	other threads:[~2012-09-14 13:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 21:29 [PATCH] strings: helper for maximum decimal encoding of an unsigned integer J. Bruce Fields
2012-08-21 21:22 ` Jim Rees
2012-08-21 22:06   ` Al Viro
2012-08-21 22:19     ` J. Bruce Fields
2012-08-22  0:03     ` Jim Rees
2012-09-10  6:19 ` Jan Engelhardt
2012-09-14  9:17   ` Bernd Petrovitsch
2012-09-14 12:30     ` Jim Rees
2012-09-14 13:14       ` J. Bruce Fields
2012-09-14 13:18       ` Bernd Petrovitsch
2012-09-14 13:51         ` Jim Rees
2012-09-14 13:37       ` Jan Engelhardt
2012-09-14 13:54         ` Jim Rees
2012-09-14 12:59     ` Jan Engelhardt
2012-09-14 13:46       ` Jim Rees [this message]
2012-09-14 14:25         ` Jan Engelhardt
2012-09-14 15:00           ` Bernd Petrovitsch

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=20120914134637.GA8943@umich.edu \
    --to=rees@umich.edu \
    --cc=bernd@petrovitsch.priv.at \
    --cc=bfields@fieldses.org \
    --cc=jengelh@inai.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.