Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/char_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CharProperty {
inline const char *seekToOtherType(const char *begin, const char *end,
CharInfo c, CharInfo *fail,
size_t *mblen, size_t *clen) const {
register const char *p = begin;
const char *p = begin;
*clen = 0;
while (p != end && c.isKindOf(*fail = getCharInfo(p, end, mblen))) {
p += *mblen;
Expand Down Expand Up @@ -89,4 +89,4 @@ class CharProperty {
whatlog what_;
};
}
#endif // MECAB_CHARACTER_CATEGORY_H_
#endif // MECAB_CHARACTER_CATEGORY_H_
22 changes: 11 additions & 11 deletions src/darts.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ class DoubleArrayImpl {
T result;
set_result(result, -1, 0);

register array_type_ b = array_[node_pos].base;
register array_u_type_ p;
array_type_ b = array_[node_pos].base;
array_u_type_ p;

for (register size_t i = 0; i < len; ++i) {
for (size_t i = 0; i < len; ++i) {
p = b +(node_u_type_)(key[i]) + 1;
if (static_cast<array_u_type_>(b) == array_[p].check)
b = array_[p].base;
Expand All @@ -431,12 +431,12 @@ class DoubleArrayImpl {
size_t node_pos = 0) const {
if (!len) len = length_func_()(key);

register array_type_ b = array_[node_pos].base;
register size_t num = 0;
register array_type_ n;
register array_u_type_ p;
array_type_ b = array_[node_pos].base;
size_t num = 0;
array_type_ n;
array_u_type_ p;

for (register size_t i = 0; i < len; ++i) {
for ( size_t i = 0; i < len; ++i) {
p = b; // + 0;
n = array_[p].base;
if ((array_u_type_) b == array_[p].check && n < 0) {
Expand Down Expand Up @@ -469,8 +469,8 @@ class DoubleArrayImpl {
size_t len = 0) const {
if (!len) len = length_func_()(key);

register array_type_ b = array_[node_pos].base;
register array_u_type_ p;
array_type_ b = array_[node_pos].base;
array_u_type_ p;

for (; key_pos < len; ++key_pos) {
p = b +(node_u_type_)(key[key_pos]) + 1;
Expand Down Expand Up @@ -515,4 +515,4 @@ typedef Darts::DoubleArrayImpl<char, unsigned char, long long,
#endif
}
}
#endif
#endif
8 changes: 4 additions & 4 deletions src/viterbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ template <bool IsAllPath> bool connect(size_t pos, Node *rnode,
const Connector *connector,
Allocator<Node, Path> *allocator) {
for (;rnode; rnode = rnode->bnext) {
register long best_cost = 2147483647;
long best_cost = 2147483647;
Node* best_node = 0;
for (Node *lnode = end_node_list[pos]; lnode; lnode = lnode->enext) {
register int lcost = connector->cost(lnode, rnode); // local cost
register long cost = lnode->cost + lcost;
int lcost = connector->cost(lnode, rnode); // local cost
long cost = lnode->cost + lcost;

if (cost < best_cost) {
best_node = lnode;
Expand Down Expand Up @@ -410,4 +410,4 @@ bool Viterbi::viterbi(Lattice *lattice) const {

return true;
}
} // Mecab
} // Mecab
4 changes: 3 additions & 1 deletion src/viterbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <vector>
#include "mecab.h"
#include "thread.h"
#include "scoped_ptr.h"
#include "common.h"

namespace MeCab {

Expand Down Expand Up @@ -50,4 +52,4 @@ class Viterbi {
whatlog what_;
};
}
#endif // MECAB_VITERBI_H_
#endif // MECAB_VITERBI_H_