Re: [hackers] [dwm][PATCH] Use proper conversion specifier and don't assume int == 32bits

2022-02-17 Thread Laslo Hunhold
On Thu, 17 Feb 2022 01:33:40 +0100 Hiltjo Posthuma wrote: > This is crazy, keep it simple As you know, madness is like gravity ... all it takes is a little (git) push.

Re: [hackers] [dwm][PATCH] Use proper conversion specifier and don't assume int == 32bits

2022-02-16 Thread Hiltjo Posthuma
On Wed, Feb 16, 2022 at 01:07:37PM +0100, Laslo Hunhold wrote: > On Wed, 16 Feb 2022 17:46:47 +0600 > NRK wrote: > > Dear NRK, > > > Attached two small patches, one fixing the conversion specifier to > > `%u` for unsigned int and another one not for not assuming int == > > 32bits. > > > >

Re: [hackers] [dwm][PATCH] Use proper conversion specifier and don't assume int == 32bits

2022-02-16 Thread Laslo Hunhold
On Wed, 16 Feb 2022 19:10:06 +0600 NRK wrote: Dear NRK, > I don't think this is possible, at least not with the LENGTH macro. > The pre-processor doesn't have access to `sizeof` operator. thanks for your quick and helpful answer, and sorry on my behalf for this mistake. It totally makes sense

Re: [hackers] [dwm][PATCH] Use proper conversion specifier and don't assume int == 32bits

2022-02-16 Thread NRK
On Wed, Feb 16, 2022 at 01:07:37PM +0100, Laslo Hunhold wrote: > @all: why not make a static compile-time-check on LENGTH(tags) and vary > the type accordingly? > > #if LENGTH(tags) < 8 > typedef tag_bitmap uint_least8_t; > #elif LENGTH(tags) < 16 > typedef tag_bitmap uint_least16_t;

Re: [hackers] [dwm][PATCH] Use proper conversion specifier and don't assume int == 32bits

2022-02-16 Thread Laslo Hunhold
On Wed, 16 Feb 2022 17:46:47 +0600 NRK wrote: Dear NRK, > Attached two small patches, one fixing the conversion specifier to > `%u` for unsigned int and another one not for not assuming int == > 32bits. > > These are more closer to pedantic cleanups rather than actual > meaningful changes, but