From 8739f7fccb7cafc54ca0f5fa074c9a740f7048ba Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 5 Jul 2018 10:31:29 +0000 Subject: Make tox.c unambiguously parseable. Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum --- toxcore/tox_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toxcore/tox_api.c') diff --git a/toxcore/tox_api.c b/toxcore/tox_api.c index 31f21158..87123968 100644 --- a/toxcore/tox_api.c +++ b/toxcore/tox_api.c @@ -5,7 +5,7 @@ #include #include -#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}} +#define SET_ERROR_PARAMETER(param, x) do { if (param) { *param = x; } } while (0) #define CONST_FUNCTION(lowercase, uppercase) \ -- cgit v1.2.3