From 40509ccb3d71afacdaaab531e4110cd95f5fb743 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 17 Aug 2016 11:54:53 +0200 Subject: [PATCH] Update CONTRIBUTING.md C++ conversion - good C-Style cast - bad --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e09f079ee..624483264 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -176,6 +176,18 @@ Function names are not separated from the first parenthesis. ``` +1. ##### Always use `C++ conversion` instead of `C-Style cast`. Generally, all the conversion among types should be avoided. If you have no choice, use C++ conversion. + + * ###### Good: + ```cpp + char aChar = static_cast(_pEditView->execute(SCI_GETCHARAT, j)); + ``` + + * ###### Bad: + ```cpp + char aChar = (char)_pEditView->execute(SCI_GETCHARAT, j); + ``` + #### NAMING CONVENTIONS