stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r513502 - /incubator/stdcxx/trunk/include/rw/_traits.h
Date Thu, 01 Mar 2007 23:25:42 GMT
Author: sebor
Date: Thu Mar  1 13:16:06 2007
New Revision: 513502

URL: http://svn.apache.org/viewvc?view=rev&rev=513502
Log:
2007-03-01  Martin Sebor  <sebor@roguewave.com>

	STDCXX-214
	* _traits.h (lt): Cast char arguments to unsigned char to
	yield results consistent with compare (and with memcmp).

Modified:
    incubator/stdcxx/trunk/include/rw/_traits.h

Modified: incubator/stdcxx/trunk/include/rw/_traits.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_traits.h?view=diff&rev=513502&r1=513501&r2=513502
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_traits.h (original)
+++ incubator/stdcxx/trunk/include/rw/_traits.h Thu Mar  1 13:16:06 2007
@@ -9,22 +9,23 @@
  *
  ***************************************************************************
  *
- * Copyright 2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you 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
  *
- * Copyright 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
+ * 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.
+ * 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 1994-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -389,7 +390,10 @@
     }
 
     static bool lt (const char_type& __c1, const char_type& __c2) {
-        return __c1 < __c2;
+        // lwg issue 467: cast arguments to unsigned char
+        // to get the same result as memcmp(&c1, &c2) < 0
+        return   _RWSTD_STATIC_CAST (unsigned char, __c1)
+               < _RWSTD_STATIC_CAST (unsigned char, __c2);
     }
 
     static int



Mime
View raw message