[GIT] ppl/ppl(master): Avoid implicit conversions changing type signedness.

Module: ppl/ppl Branch: master Commit: 05f9cc35b6a68f506206d89fa4fe2103349c5650 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=05f9cc35b6a68...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Fri Feb 24 09:33:43 2012 +0100
Avoid implicit conversions changing type signedness. Detected by ECLAIR service utypflag.
---
src/Row_Flags.cc | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Row_Flags.cc b/src/Row_Flags.cc index 62e1f29..39a3c8c 100644 --- a/src/Row_Flags.cc +++ b/src/Row_Flags.cc @@ -32,11 +32,13 @@ void PPL::Row_Flags::ascii_dump(std::ostream& s) const { s << "0x"; std::istream::fmtflags f = s.setf(std::istream::hex); - std::streamsize sz = s.width(2*sizeof(Row_Flags::base_type)); + const std::streamsize new_sz + = static_caststd::streamsize(2 * sizeof(Row_Flags::base_type)); + const std::streamsize old_sz = s.width(new_sz); std::ostream::char_type ch = s.fill('0'); s << bits; s.fill(ch); - s.width(sz); + s.width(old_sz); s.flags(f); }
participants (1)
-
Enea Zaffanella