summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/StreamHelpers.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-10-17 12:38:03 -0700
committerMark Spruiell <mes@zeroc.com>2012-10-17 12:38:03 -0700
commitf087326373250c76fa3b7b8e68cede0cb9af01ff (patch)
treee801ec18aba93a74b373388fc947617643da0008 /cpp/include/Ice/StreamHelpers.h
parentFix related to ICE-4847 (diff)
downloadice-f087326373250c76fa3b7b8e68cede0cb9af01ff.tar.bz2
ice-f087326373250c76fa3b7b8e68cede0cb9af01ff.tar.xz
ice-f087326373250c76fa3b7b8e68cede0cb9af01ff.zip
ICE-4619 - custom enumerator values
Diffstat (limited to 'cpp/include/Ice/StreamHelpers.h')
-rw-r--r--cpp/include/Ice/StreamHelpers.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h
index 9e69a02964e..81d30f4d543 100644
--- a/cpp/include/Ice/StreamHelpers.h
+++ b/cpp/include/Ice/StreamHelpers.h
@@ -328,18 +328,18 @@ struct StreamHelper<T, StreamHelperCategoryEnum>
template<class S> static inline void
write(S* stream, const T& v)
{
- if(static_cast<Int>(v) < 0 || static_cast<Int>(v) >= StreamableTraits<T>::enumLimit)
+ if(static_cast<Int>(v) < StreamableTraits<T>::minValue || static_cast<Int>(v) > StreamableTraits<T>::maxValue)
{
IceInternal::Ex::throwMarshalException(__FILE__, __LINE__, "enumerator out of range");
}
- stream->writeEnum(static_cast<Int>(v), StreamableTraits<T>::enumLimit);
+ stream->writeEnum(static_cast<Int>(v), StreamableTraits<T>::maxValue);
}
template<class S> static inline void
read(S* stream, T& v)
{
- Int value = stream->readEnum(StreamableTraits<T>::enumLimit);
- if(value < 0 || value >= StreamableTraits<T>::enumLimit)
+ Int value = stream->readEnum(StreamableTraits<T>::maxValue);
+ if(value < StreamableTraits<T>::minValue || value > StreamableTraits<T>::maxValue)
{
IceInternal::Ex::throwMarshalException(__FILE__, __LINE__, "enumerator out of range");
}