[ion/unicode] Clean special code points

This commit is contained in:
Léa Saviot
2019-03-26 14:49:11 +01:00
committed by Émilie Feral
parent 379f098858
commit 1d26e6da73
24 changed files with 108 additions and 86 deletions

View File

@@ -122,7 +122,11 @@ T Sequence::approximateToNextRank(int n, SequenceContext * sqctx) const {
if (n < initialRank() || n < 0) {
return NAN;
}
const char unknownN[2] = {Poincare::Symbol::SpecialSymbols::UnknownN, 0};
constexpr int bufferSize = 5;
char unknownN[bufferSize];
int codePointSize = UTF8Decoder::CodePointToChars(UCodePointUnknownN, unknownN, bufferSize);
assert(codePointSize <= bufferSize - 1);
unknownN[codePointSize] = 0;
CacheContext<T> ctx = CacheContext<T>(sqctx);
T un = sqctx->valueOfSequenceAtPreviousRank<T>(0, 0);
T unm1 = sqctx->valueOfSequenceAtPreviousRank<T>(0, 1);