Re: [dev] [dwm][st] why use ints over bools?

From: sewn <sewn_AT_disroot.org>
Date: Thu, 20 Jun 2024 22:24:16 +0300

On 2024-06-15 22:06, Страхиња Радић wrote:

> Дана 24/06/15 11:54AM, Zac написа:
>
>> I'm curious why you use ints though. Because bools are 31 bits smaller
>> than
>> ints, which is 31 bits of memory saved. Not that 31 bits is very much,
>> but
>> still...
>
> https://suckless.org/coding_style/
>
>> Tests and Boolean Values
>>
>> * Do not use C99 bool types (stick to integer types).
>>
>> * Otherwise use compound assignment and tests unless the line grows
>> too long:
>>
>> if (!(p = malloc(sizeof(*p))))
>> hcf();

Sure, but why?
Received on Thu Jun 20 2024 - 21:24:16 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 20 2024 - 21:24:39 CEST