Today's patches
Julien ÉLIE
julien at trigofacile.com
Thu May 14 16:38:05 UTC 2015
Hi Russ,
>> ISO Standard C says that if an initializer initializes some but not all
>> elements, the additional elements are automatically initialized as if
>> "0" was explicitly given. This makes it nice to use "={0}" as a default
>> initializer, without having to update the initializer every time the
>> elements in a struct are changed.
>
> INN doesn't take advantage of this as a matter of coding style, because
> it's otherwise very easy to miss initialization sites if you add a new
> element to a struct that *shouldn't* be initialized with 0.
I have just checked how these structs are currently used, to confirm
that it is OK to initialize all of them with 0.
The initialization is now done this way:
ARTHANDLE newart = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
I hope it is fine this way (that is to say "0" instead of "NULL"
for pointers is portable enough).
--
Julien ÉLIE
« Il avait juste assez de culture pour faire des citations
fausses. » (Byron)
More information about the inn-workers
mailing list