[ Offtopic thread #1: "struct typedefs considered harmful" ] > struct foo > > and > > foo_t > > are both universally understood.
I can't know what a "foo_t" is without looking it up, so it's not "universal" in any meaningful sense. > "struct foo" however clutters the > code, especially in long function parameter lists, and distracts from > the underlying algorithms/parameters. When I see "foo_t" param I can't know how to use it. When I see "struct foo" I know it's a struct passed by value; access as NAME.member, and it's safe to mangle. When I see "struct foo *" I now it's a struct passed by pointer; access as NAME->member, and unsafe to mangle (except according to what callers expect). When I see "int" I know it's passed by value, and is safe to mangle; no substructure access syntax. > What you call "standard" is just other people's programming preferences. It's standard in the sense that you know what it means just by looking at those few lines ... no need to look anywhere else to know the basics. New-to-the-project programmers have less to learn, which seems healthy. If you call wanting to *avoid* any "look *everything* up in some type catalog" steps a programming preference ... I can hardly stop you. _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development