From: Anthony Minessale Date: Mon, 12 Dec 2016 19:47:00 +0000 (-0600) Subject: add enum rules X-Git-Tag: v1.8.0~893^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff57e94889dd3f9cd83b7b2961217f9e968e9a53;p=thirdparty%2Ffreeswitch.git add enum rules --- diff --git a/libs/libks/CODING_GUIDELINES b/libs/libks/CODING_GUIDELINES index 3e74781f45..223d3b87a9 100644 --- a/libs/libks/CODING_GUIDELINES +++ b/libs/libks/CODING_GUIDELINES @@ -45,8 +45,22 @@ Only use // style-comments on tempory comments that will probably be removed eve Add the emacs/vi comment to the bottom of every file. Use Doxygen for function args. Tabs not spaces. +Use flags as bitwise when possible, use arrays if going beyond 32 +Typedef all enums using UPPER_CASE notation for the values */ +typedef enum { + SOME_FLAG_X = (1 << 0), + SOME_FLAG_Y = (1 << 1) +} some_flag_type_t; + +typedef enum { + SOME_TYPE_X = 1, + SOME_TYPE_Y, + SOME_TYPE_Z +} some_type_t; + + KS_DECLARE(ks_status_t) function_example(somedata_t **data, ks_pool_t *pool) { int var = 3, x = 0;