|
Rockbox mail archiveSubject: Re: Typedef ruleRe: Typedef rule
From: Michael Sparmann <theseven_at_gmx.net>
Date: Fri, 29 Nov 2013 21:19:53 +0100 > (1) No typedef for structs and unions. These types help with the > aforementioned problems by themselves. Don't typedef just to avoid > writing out "struct" and "union". > (2) No typedef for trivial ints, like normal counters (except tick) or > something like that. > (3) Allow typedefs where reasonable for integral types, i.e. where it > helps enforcing a specific type, improves readability and portability. > (4) Allow typedefs for void, as to give "void *" a more telling type. > (5) Generally no typedef for pointers. Hiding a pointer between some > type remains discouraged except in one case: Hiding that the type is a > pointer at all, when the type is strictly used to identify an object > (compatible to long/intptr_t). Typedefing a pointer might be okay if it > points to an incomplete struct/union. This case is actually similar to > (3) where you typedef intptr_t to something better named. +1 from me as well. In my opinion the current rules are too strict. Received on 2013-11-29 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |