You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/04/21 00:57:24 UTC
svn commit: r395721 - /incubator/stdcxx/trunk/include/bitset
Author: sebor
Date: Thu Apr 20 15:57:23 2006
New Revision: 395721
URL: http://svn.apache.org/viewcvs?rev=395721&view=rev
Log:
2006-04-20 Martin Sebor <se...@roguewave.com>
STDCXX-174
* bitset (_C_from_ulong, flip, set, operator<<=): Used ULONG_MAX
instead of SIZE_MAX in bitwise operations involving unsigned long.
Modified:
incubator/stdcxx/trunk/include/bitset
Modified: incubator/stdcxx/trunk/include/bitset
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/bitset?rev=395721&r1=395720&r2=395721&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/bitset (original)
+++ incubator/stdcxx/trunk/include/bitset Thu Apr 20 15:57:23 2006
@@ -7,16 +7,22 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
**************************************************************************/
@@ -98,7 +104,7 @@
void _C_from_ulong (unsigned long __n) _THROWS (()) {
reset ();
_C_bits [0] =
- __n & (_RWSTD_SIZE_MAX >> ((_Size > _C_elembits ? 0 :
+ __n & (_RWSTD_ULONG_MAX >> ((_Size > _C_elembits ? 0 :
_C_elembits - _Size % _C_elembits) % _C_elembits));
}
@@ -372,7 +378,7 @@
for (_RWSTD_SIZE_T __i = 0; __i != _C_nelems; __i++)
_C_bits [__i] = ~_C_bits [__i];
_C_bits [_C_nelems - !!_C_nelems] &=
- _RWSTD_SIZE_MAX >> (_C_elembits - _Size % _C_elembits) % _C_elembits;
+ _RWSTD_ULONG_MAX >> (_C_elembits - _Size % _C_elembits) % _C_elembits;
return *this;
}
@@ -512,7 +518,7 @@
bitset<_Size>::set () _THROWS (())
{
if (_C_nelems == 1)
- _C_bits [0] = _RWSTD_SIZE_MAX;
+ _C_bits [0] = _RWSTD_ULONG_MAX;
else
_RWSTD_MEMSET (_C_bits, -1, sizeof _C_bits);
@@ -556,7 +562,7 @@
if (_Size % _C_elembits) {
// prevent warnings about shifting too far
_C_bits [_C_nelems - !!_C_nelems] &=
- _RWSTD_SIZE_MAX >> (_C_elembits - _Size % _C_elembits) % _C_elembits;
+ _RWSTD_ULONG_MAX >> (_C_elembits - _Size % _C_elembits) % _C_elembits;
}
return *this;