[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [patch;debian-installer/anna] OBO in malloc computation, whitespace, typedef



 
> 	* packages.h: typedef package_t

> -struct package_t {
> +typedef struct package_t {
>  	char *package;
>  	char *filename;
>  	char *md5sum;
>  	int installer_menu_item;
>  	struct package_t *next;
> -};
> +} package_t;
> 

Actually i think its best to do

typedef struct package_s {
	char *package;
	char *filename;
	char *md5sum;
	int installer_menu_item;
	struct package_s *next;
} package_t;


in package_s; s is an abriviation for struct so whenever you see
(name)_s you know its a struct in package_t; t is an abreviation for
type so whenever you see (name)_t you know its a type

If _s and _t are mixed up (s used for a type or t used for a struct)
then then it looses all value in representing something.

Its required to define the struct (_s) because *next needs it, and
defining the type (_t) is usefull for refering to it later on instead of
always refering to it as struct package_s

I think one of the reasons people use struct (struct_name) instaed of
just (type_name) is because the difference between the two are sometimes
confused, however if _s and _t are used consistently (and people are
aware thats why its used) then it avoids confusion.


Glenn



Reply to: