Date: Sat, 07 Aug 1999 16:53:08 +1000 From: Patryk Zadarnowski <patrykz@mycenae.ilion.eu.org> To: Warner Losh <imp@village.org> Cc: FreeBSD-Hackers@FreeBSD.ORG Subject: Re: quad_t and portability Message-ID: <199908070653.QAA17249@mycenae.ilion.eu.org> In-Reply-To: Your message of "Sat, 07 Aug 1999 00:35:38 CST." <199908070635.AAA07960@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> In message <Pine.BSF.4.10.9908070138180.9444-100000@janus.syracuse.net> "Brian F. Feldman" writes: > : You can always use off_t with "%qd", (int64_t)foo. > > But that isn't portbale. %qd is a bsdism. %lld and %llu are the > latest C standards way to say that. If you're that fixed on portability, "%lux%08ulx", (long)foo>>32, (long)foo is always a perfectly-portable option (or %lud%08ud", (unsigned long)foo / 99999999UL, (unsigned long)foo % 99999999UL if you insist on decimal output; you'll need to watch the signs if you want to use longs instead of unsigned longs, but it's only mariginally more complicated). I doubt that the cost of splitting foo into two would be significant considering that it is split up into digits inside printf() anyway (it might actually be faster on some architectures). l8r, patryk. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908070653.QAA17249>