On 09/15/2010 02:58 PM, Denys Vlasenko wrote:
On Wed, 2010-09-15 at 14:20 +0200, Nikola Pajkovsky wrote:
On 09/14/2010 06:29 PM, Denys Vlasenko wrote:
On Tue, 2010-09-14 at 17:29 +0200, Nikola Pajkovsky wrote:
typedef struct dump_dir { char *dd_dump_dir; DIR *dd_next_dir; int dd_locked; uid_t dd_uid; gid_t dd_gid; } dump_dir_t;
Also I'm getting hate construction `typedef struct dump_dir {} dump_dir_t'. Give me a month and I will be sitting and asking my self. What does dump_dir_t mean?
What style do you like more than this?
It's a *mistake* to use typedef for structures and pointers.
In my opinion, it is not a mistake. It is just a different style.
Different people have different preferences. Trying to turn others so that they like what you like is (a) nearly impossible, and (b) not necessary. Even arguing about the style at length is pointless, yet the programming forums are full with such discussions...
We only need to agree on hte style which is _tolerable_ for all of us, not on the style we all _like_. There are more important things to do.
Although I think in this case I am overreacting to your emphasis on "*mistake*" word.
The most readable code is
struct dump_dir { };
and in function use
void func(..., struct dump_dir *whatever, ...);
The old style was ok for me. This one is ok too.
I vote for not hiding the "struct" in typedef.
J.