]> granicus.if.org Git - icu/commitdiff
ICU-9008 some more U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC fixes; include putilimp.h where...
authorMarkus Scherer <markus.icu@gmail.com>
Tue, 10 Jan 2012 07:15:25 +0000 (07:15 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Tue, 10 Jan 2012 07:15:25 +0000 (07:15 +0000)
X-SVN-Rev: 31188

icu4c/source/common/normalizer2impl.cpp
icu4c/source/common/ucase.h
icu4c/source/common/uresdata.h

index ecbefdc6fcd5878e86c9b59dae6a879065bc21b0..a6ef0c1b2895041cd977db63e007443f9be1458f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2009-2011, International Business Machines
+*   Copyright (C) 2009-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -25,6 +25,7 @@
 #include "cmemory.h"
 #include "mutex.h"
 #include "normalizer2impl.h"
+#include "putilimp.h"
 #include "uassert.h"
 #include "uset_imp.h"
 #include "utrie2.h"
index 4c1ce84f7a1653d731db2d76737df69265bf1953..a80ed1a3b83bf676a330df9191ea1dcb0f8e398b 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2004-2011, International Business Machines
+*   Copyright (C) 2004-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -21,6 +21,7 @@
 
 #include "unicode/utypes.h"
 #include "unicode/uset.h"
+#include "putilimp.h"
 #include "uset_imp.h"
 #include "udataswp.h"
 
@@ -295,7 +296,11 @@ enum {
 #define UCASE_MAX_DELTA     0x1ff
 #define UCASE_MIN_DELTA     (-UCASE_MAX_DELTA-1)
 
-#define UCASE_GET_DELTA(props) ((int16_t)(props)>>UCASE_DELTA_SHIFT)
+#if U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC
+#   define UCASE_GET_DELTA(props) ((int16_t)(props)>>UCASE_DELTA_SHIFT)
+#else
+#   define UCASE_GET_DELTA(props) (int16_t)(((props)&0x8000) ? (((props)>>UCASE_DELTA_SHIFT)|0xfc00) : ((uint16_t)(props)>>UCASE_DELTA_SHIFT))
+#endif
 
 /* case-ignorable uses one of the delta bits, see gencase/store.c */
 #define UCASE_CASE_IGNORABLE 0x40
index 3e63db917d9730f68be2b694b6c2d25b71bce449..55d04e665f93b4b7d03ce65eabf79b1a696fe403 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *                                                                            *
-* Copyright (C) 1999-2011, International Business Machines                   *
+* Copyright (C) 1999-2012, International Business Machines                   *
 *                Corporation and others. All Rights Reserved.                *
 *                                                                            *
 ******************************************************************************
@@ -21,6 +21,7 @@
 #include "unicode/utypes.h"
 #include "unicode/udata.h"
 #include "unicode/ures.h"
+#include "putilimp.h"
 #include "udataswp.h"
 
 /**