Fix warnings in non-autogenerated files.

1. Remove unnecessary semi-colons.
2. Remove commas at the end of enumerator lists.
3. Use casts with the ternary operator to ensure both alternatives have the
   same type.
4. Remove asserts that unsigned values are greater than or equal to zero.