hubo/hubo-ach — pull request #14 by saulrh (2013-02-22 22:59:51+00:00)
Title: Fix struct definitions

The big change here is that I've added typdefs to all of the struct definitions. This has two effects.

First, there were a few struct definitions of the form `struct type { } type_t`, missing the typedef that this pattern typically begins with. This code, instead of creating a type type_t that you can use instead of `struct type`, creates a *variable* named type_t of type struct type. This is annoying and clutters up namespaces, but the bigger problem is that this typo will completely break things if you try to use hubo-ach from a c++ program. When the variable type_t is defined, C++ will attempt to call its undefined constructor and break; adding the typedef fixes this behaviour.

Second, the codebase was littered with variable and function definitions which used the full `struct type var` thing to declare variables of struct types. Adding the typedefs means that you can use `type_t var` instead of `struct type var`, which makes those long function definitions a lot easier to understand.

TL;DR: you can use "type_t" instead of "struct type", and hubo-ach now works with c++ projects.