liuliu / ccv

C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library
http://libccv.org
Other
7.08k stars 1.72k forks source link

Design choices : anonymous structs #72

Open FlorianDenis opened 10 years ago

FlorianDenis commented 10 years ago

Hey,

I was wondering if you could expand on the decision of using anonymous structs in ccv such as

typedef struct {
    int type;
    uint64_t sig;
    ...
} ccv_dense_matrix_t;

This prevents forward-declaring of ccv_dense_matrix_t and I can't seem to figure out where you could benefit from such a design choice.

I would actually benefit from such changes, would you accept a pull request naming these structs if I were to make one ?

liuliu commented 10 years ago

hey, I would like to take the extern struct decl, however, I would like to take it in the form of

typedef struct ccv_dense_matrix { } ccv_dense_matrix_t;

what do you think? The reason is that claiming

struct ccv_dense_matrix_t* mat;

with the extra _t to denote it is a struct seems to me like a repetition.