From owner-freebsd-hackers Fri Aug 6 23:53:36 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mycenae.ilion.eu.org (mycenae.ilion.eu.org [203.35.206.129]) by hub.freebsd.org (Postfix) with ESMTP id 9D0EC14C1C for ; Fri, 6 Aug 1999 23:53:32 -0700 (PDT) (envelope-from patrykz@mycenae.ilion.eu.org) Received: from mycenae.ilion.eu.org (localhost [127.0.0.1]) by mycenae.ilion.eu.org (8.9.3/8.9.3) with ESMTP id QAA17249; Sat, 7 Aug 1999 16:53:08 +1000 (EST) (envelope-from patrykz@mycenae.ilion.eu.org) Message-Id: <199908070653.QAA17249@mycenae.ilion.eu.org> To: Warner Losh Cc: FreeBSD-Hackers@FreeBSD.ORG Subject: Re: quad_t and portability In-reply-to: Your message of "Sat, 07 Aug 1999 00:35:38 CST." <199908070635.AAA07960@harmony.village.org> Date: Sat, 07 Aug 1999 16:53:08 +1000 From: Patryk Zadarnowski Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > In message "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