
Module: ppl/ppl Branch: master Commit: aacd89e5ee21cb50aeb5311b017f9f1d66cc952c URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=aacd89e5ee21c...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Wed Nov 2 14:00:48 2011 +0100
Do not mix plain char and numeric values. Detected by ECLAIR service utypflag.
---
src/Variable.cc | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Variable.cc b/src/Variable.cc index 19d907b..d8aec32 100644 --- a/src/Variable.cc +++ b/src/Variable.cc @@ -38,8 +38,10 @@ PPL::Variable::OK() const { void PPL::Variable::default_output_function(std::ostream& s, const Variable& v) { dimension_type varid = v.id(); - s << static_cast<char>('A' + varid % 26); - if (dimension_type i = varid / 26) + static const char var_name_letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const dimension_type num_letters = sizeof(var_name_letters) - 1; + s << var_name_letters[varid % num_letters]; + if (dimension_type i = varid / num_letters) s << i; }