Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Sat, 08 Sep 2012 09:00:07 -0500 |
| Message-ID | <504B4F68.1AE6@mindspring.com> (permalink) |
| Date | Sat, 08 Sep 2012 10:00:08 -0400 |
| From | pete <pfiland@mindspring.com> |
| Reply-To | pfiland@mindspring.com |
| Organization | PF |
| X-Mailer | Mozilla 3.04Gold (WinNT; I) |
| MIME-Version | 1.0 |
| Newsgroups | comp.lang.c |
| Subject | Re: #define BYTES *8 |
| References | <k1hssn$c4o$1@reader1.panix.com> <4f46c814-7397-40f9-8c60-c24578e2eec1@googlegroups.com> <504946AB.4E34@mindspring.com> <25f81237-76fd-4d1b-90d4-671aa32ffdc6@googlegroups.com> |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| Lines | 24 |
| X-Usenet-Provider | http://www.giganews.com |
| NNTP-Posting-Host | 4.154.223.191 |
| X-Trace | sv3-j6dSGlUB/fRgg61wW7PT4AtKvoY4f823HrcJ3SfeFt2CFRDcYxY68L1djfx09Zn3EpkAW4eg0coA7qw!VQ3vr4NnQS6pIs2nEuKMTG/3BtO95GmhT7qaej7drQqwCxZZht6wAT5KBbz0D0yzuJiddODOk9fS!nLhlfu5Cm1Y= |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 1917 |
| Xref | csiph.com comp.lang.c:26140 |
Show key headers only | View raw
Öö Tiib wrote: > > On Friday, September 7, 2012 3:58:20 AM UTC+3, pete wrote: > > John Bode wrote: > > > If you need to do conversions from one unit to another, > > > create a function or function-like macro with a name > > > that *clearly* conveys the nature of the conversion: > > > > > > #define TO_BITS(x) ( sizeof (x) * CHAR_BIT ) > > > #define TO_BYTES(x) ( (x) / CHAR_BIT ) > > > > I might be inclined to go a little further. > > > > #define BYTES_TO_BITS(x) ( sizeof (x) * CHAR_BIT ) > > It is misleading name, should be something like: > > #define SIZE_IN_BITS_OF(x) ( sizeof(x) * CHAR_BIT ) Either that or I should have read the definition first. I was thinking of it as though it had been ( (x) * CHAR_BIT ) -- pete
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
#define BYTES *8 JohnF <john@please.see.sig.for.email.com> - 2012-08-28 07:44 +0000
Re: #define BYTES *8 Mark Bluemel <mark_bluemel@pobox.com> - 2012-08-28 09:07 +0100
Re: #define BYTES *8 Keith Thompson <kst-u@mib.org> - 2012-08-28 01:38 -0700
Re: #define BYTES *8 JohnF <john@please.see.sig.for.email.com> - 2012-08-28 09:21 +0000
Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-08-28 12:34 +0100
Re: #define BYTES *8 JohnF <john@please.see.sig.for.email.com> - 2012-08-28 12:23 +0000
Re: #define BYTES *8 Kenneth Brody <kenbrody@spamcop.net> - 2012-08-29 11:10 -0400
Re: #define BYTES *8 Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-29 11:36 -0400
Re: #define BYTES *8 Adrian Ratnapala <raka@scooter.fritz.box> - 2012-08-30 04:01 +0000
Re: #define BYTES *8 Kenneth Brody <kenbrody@spamcop.net> - 2012-08-30 19:08 -0400
<OT> Re: #define BYTES *8 Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-30 21:30 -0400
Re: <OT> Re: #define BYTES *8 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-31 02:49 +0100
Re: <OT> Re: #define BYTES *8 JohnF <john@please.see.sig.for.email.com> - 2012-08-31 08:32 +0000
Re: <OT> Re: #define BYTES *8 88888 Dihedral <dihedral88888@googlemail.com> - 2012-08-31 03:55 -0700
Re: <OT> Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-08-31 10:58 +0100
Re: <OT> Re: #define BYTES *8 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-31 11:53 +0100
Re: <OT> Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-08-31 12:39 +0100
Re: <OT> Re: #define BYTES *8 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-08-31 15:35 +0100
Re: <OT> Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-08-31 19:15 +0100
Re: <OT> Re: #define BYTES *8 Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-31 14:39 -0400
Re: <OT> Re: #define BYTES *8 Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-09-06 15:14 +0300
Re: #define BYTES *8 "Scott Fluhrer" <sfluhrer@ix.netcom.com> - 2012-08-28 12:24 -0400
Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-08-28 17:44 +0100
Re: #define BYTES *8 Keith Thompson <kst-u@mib.org> - 2012-08-28 14:42 -0700
Re: #define BYTES *8 pete <pfiland@mindspring.com> - 2012-08-28 23:47 -0400
Re: #define BYTES *8 Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-08-29 22:20 -0600
Re: #define BYTES *8 John Bode <jfbode1029@gmail.com> - 2012-09-06 15:32 -0700
Re: #define BYTES *8 pete <pfiland@mindspring.com> - 2012-09-06 20:58 -0400
Re: #define BYTES *8 Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-06 21:13 -0400
Re: #define BYTES *8 Öö Tiib <ootiib@hot.ee> - 2012-09-07 03:00 -0700
Re: #define BYTES *8 pete <pfiland@mindspring.com> - 2012-09-08 10:00 -0400
Re: #define BYTES *8 "BartC" <bc@freeuk.com> - 2012-09-07 02:22 +0100
Re: #define BYTES *8 John Bode <jfbode1029@gmail.com> - 2012-09-07 05:55 -0700
Re: #define BYTES *8 Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 14:20 -0700
csiph-web