Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • If structs are to be exposed in an interface (in a .h file) typedef it
  • Raw struct names (in the initial declaration) should begin with an underscorebe the same as the typedef name
  • Field variables that are not meant to be accessed by other modules should also begin with an underscore
  • Naming for structs should be capital camel case

...

struct helloworld{
  int do_not_modify;
} HelloWorld;

//good
typedef struct _HelloWorld{
     int16_t _do_not_modify;
     uint32_t  cancan_access_directly;
} HelloWorld;

...