From 9c2ce95063997677fbf4978c99dfa98d2691139d Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 23 Apr 2013 14:09:35 +0000 Subject: [PATCH] Zero-initialize all mbstate_t in the codecvt tests. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180108 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../locale.codecvt.members/char16_t_in.pass.cpp | 2 +- .../locale.codecvt.members/char16_t_length.pass.cpp | 2 +- .../locale.codecvt.members/char16_t_out.pass.cpp | 2 +- .../locale.codecvt.members/char16_t_unshift.pass.cpp | 2 +- .../locale.codecvt.members/char32_t_in.pass.cpp | 2 +- .../locale.codecvt.members/char32_t_length.pass.cpp | 2 +- .../locale.codecvt.members/char32_t_out.pass.cpp | 2 +- .../locale.codecvt.members/char32_t_unshift.pass.cpp | 2 +- .../locale.codecvt/locale.codecvt.members/char_in.pass.cpp | 2 +- .../locale.codecvt.members/char_length.pass.cpp | 2 +- .../locale.codecvt/locale.codecvt.members/char_out.pass.cpp | 2 +- .../locale.codecvt.members/char_unshift.pass.cpp | 2 +- .../locale.codecvt.members/wchar_t_out.pass.cpp | 6 +++--- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp index 88382a1f..331f4ba2 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp @@ -28,7 +28,7 @@ int main() const char from[] = "some text"; F::intern_type to[9]; const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char* from_next = 0; F::intern_type* to_next = 0; assert(f.in(mbs, from, from + 9, from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp index 7cd44180..34ab2178 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp @@ -22,7 +22,7 @@ int main() { std::locale l = std::locale::classic(); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char from[] = "some text"; assert(f.length(mbs, from, from+10, 0) == 0); assert(f.length(mbs, from, from+10, 8) == 8); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp index c06f6d5b..0f65f132 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp @@ -31,7 +31,7 @@ int main() { F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'}; char to[9] = {0}; - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const F::intern_type* from_next = 0; char* to_next = 0; F::result r = f.out(mbs, from, from + 9, from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp index 36ad6a46..c2130307 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp @@ -26,7 +26,7 @@ int main() std::locale l = std::locale::classic(); std::vector to(3); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; char* to_next = 0; assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv); assert(to_next == to.data()); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp index 9430a8ad..8fb28f0a 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp @@ -28,7 +28,7 @@ int main() const char from[] = "some text"; F::intern_type to[9]; const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char* from_next = 0; F::intern_type* to_next = 0; assert(f.in(mbs, from, from + 9, from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp index fd3b2bb8..d8555d18 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp @@ -22,7 +22,7 @@ int main() { std::locale l = std::locale::classic(); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char from[] = "some text"; assert(f.length(mbs, from, from+10, 0) == 0); assert(f.length(mbs, from, from+10, 8) == 8); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp index 3f06d80c..a1d11f74 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp @@ -31,7 +31,7 @@ int main() { F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'}; char to[9] = {0}; - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const F::intern_type* from_next = 0; char* to_next = 0; F::result r = f.out(mbs, from, from + 9, from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp index 90266b40..1bd45e03 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp @@ -26,7 +26,7 @@ int main() std::locale l = std::locale::classic(); std::vector to(3); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; char* to_next = 0; assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv); assert(to_next == to.data()); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp index 4fe55c1d..4d2f6f26 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp @@ -28,7 +28,7 @@ int main() const std::basic_string from("some text"); std::vector to(from.size()); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char* from_next = 0; char* to_next = 0; assert(f.in(mbs, from.data(), from.data() + from.size(), from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp index 77ce3b7b..df33b182 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp @@ -22,7 +22,7 @@ int main() { std::locale l = std::locale::classic(); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char from[10]= {0}; assert(f.length(mbs, from, from+10, 0) == 0); assert(f.length(mbs, from, from+10, 9) == 9); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp index 2ab3642d..de7f024f 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp @@ -28,7 +28,7 @@ int main() const std::basic_string from("some text"); std::vector to(from.size()); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const char* from_next = 0; char* to_next = 0; assert(f.out(mbs, from.data(), from.data() + from.size(), from_next, diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp index 6a95c227..830bc43e 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp @@ -26,7 +26,7 @@ int main() std::locale l = std::locale::classic(); std::vector to(3); const F& f = std::use_facet(l); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; char* to_next = 0; assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv); assert(to_next == to.data()); diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp index 5d0997ca..dce2d38c 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp @@ -29,7 +29,7 @@ int main() { const std::basic_string from(L"some text"); std::vector to(from.size()+1); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const F::intern_type* from_next = 0; char* to_next = 0; F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next, @@ -43,7 +43,7 @@ int main() std::basic_string from(L"some text"); from[4] = '\0'; std::vector to(from.size()+1); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const F::intern_type* from_next = 0; char* to_next = 0; F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next, @@ -56,7 +56,7 @@ int main() { std::basic_string from(L"some text"); std::vector to(from.size()-1); - std::mbstate_t mbs; + std::mbstate_t mbs = {0}; const F::intern_type* from_next = 0; char* to_next = 0; F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,