glib-c-conventions
Installation
SKILL.md
GLib C type conventions
- Prefer standard C types over GLib aliases that add no meaning. For example, use
char,size_t,uint8_t,uint32_t, andint64_tinstead ofgchar,gsize,guint8,guint32, andgint64in new code. - Use
size_tfor array indexes, collection lengths, and loop counters compared with a size or length. - Preserve
gsizewhen it is already established in older surrounding code; do not introduce it for new index or length variables. - Use a GLib type when it carries useful semantics or is needed to match an existing public API, callback signature, or surrounding interface. Do not replace types mechanically when that would alter signedness, width, or compatibility.