Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | James Kuyper <jameskuyper@verizon.net> |
| Newsgroups | comp.lang.c |
| Subject | Re: Changing type at runtime for image acquisition |
| Date | Mon, 21 Nov 2011 16:04:20 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 18 |
| Message-ID | <4ECABCD4.5090508@verizon.net> (permalink) |
| References | <KMxyq.101324$GZ3.69880@tornado.fastwebnet.it> <4ECAAE78.7050304@verizon.net> <nzyyq.101345$GZ3.64187@tornado.fastwebnet.it> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-15 |
| Content-Transfer-Encoding | 7bit |
| Injection-Info | mx04.eternal-september.org; posting-host="2P71cupDoazVVolqpw1jrw"; logging-data="15996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Gs1DjBcEW6LmLFwFhHVVFjJdYIB1kBoY=" |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
| In-Reply-To | <nzyyq.101345$GZ3.64187@tornado.fastwebnet.it> |
| Cancel-Lock | sha1:Unoe8WUwoDtUn3cW0Swy8+dlSKE= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c:13738 |
Show key headers only | View raw
On 11/21/2011 03:32 PM, Davide wrote: > James Kuyper wrote: > > <snip> >> You could use void* to store the pointer to the buffer, and convert to >> __int8 or __int16 as needed: >> >> if(eight_bit) >> n = ((__int8*)internal_buffer)[j]; >> else >> n = ((__int16*)internal_buffer)[j]; ... > Thank you very much. I understood your second approach with a union, > but i have some doubts about the first one. What type should 'n' be? It could be __int16, but int_fast16_t is more precisely what I'd want to use. However, I'd normally translate 'int_fast16_t' to 'int', simply because it's easier to type, unless speed is very important.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Changing type at runtime for image acquisition Davide <idontwant@emailsfrom.spammers> - 2011-11-21 20:38 +0100
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 15:03 -0500
Re: Changing type at runtime for image acquisition Davide <idontwant@emailsfrom.spammers> - 2011-11-21 21:32 +0100
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 15:42 -0500
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 16:04 -0500
Re: Changing type at runtime for image acquisition Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 20:48 +0000
Re: Changing type at runtime for image acquisition "BartC" <bc@freeuk.com> - 2011-11-21 21:34 +0000
csiph-web