/*
******************************************************************************
*
-* Copyright (C) 2001-2010, International Business Machines
+* Copyright (C) 2001-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#endif
#include "unicode/utypes.h"
+#include "unicode/utf.h"
+#include "unicode/utf8.h"
+#include "unicode/utf16.h"
#include "cmemory.h"
#include "utrie2.h"
#include "utrie2_impl.h"
+#include "uassert.h"
/* Public UTrie2 API implementation ----------------------------------------- */
}
}
-static U_INLINE int32_t
+static inline int32_t
u8Index(const UTrie2 *trie, UChar32 c, int32_t i) {
int32_t idx=
_UTRIE2_INDEX_FROM_CP(
if(trie->newTrie==NULL) {
/* frozen trie */
idx=trie->index;
+ U_ASSERT(idx!=NULL); /* the following code assumes trie->newTrie is not NULL when idx is NULL */
data32=trie->data32;
index2NullOffset=trie->index2NullOffset;
/* unfrozen, mutable trie */
idx=NULL;
data32=trie->newTrie->data;
+ U_ASSERT(data32!=NULL); /* the following code assumes idx is not NULL when data32 is NULL */
index2NullOffset=trie->newTrie->index2NullOffset;
nullBlock=trie->newTrie->dataNullOffset;
return result;
}
-UTrie2 *UTrie2Singleton::getInstance(InstantiatorFn *instantiator, const void *context,
- UErrorCode &errorCode) {
- void *duplicate;
- UTrie2 *instance=(UTrie2 *)singleton.getInstance(instantiator, context, duplicate, errorCode);
- utrie2_close((UTrie2 *)duplicate);
- return instance;
-}
-
U_NAMESPACE_END