Cogl Coding Style -------------------- This document is intended to be a short description of the preferred coding style to be used for the Cogl source code. Coding style is a matter of consistency, readability and maintainance; coding style is also completely arbitrary and a matter of taste. This document will use examples at the very least to provide authoritative and consistent answers to common questions regarding the coding style, and will also try to identify the allowed exceptions. The Cogl coding style is currently defined relative to the Clutter coding style, so please first read clutter/docs/CODING_STYLE. Differences to the Clutter coding style: + Headers Cogl headers are not exempt from the 80 characters limit as they are in Clutter. Function prototypes should not be arranged into vertical columns but should instead look somthing like this: void my_function (CoglType type, CoglType *a_pointer, CoglType another_type); + Types Avoid the use of redundant glib typedefs and wherever possible simply use ANSI C/c99 types. The following types should not be used: gint, guint, gfloat, gdouble, glong, gulong, gchar, guchar, guint{8,16,32} or gint{8,16,32} Instead use: int, unsigned int, float, double, long, unsigned long, char, unsigned char, uint{8,16,32}_t and int{8,16,32}_t Use CoglBool for boolean types. When ever you need a byte size type for dealing with pixel data then uint8_t should be used. The general intention is that Cogl should look palatable to the widest range of C programmers including those outside the Gnome community so - especially for the public API - we want to minimize the number of foreign looking typedefs.