Path: utzoo!attcan!uunet!husc6!mailrus!ames!umd5!eneevax!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.sources.bugs Subject: Re: bug in sps memory size reporting for Sun-3 Message-ID: <11753@mimsy.UUCP> Date: 31 May 88 21:42:46 GMT References: <5654@columbia.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 26 In article <5654@columbia.edu> dupuy@douglass.columbia.edu (Alexander Dupuy) writes: >... The header file sps.h assumed that all Suns would have a page size of 2K. [some diffs deleted; then:] > /* Convert clicks to kbytes ... */ >! # ifndef PGSHIFT > # define KBYTES( size ) ((size) << 1) > # else >+ # if PGSHIFT > 10 >+ # define KBYTES( size ) ((size) << (PGSHIFT - 10)) >+ # else > # define KBYTES( size ) ((size) >> (10 - PGSHIFT)) >+ # endif Why not simply use the macro that is provided for this purpose? #include#define KBYTES(size) (ctob(size) >> 10) /* or ctob(size) / 1024 */ (PCC tends not to merge the shifts, but that probably will make little real difference.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris