diff --git a/src/cstdio.cpp b/src/cstdio.cpp index 44f9aa0..1e1672c 100644 --- a/src/cstdio.cpp +++ b/src/cstdio.cpp @@ -43,7 +43,8 @@ namespace nowide { { const wstackstring wname(file_name); const wshort_stackstring wmode(mode); - return _wfreopen(wname.get(), wmode.get(), stream); // coverity[var_deref_model] + // coverity[var_deref_model] + return _wfreopen(wname.get(), wmode.get(), stream); } /// /// \brief Same as fopen but file_name and mode are UTF-8 strings @@ -52,7 +53,8 @@ namespace nowide { { const wstackstring wname(file_name); const wshort_stackstring wmode(mode); - return detail::wfopen(wname.get(), wmode.get()); // coverity[var_deref_model] + // coverity[var_deref_model] + return detail::wfopen(wname.get(), wmode.get()); } /// /// \brief Same as rename but old_name and new_name are UTF-8 strings diff --git a/test/test_codecvt.cpp b/test/test_codecvt.cpp index faccde1..a793299 100644 --- a/test/test_codecvt.cpp +++ b/test/test_codecvt.cpp @@ -411,7 +411,8 @@ void test_codecvt_subst() run_all(codecvt_to_wide, codecvt_to_narrow); } -void test_main(int, char**, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char**, char**) { test_codecvt_basic(); test_codecvt_unshift(); diff --git a/test/test_convert.cpp b/test/test_convert.cpp index 71e4bea..b0fe6c3 100644 --- a/test/test_convert.cpp +++ b/test/test_convert.cpp @@ -127,7 +127,8 @@ std::string narrow_string_view(const std::wstring& s) } #endif -void test_main(int, char**, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char**, char**) { std::string hello = "\xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d"; std::wstring whello = L"\u05e9\u05dc\u05d5\u05dd"; diff --git a/test/test_env.cpp b/test/test_env.cpp index b8db717..f3fdb74 100644 --- a/test/test_env.cpp +++ b/test/test_env.cpp @@ -14,7 +14,8 @@ #include #endif -void test_main(int, char**, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char**, char**) { std::string example = "\xd7\xa9-\xd0\xbc-\xce\xbd"; std::string envVar = "BOOST_TEST2=" + example + "x"; diff --git a/test/test_filebuf.cpp b/test/test_filebuf.cpp index d2284e6..6a47db3 100644 --- a/test/test_filebuf.cpp +++ b/test/test_filebuf.cpp @@ -138,13 +138,12 @@ void test_64_bit_seek(const std::string& filepath) #pragma warning(disable : 4127) #endif // if we can't use 64 bit offsets through the API, don't test anything - // LCOV_EXCL_START // coverity[result_independent_of_operands] if(offset == nw::filebuf::off_type(0)) { - return; // coverity[dead_error_line] + // coverity[dead_error_line] + return; // LCOV_EXCL_LINE } - // LCOV_EXCL_STOP #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -302,7 +301,8 @@ void test_swap(const std::string& filepath) } } -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string exampleFilename = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_fs.cpp b/test/test_fs.cpp index 9456035..e22038c 100644 --- a/test/test_fs.cpp +++ b/test/test_fs.cpp @@ -21,7 +21,8 @@ #endif #include -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { boost::nowide::nowide_filesystem(); const std::string prefix = argv[0]; diff --git a/test/test_fstream.cpp b/test/test_fstream.cpp index 3a0d7f8..292c1de 100644 --- a/test/test_fstream.cpp +++ b/test/test_fstream.cpp @@ -533,7 +533,8 @@ void test_flush(const std::string& filepath) TEST(!fo.seekg(0)); // Does not work on closed stream } -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string exampleFilename = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_fstream_special.cpp b/test/test_fstream_special.cpp index fad9719..03e22db 100644 --- a/test/test_fstream_special.cpp +++ b/test/test_fstream_special.cpp @@ -257,7 +257,8 @@ void testPutback(const char* filename) } } -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string exampleFilename = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; const std::string exampleFilename2 = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd 2.txt"; diff --git a/test/test_ifstream.cpp b/test/test_ifstream.cpp index 1b10929..82cf10a 100644 --- a/test/test_ifstream.cpp +++ b/test/test_ifstream.cpp @@ -199,7 +199,8 @@ void test_move_and_swap(const std::string& filename) } } -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string exampleFilename = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_iostream.cpp b/test/test_iostream.cpp index 64153c8..2b0e823 100644 --- a/test/test_iostream.cpp +++ b/test/test_iostream.cpp @@ -505,7 +505,8 @@ void test_console() #endif #endif -void test_main(int argc, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int argc, char** argv, char**) { // LCOV_EXCL_START if(usesNowideRdBufIn) diff --git a/test/test_ofstream.cpp b/test/test_ofstream.cpp index 2821994..6d9f4c6 100644 --- a/test/test_ofstream.cpp +++ b/test/test_ofstream.cpp @@ -170,7 +170,8 @@ void test_move_and_swap(const std::string& filename) TEST_EQ(read_file(filename2), "Foo Bar"); } -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string exampleFilename = std::string(argv[0]) + "-\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_stackstring.cpp b/test/test_stackstring.cpp index ff2a6cb..c0cd882 100644 --- a/test/test_stackstring.cpp +++ b/test/test_stackstring.cpp @@ -62,7 +62,8 @@ std::string heap_stackstring_to_narrow(const std::wstring& s) return ss.get(); } -void test_main(int, char**, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char**, char**) { std::string hello = "\xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d"; std::wstring whello = boost::nowide::widen(hello); diff --git a/test/test_stat.cpp b/test/test_stat.cpp index 446d837..1843033 100644 --- a/test/test_stat.cpp +++ b/test/test_stat.cpp @@ -13,7 +13,8 @@ #include #endif -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string prefix = argv[0]; const std::string filename = prefix + "\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_stdio.cpp b/test/test_stdio.cpp index 0ea373b..95c35d5 100644 --- a/test/test_stdio.cpp +++ b/test/test_stdio.cpp @@ -49,7 +49,8 @@ void noop_invalid_param_handler(const wchar_t*, const wchar_t*, const wchar_t*, {} // LCOV_EXCL_LINE #endif -void test_main(int, char** argv, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char** argv, char**) { const std::string prefix = argv[0]; const std::string filename = prefix + "\xd7\xa9-\xd0\xbc-\xce\xbd.txt"; diff --git a/test/test_system.cpp b/test/test_system.cpp index 9f168a9..e003f0b 100644 --- a/test/test_system.cpp +++ b/test/test_system.cpp @@ -142,7 +142,8 @@ void run_parent(const char* exe_path) #endif } -void test_main(int argc, char** argv, char** env) // coverity [root_function] +// coverity [root_function] +void test_main(int argc, char** argv, char** env) { const int old_argc = argc; char** old_argv = argv; diff --git a/test/test_traits.cpp b/test/test_traits.cpp index 8a7fcb9..b2e0a2e 100644 --- a/test/test_traits.cpp +++ b/test/test_traits.cpp @@ -53,7 +53,8 @@ static_assert(get_data_width::value == sizeof(wchar_t), "!"); static_assert(get_data_width::value == sizeof(char16_t), "!"); static_assert(get_data_width::value == sizeof(char32_t), "!"); -void test_main(int, char**, char**) // coverity [root_function] +// coverity [root_function] +void test_main(int, char**, char**) { #ifdef BOOST_NOWIDE_TEST_STD_STRINGVIEW std::cout << "Testing string_view" << std::endl;