Deutsch English Français Italiano |
<v4kput$3joiu$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Richard Harnden <richard.nospam@gmail.invalid> Newsgroups: comp.lang.c Subject: Re: "undefined behavior"? Date: Sat, 15 Jun 2024 20:27:25 +0100 Organization: A noiseless patient Spider Lines: 24 Message-ID: <v4kput$3joiu$1@dont-email.me> References: <666a095a$0$952$882e4bbb@reader.netnews.com> <8t3k6j5ikf5mvimvksv2t91gbt11ljdfgb@4ax.com> <666a18de$0$958$882e4bbb@reader.netnews.com> <87y1796bfn.fsf@nosuchdomain.example.com> <666a2a30$0$952$882e4bbb@reader.netnews.com> <87tthx65qu.fsf@nosuchdomain.example.com> <v4dtlt$23m6i$1@dont-email.me> <NoEaO.2646$J8n7.2264@fx12.iad> <v4fc5j$2cksu$1@dont-email.me> <v4ff97$2d8l1$1@dont-email.me> <87o784xusf.fsf@bsb.me.uk> <v4g7i3$2icc2$1@dont-email.me> <87ikybycj6.fsf@bsb.me.uk> <v4hk5v$2tttf$1@dont-email.me> <87cyojxlgj.fsf@bsb.me.uk> <v4igj8$330vf$2@dont-email.me> <v4ko7d$3jbip$1@dont-email.me> Reply-To: nospam.harnden@invalid.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 15 Jun 2024 21:27:25 +0200 (CEST) Injection-Info: dont-email.me; posting-host="287e4cd145a2ef14a8930eb2f68b8217"; logging-data="3793502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Z5347i71Orla7qJ/tUgMyiMq7YvQL3I0=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:GuazGsB6QOKXirTp5s1pSwQAwJM= Content-Language: en-US In-Reply-To: <v4ko7d$3jbip$1@dont-email.me> Bytes: 2306 On 15/06/2024 19:57, David Brown wrote: > > If you want BBX_RGBA to be a typedef for an unsigned 32-bit integer, write: > > typedef uint32_t BBX_RGBA; > > If you want bbx_rgba() to be a function that is typesafe, correct, and > efficient (for any decent compiler), write : > > static inline BBX_RGBA bbx_rgba(uint32_t r, uint32_t g, > uint32_t b, uint32_t a) > { > return (r << 24) | (g << 16) | (b << 8) | a; > } > Shouldn't that be ... ? static inline BBX_RGBA bbx_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a)