brl: don't use conversion to float for offset and count

Ralph Böhme rb at sernet.de
Wed Jun 4 11:32:44 MDT 2014


Hi Volker

On Tue, Jun 03, 2014 at 03:41:07PM +0200, Volker Lendecke wrote:
> https://en.wikipedia.org/wiki/Inttypes.h
> 
> has PRIu64 as the format specifier for a uint64_t. If you
> look deep inside
> 
> http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
> 
> it seems that this is C99 standard these days. Samba does
> already use this in various places.
> 
> I could not find a reference to "j" in C99, only in susv4.

page 277:

  Specifies that a following d, i, o, u, x, or X conversion specifier
  applies to an intmax_t or uintmax_t argument; or that a following n
  conversion specifier applies to a pointer to an intmax_t argument.

> Both are probably possible, but for orthogonality reasons I
> would argue to settle on one of both.

I prefer casting to (u)intmax_t and using "j", because that makes the
code ready for 128 bit.

But if you prefer I can convert to using the fixed size macros.

Thanks!
-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de


More information about the samba-technical mailing list