From 53860dd80fd6e91ce04756032a969d4b37e00a61 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Mon, 1 Jul 2019 14:20:56 +0100 Subject: COMPMID-2432 Fix defects reported by Coverity Change-Id: I887eea57cc0202ad42b76b0ea093724943116a7e Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1446 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- arm_compute/core/Utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arm_compute/core/Utils.h') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index a37559d269..b0e26328ed 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1150,6 +1151,8 @@ template void print_consecutive_elements_impl(std::ostream &s, const T *ptr, unsigned int n, int stream_width = 0, const std::string &element_delim = " ") { using print_type = typename std::conditional::value, T, int>::type; + std::ios stream_status(nullptr); + stream_status.copyfmt(s); for(unsigned int i = 0; i < n; ++i) { @@ -1169,6 +1172,9 @@ void print_consecutive_elements_impl(std::ostream &s, const T *ptr, unsigned int s << std::right << static_cast(ptr[i]) << element_delim; } } + + // Restore output stream flags + s.copyfmt(stream_status); } /** Identify the maximum width of n consecutive elements. -- cgit v1.2.1