summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-28 19:59:40 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-28 19:59:40 +0000
commita46dbf9951edb25908ee2342d96c8948080f3b2d (patch)
tree69edeff1a51dc4350a12e8f26c81025b4f74167c /cpp/src/Slice/Parser.cpp
parentRemoved slice task tagdir attribute from build.xml (diff)
downloadice-a46dbf9951edb25908ee2342d96c8948080f3b2d.tar.bz2
ice-a46dbf9951edb25908ee2342d96c8948080f3b2d.tar.xz
ice-a46dbf9951edb25908ee2342d96c8948080f3b2d.zip
minor changes for gcc 3.2
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp44
1 files changed, 34 insertions, 10 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index fc0f1218235..9dddfa9571b 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -31,7 +31,7 @@ Unit* unit;
static void
toLower(string& s)
{
- transform(s.begin(), s.end(), s.begin(), tolower);
+ transform(s.begin(), s.end(), s.begin(), ::tolower);
}
// ----------------------------------------------------------------------
@@ -1442,9 +1442,9 @@ Slice::Container::checkPrefix(const string& name) const
if(name.size() >= 3)
{
string prefix3;
- prefix3 += tolower(name[0]);
- prefix3 += tolower(name[1]);
- prefix3 += tolower(name[2]);
+ prefix3 += ::tolower(name[0]);
+ prefix3 += ::tolower(name[1]);
+ prefix3 += ::tolower(name[2]);
if(prefix3 == "ice")
{
_unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved");
@@ -2765,6 +2765,16 @@ Slice::Dictionary::legalSimpleKeyType(const TypePtr& type)
return true;
break;
}
+
+ case Builtin::KindFloat:
+ case Builtin::KindDouble:
+ case Builtin::KindObject:
+ case Builtin::KindObjectProxy:
+ case Builtin::KindLocalObject:
+ {
+ return false;
+ break;
+ }
}
}
@@ -2992,7 +3002,16 @@ Slice::ConstDef::typesAreCompatible(const string& name, const TypePtr& constType
}
break;
}
+
+ case Builtin::KindObject:
+ case Builtin::KindObjectProxy:
+ case Builtin::KindLocalObject:
+ {
+ assert(false);
+ break;
+ }
}
+
string msg = "initializer of type `" + lt->kindAsString();
msg += "' is incompatible with the type `" + ct->kindAsString() + "' of constant `" + name + "'";
unit->error(msg);
@@ -3032,7 +3051,9 @@ Slice::ConstDef::isInRange(const string& name, const TypePtr& constType, const s
{
BuiltinPtr ct = BuiltinPtr::dynamicCast(constType);
if (!ct)
- return true; // Enums are checked elsewhere
+ {
+ return true; // Enums are checked elsewhere
+ }
switch(ct->kind())
{
@@ -3069,8 +3090,13 @@ Slice::ConstDef::isInRange(const string& name, const TypePtr& constType, const s
}
break;
}
+
+ default:
+ {
+ break;
+ }
}
- return true; // Everything else is either in range or doesn't need checking
+ return true; // Everything else is either in range or doesn't need checking
}
Slice::ConstDef::ConstDef(const ContainerPtr& container, const string& name,
@@ -3280,8 +3306,6 @@ Slice::Operation::uses(const ContainedPtr& contained) const
}
}
- TypeStringList::const_iterator p;
-
ExceptionList::const_iterator q;
for(q = _throws.begin(); q != _throws.end(); ++q)
@@ -3937,7 +3961,7 @@ Slice::CICompare::operator()(const string& s1, const string& s2) const
{
string::const_iterator p1 = s1.begin();
string::const_iterator p2 = s2.begin();
- while(p1 != s1.end() && p2 != s2.end() && tolower(*p1) == tolower(*p2))
+ while(p1 != s1.end() && p2 != s2.end() && ::tolower(*p1) == ::tolower(*p2))
{
++p1;
++p2;
@@ -3956,6 +3980,6 @@ Slice::CICompare::operator()(const string& s1, const string& s2) const
}
else
{
- return tolower(*p1) < tolower(*p2);
+ return ::tolower(*p1) < ::tolower(*p2);
}
};