[parted-devel] Nested structs and unions.

Debarshi Ray debarshi.ray at gmail.com
Fri Feb 16 00:47:39 CET 2007


Lines 62 to 114 in libparted/fs/fat/bootsector.h, and lines 141 to 181
in libparted/fs/hfs/hfs.h separately define two structures which
contain structures/unions as elements within them. In the first case
the complex elements are indented, while in the second they are not as
shown below:

struct foo {
        int ...
struct bar {
        int ...
} ...
};

struct foo {
        int ...
        struct bar {
                int ...
        }
};

This has led to two completely different ways of defining such complex
data-types, in turn affecting the style and readability of the code.

Which one is preferred?

Happy hacking,
Debarshi
-- 
After the game the king and the pawn go into the same box.
                -- Italian proverb



More information about the parted-devel mailing list