From: Nikos Mavrogiannopoulos Date: Fri, 14 Jul 2017 18:52:49 +0000 (+0200) Subject: CONTRIBUTING.md: specified rules on boolean functions X-Git-Tag: gnutls_3_6_0~297 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96d8dd8bfa8daa271ddd022270fe7c077952d496;p=thirdparty%2Fgnutls.git CONTRIBUTING.md: specified rules on boolean functions Based on suggestion by Hubert Kario. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b120ba7f1..d3bf37b354 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -139,6 +139,20 @@ error codes are defined in gnutls.h and a description is available in gnutls_errors.c +Functions which are intended to return a boolean value should return +a type of bool, and it is recommended to contain the string '_is_' +on its function name; e.g., +``` +bool _gnutls_is_not_prehashed(); +``` + +That allows the distinguishing functions that return negative errors +from boolean functions to both the developer and the compiler. Note +that in the past the 'unsigned' type was used to distinguish boolean functions +and several of these still exist. + + + # Usage of assert() The assert() macro --not to be confused with gnutls_assert()-- is used