Deutsch   English   Français   Italiano  
<vi5o2e$3ljhl$3@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: BGB <cr88192@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Tue, 26 Nov 2024 18:10:48 -0600
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <vi5o2e$3ljhl$3@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vi56tj$3ip1o$1@dont-email.me>
 <vi583f$3ie0o$3@dont-email.me> <vi59df$3ip1o$3@dont-email.me>
 <vi5la0$3ljhl$1@dont-email.me>
 <9c173c3d8e8a2c24d134dfad7fe1641acf728424@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Nov 2024 01:10:54 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d6b866aa0925367d3810d7714da21602";
	logging-data="3853877"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19NMvAeZ/8hl2ZFvMx/XRNYag+ULYbkh/s="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Sryi0dh1GbW7CGINP+lXQpgynKk=
Content-Language: en-US
In-Reply-To: <9c173c3d8e8a2c24d134dfad7fe1641acf728424@i2pn2.org>
Bytes: 1910

On 11/26/2024 5:54 PM, fir wrote:
> BGB pisze:
>>    Drop stuff that is very rarely used:
>>      Such as C's bitfield declarations;
> 
> lol, bitfields very rarely used?
> they may be used rarely but they are very important and needed,
> whan you say have map of tiles, or big arrays of characters
> you need couple of soem bit-size flags in them and you dont want to 
> waste big memory on chars or do logical arithmetic on bytes
> 
> for sure you cant skip bitfields

Almost always, code will do something like:
  if(val&FLAG)
Or:
   r=(val>>10)&31;
   g=(val>> 5)&31;
   b=(val>> 0)&31;
....

But:
struct rbg555_s {
   uint16_t b:5;
   uint16_t g:5;
   uint16_t r:5;
   uint16_t t:1;
};
Not so much...