commit e7c493bdd3ca642d849a194bf46d00c07cfe8180 Author: Douglas Mencken Date: Wed Dec 11 07:35:06 2013 -0500 Fix a lot of warnings like "warning: this decimal constant is unsigned only in ISO C90". In C89/90 an unsuffixed decimal constant must be interpreted as int, long or unsigned long (whichever fits first). In C99 it must be interpreted as int, long or long long (whichever fits first). Change-Id: I863a601f7fb260cab15540d53485d2dc263fef99 diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 0a710a8..f470e87 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -3099,8 +3099,16 @@ void EnumType::dumpDeclaration(FileStream& o) entity_->getMembers().begin()); i != entity_->getMembers().end(); ++i) { - o << indent() << id_ << "_" << u2b(i->name) << " = " << i->value - << ",\n"; + // FileStream has an operator<< for sal_uInt32 (but not for sal_Int32), + // so the i->value is promoted to sal_uInt32 and always output as unsigned. + sal_uInt32 val = (sal_uInt32)(i->value); + if (val <= SAL_MAX_INT32) { + o << indent() << id_ << "_" << u2b(i->name) << " = " << val + << ",\n"; + } else { + o << indent() << id_ << "_" << u2b(i->name) << " = " << val << "u" + << ",\n"; + } } o << indent() << id_ << "_MAKE_FIXED_SIZE = SAL_MAX_ENUM\n";