summaryrefslogtreecommitdiff
path: root/klm/lm/state.hh
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-08-16 17:02:56 -0400
committerKenneth Heafield <github@kheafield.com>2012-08-16 17:07:51 -0400
commitdc078281c2fd83db9fc4860e8b24979ab2a1e407 (patch)
treec78afb93ccfac30614f7fa44374a44aa49288b0f /klm/lm/state.hh
parent9c9213239263e8e8de2f154068cc3ad44e0c2100 (diff)
KenLM update. Remove a couple of segfaults for weird input. Other oddball stuff.
Diffstat (limited to 'klm/lm/state.hh')
-rw-r--r--klm/lm/state.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/klm/lm/state.hh b/klm/lm/state.hh
index c7438414..830e40aa 100644
--- a/klm/lm/state.hh
+++ b/klm/lm/state.hh
@@ -32,7 +32,7 @@ class State {
// Call this before using raw memcmp.
void ZeroRemaining() {
- for (unsigned char i = length; i < kMaxOrder - 1; ++i) {
+ for (unsigned char i = length; i < KENLM_MAX_ORDER - 1; ++i) {
words[i] = 0;
backoff[i] = 0.0;
}
@@ -42,8 +42,8 @@ class State {
// You shouldn't need to touch anything below this line, but the members are public so FullState will qualify as a POD.
// This order minimizes total size of the struct if WordIndex is 64 bit, float is 32 bit, and alignment of 64 bit integers is 64 bit.
- WordIndex words[kMaxOrder - 1];
- float backoff[kMaxOrder - 1];
+ WordIndex words[KENLM_MAX_ORDER - 1];
+ float backoff[KENLM_MAX_ORDER - 1];
unsigned char length;
};
@@ -72,11 +72,11 @@ struct Left {
}
void ZeroRemaining() {
- for (uint64_t * i = pointers + length; i < pointers + kMaxOrder - 1; ++i)
+ for (uint64_t * i = pointers + length; i < pointers + KENLM_MAX_ORDER - 1; ++i)
*i = 0;
}
- uint64_t pointers[kMaxOrder - 1];
+ uint64_t pointers[KENLM_MAX_ORDER - 1];
unsigned char length;
bool full;
};