Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!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: Fri, 16 Sep 2011 17:35:46 -0500 Message-ID: <4E73CF44.619F@mindspring.com> Date: Fri, 16 Sep 2011 18:35:48 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: datatype for bit flags References: <87k4994fkd.fsf@bazspaz.fatphil.org> <930e767b-26f0-4123-836d-64dac1f47cfb@d2g2000vbk.googlegroups.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 26 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.156.228.129 X-Trace: sv3-IIAbSGgDyt32TBTBWmeHbWV8upaSqRB3lDnwQeSFYypzDP4CjT2PEtyf1u7lFHpMkGUZlOXAOzyIZrV!1lbsrY+SrzrAE+uYdhrBGZCsKHtl438z2KSTMK73s86gNOfyqhaN76Ihp5BjAsGoiAuyJqz2gF05!TPG3Ukg9W8s= 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: 1949 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:10359 comp.lang.c++:10207 Tony wrote: > > Malcolm McLean wrote: > > > You should use int for an > > integer unless there is a > > clear reason for using another type. Though > > each instance will only save a few cycles, if you systematically use > > int the speed increment may be worth having. > > Did you mean that just in the context of the OP/this thread, or in > general? I only use data types which are smaller than int, when there is a special reason. It's possible that small types may be aligned on int boundaries, meaning that there may be unusable bytes in between them. It's also possible that there may be masking operations invloved with simple arithmetic operations on small types. Small types tend to get converted to type int in various operations. -- pete