From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21777 invoked by alias); 19 Feb 2014 20:03:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32415 Received: (qmail 10872 invoked from network); 19 Feb 2014 20:03:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.157.246] X-Spam: 0 X-Authority: v=2.1 cv=L4GTQoj8 c=1 sm=1 tr=0 a=BvYiZ/UW0Fmn8Wufq9dPrg==:117 a=BvYiZ/UW0Fmn8Wufq9dPrg==:17 a=NLZqzBF-AAAA:8 a=lRmC8nGGw4wA:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=hHRNMh62mRYA:10 a=hD80L64hAAAA:8 a=F68mT7fhImA-hreH6C4A:9 a=CjuIK1q_8ugA:10 a=v3rLFGiuRE8A:10 Date: Wed, 19 Feb 2014 20:03:42 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Patch for giga- and terabyte size specifiers Message-ID: <20140219200342.6fd91e4f@pws-pc.ntlworld.com> In-Reply-To: <20140219135242.47240238@pwslap01u.europe.root.pri> References: <201402191412030328.00E5C601@localhost> <20140219135242.47240238@pwslap01u.europe.root.pri> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 19 Feb 2014 13:52:42 +0000 Peter Stephenson wrote: > #if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) > #ifdef LONG_IS_64_BIT > #define ZLONG_CONST(x) x ## l > #else > #define ZLONG_CONST(x) x ## ll > #endif > case TT_GIGABYTES: > scaled += ZLONG_CONST(1073741823); > scaled /= ZLONG_CONST(1073741824); > break; > case TT_TERABYTES: > scaled += ZLONG_CONST(1099511627775); > scaled /= ZLONG_CONST(1099511627776); > break; > #endif OK, how about #if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) #ifdef LONG_IS_64_BIT #define ZLONG_CONST(x) x ## l #else #ifdef ZLONG_IS_LONG_LONG #define ZLONG_CONST(x) x ## ll #else /* * There's some 64-bit type, but we don't know what it is. * We'll just cast it and hope the compiler does the right thing. */ #define ZLONG_CONST(x) ((zlong)x) #endif #else /* We're stuck with long */ #define ZLONG_CONST(x) (x ## l) #endif ? That seems to cover everything we can do within standard C. pws