Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 4 Sep 2002 17:53:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 4 Sep 2002 17:53:26 -0400 Received: from p50886EA2.dip.t-dialin.net ([80.136.110.162]:62858 "EHLO hawkeye.luckynet.adm") by vger.kernel.org with ESMTP id ; Wed, 4 Sep 2002 17:53:25 -0400 Date: Wed, 4 Sep 2002 15:57:47 -0600 (MDT) From: Thunder from the hill X-X-Sender: thunder@hawkeye.luckynet.adm To: Thunder from the hill cc: Tomas Szepe , Hans Reiser , Dave Kleikamp , "David S. Miller" , , , , , , Oleg Drokin Subject: Re: [reiserfs-dev] Re: [PATCH] sparc32: wrong type of nlink_t In-Reply-To: Message-ID: X-Location: Dorndorf/Steudnitz; Germany MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1176 Lines: 42 Hi, On Wed, 4 Sep 2002, Thunder from the hill wrote: > On Wed, 4 Sep 2002, Tomas Szepe wrote: > > typedef unsigned long long u64; > > > > /* usable for char, short int, and int */ > > #define set_to_max(a) \ > > { \ > > u64 max = ((u64) 2 << (sizeof(a) * 8 - 1)) - 1; \ > > a = max; if ((u64) a != max) a = max / 2; \ > > } This is the wholesale: typedef unsigned long long u64; /* usable for char, short int, and int */ #define set_to_max(a) do { \ u64 __val_max = ((u64) 1 << (sizeof(a) * 8)) - 1; \ a = __val_max; \ if ((u64) a != __val_max) \ a = __val_max / 2; \ } while(0) #define set_to_min(a) do { \ set_to_max(a); \ a++; \ } while(0) Thunder -- --./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .- --/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..- .- -/---/--/---/.-./.-./---/.--/.-.-.- --./.-/-.../.-./.././.-../.-.-.- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/