From 2e5017c6efa6ca746be32935a905c91b66ab8642 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 17 Feb 2015 18:32:56 +0100 Subject: [PATCH] Fix missing returns in the Doxygen test suite code. Missing returns resulted in test suite failures now that it is built with -Wreturn-type, so avoid them by simply making most of the functions void and adding explicit return statements to a couple of them that used Doxygen \return command in their documentation, which doesn't make sense for the void functions. --- .../test-suite/doxygen_basic_notranslate.i | 13 ++++++------ Examples/test-suite/doxygen_basic_translate.i | 13 ++++++------ Examples/test-suite/doxygen_translate.i | 7 ++++--- .../test-suite/doxygen_translate_all_tags.i | 20 +++++++++---------- Examples/test-suite/doxygen_translate_links.i | 2 +- .../doxygen_translate_all_tags_runme.py | 6 +++--- 6 files changed, 32 insertions(+), 29 deletions(-) diff --git a/Examples/test-suite/doxygen_basic_notranslate.i b/Examples/test-suite/doxygen_basic_notranslate.i index e97cc589f..45e36c6e3 100644 --- a/Examples/test-suite/doxygen_basic_notranslate.i +++ b/Examples/test-suite/doxygen_basic_notranslate.i @@ -22,13 +22,14 @@ */ int function() { + return 0; } /** * A test of a very very very very very very very very very very very very very very very very * very very very very very long comment string. */ -int function2() +void function2() { } @@ -36,7 +37,7 @@ int function2() * A test for overloaded functions * This is function \b one */ -int function3(int a) +void function3(int a) { } @@ -44,7 +45,7 @@ int function3(int a) * A test for overloaded functions * This is function \b two */ -int function3(int a, int b) +void function3(int a, int b) { } @@ -64,12 +65,12 @@ int function3(int a, int b) * \endcode * \endif */ -int function4() +void function4() { } -int function5(int a) +void function5(int a) { } /**< This is a post comment. */ @@ -78,7 +79,7 @@ int function5(int a) * Test for default args * @param a Some parameter, default is 42 */ -int function6(int a=42) +void function6(int a=42) { } diff --git a/Examples/test-suite/doxygen_basic_translate.i b/Examples/test-suite/doxygen_basic_translate.i index b8bd7668a..0a8b0474f 100644 --- a/Examples/test-suite/doxygen_basic_translate.i +++ b/Examples/test-suite/doxygen_basic_translate.i @@ -18,13 +18,14 @@ */ int function() { + return 0; } /** * A test of a very very very very very very very very very very very very very very very very * very very very very very long comment string. */ -int function2() +void function2() { } @@ -32,7 +33,7 @@ int function2() * A test for overloaded functions * This is function \b one */ -int function3(int a) +void function3(int a) { } @@ -40,7 +41,7 @@ int function3(int a) * A test for overloaded functions * This is function \b two */ -int function3(int a, int b) +void function3(int a, int b) { } @@ -59,12 +60,12 @@ int function3(int a, int b) * \endcode * \endif */ -int function4() +void function4() { } -int function5(int a) +void function5(int a) { } /**< This is a post comment. */ @@ -73,7 +74,7 @@ int function5(int a) * Test for default args * @param a Some parameter, default is 42 */ -int function6(int a=42) +void function6(int a=42) { } diff --git a/Examples/test-suite/doxygen_translate.i b/Examples/test-suite/doxygen_translate.i index 3c2930ff1..348b2e9a8 100644 --- a/Examples/test-suite/doxygen_translate.i +++ b/Examples/test-suite/doxygen_translate.i @@ -123,6 +123,7 @@ */ int function(int a, float b) { + return 0; } /** @@ -205,7 +206,7 @@ int function(int a, float b) * underlined \b bold text - doxy commands are ignored inside 'htmlonly' section * \endhtmlonly */ -int htmlFunction(int a, float b) +void htmlFunction(int a, float b) { } @@ -222,7 +223,7 @@ int htmlFunction(int a, float b) * Almost all combinations of above flags are supported by * \c htmlTable... functions. */ -int htmlTableFunction(int byFlags) +void htmlTableFunction(int byFlags) { } @@ -252,7 +253,7 @@ int htmlTableFunction(int byFlags) * Not an &text; html entity - ignored by Doxygen. * Not an &text html entity - ampersand is replaced with entity. */ -int htmlEntitiesFunction(int a, float b) +void htmlEntitiesFunction(int a, float b) { } diff --git a/Examples/test-suite/doxygen_translate_all_tags.i b/Examples/test-suite/doxygen_translate_all_tags.i index 84b0531d5..ba348fd50 100644 --- a/Examples/test-suite/doxygen_translate_all_tags.i +++ b/Examples/test-suite/doxygen_translate_all_tags.i @@ -35,7 +35,7 @@ * \class someClass headerFile.h headerName * \code some test code \endcode */ -int func01(int a) +void func01(int a) { } @@ -64,7 +64,7 @@ int func01(int a) * \details This is very large * and detailed description of some thing */ -int func02(int a) +void func02(int a) { } @@ -96,7 +96,7 @@ int func02(int a) * \example someFile.txt * Some details on using the example */ -int func03(int a) +void func03(int a) { } @@ -131,7 +131,7 @@ int func03(int a) * This will only appear in hmtl * \endhtmlonly */ -int func04(int a) +void func04(int a) { } @@ -172,7 +172,7 @@ int func04(int a) * \invariant Some text * describing invariant. */ -int func05(int a) +void func05(int a) { } @@ -216,7 +216,7 @@ int func05(int a) * * \n \n \n */ -int func06(int a) +void func06(int a) { } @@ -259,7 +259,7 @@ int func06(int a) * * \property someVar */ -int func07(int a) +void func07(int a) { } @@ -303,7 +303,7 @@ int func07(int a) * * \retval someValue Some description */ -int func08(int a) +void func08(int a) { } @@ -350,7 +350,7 @@ int func08(int a) * * \throws RuntimeError */ -int func09(int a) +void func09(int a) { } @@ -392,7 +392,7 @@ int func09(int a) * * And here goes simple text */ -int func10(int a, float b) +void func10(int a, float b) { } diff --git a/Examples/test-suite/doxygen_translate_links.i b/Examples/test-suite/doxygen_translate_links.i index 5eee1d67f..769a4f4e7 100644 --- a/Examples/test-suite/doxygen_translate_links.i +++ b/Examples/test-suite/doxygen_translate_links.i @@ -44,7 +44,7 @@ public: * \sa superFunc() * */ -int function() +void function() { } diff --git a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py index 838ea3210..c9620040f 100644 --- a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py +++ b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py @@ -262,13 +262,13 @@ Remarks: Some remark text Another remarks section -:rtype: int +:rtype: void :return: Whatever -:rtype: int +:rtype: void :return: it -:rtype: int +:rtype: void :return: may return """)