[parted-devel] Parted on GNU Hurd based systems

Jim Meyering jim at meyering.net
Tue Mar 6 07:47:47 CET 2007


"Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> wrote:

>> > c. I have not used
>> > #define sigaction (a, b, c)
>> > Instead used a blank function definition, and a couple of blank
>> > structures to keep things readable.
>
>> Good.  A function is better, when the stronger parameter
>> type checking doesn't cause trouble.  I have to lose the macro reflex.
>> But make the function be "static inline".
>
> I thought the stronger type-checking was a plus. :-)

It usually is.
But if a goal of defining away the function is also to avoid
using a type that'd be declared solely for one of its parameters,
then you can argue that using #define is better.

>> I find it more readable when cpp directives are indented
>> according to their nesting level.  E.g.
>>
>>   #ifndef SA_SIGINFO
>>   # ifndef HAVE_SIGACTION
>>
>> and
>>
>>   #ifndef SEGV_MAPERR
>>   # define SEGV_MAPERR INTMAX - 1
>>   #endif
>
> That is true, however I did not do it purpsefully since this style is
> not followed uniformly everywhere in the Parted code. What I shall do
> is indent the newly introduced pre-processor statements, and the fix
> the rest in a later patch. What should be the indentation depth? The
> same 8 spaces or something else?

0, 1, or maybe 2.
Using 8 spaces is ugly and impairs readability, since
lines end up being too long, and have to be wrapped more.
As we're hoping for mechanical code reformatting, what you
do here doesn't really matter.



More information about the parted-devel mailing list