From 29da951a3a9ecc8c922972448584d121905b610f Mon Sep 17 00:00:00 2001 From: Eugene Zelenko Date: Tue, 23 Aug 2016 17:57:24 +0000 Subject: [PATCH] [Documentation] Fix style of Clang-tidy readability-non-const-parameter. llvm-svn: 279541 --- .../checks/readability-non-const-parameter.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-non-const-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-non-const-parameter.rst index 3c4625a..0729470 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-non-const-parameter.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-non-const-parameter.rst @@ -6,16 +6,19 @@ readability-non-const-parameter The check finds function parameters of a pointer type that could be changed to point to a constant type instead. -When const is used properly, many mistakes can be avoided. Advantages when using -const properly: - * prevent unintentional modification of data - * get additional warnings such as using uninitialized data - * make it easier for developers to see possible side effects +When ``const`` is used properly, many mistakes can be avoided. Advantages when +using ``const`` properly: + +- prevent unintentional modification of data; + +- get additional warnings such as using uninitialized data; + +- make it easier for developers to see possible side effects. This check is not strict about constness, it only warns when the constness will make the function interface safer. -.. code:: c++ +.. code-block:: c++ // warning here; the declaration "const char *p" would make the function // interface safer. @@ -41,4 +44,3 @@ make the function interface safer. int f3(struct S *p) { *(p->a) = 0; } - -- 2.7.4