summaryrefslogtreecommitdiffstats
path: root/src/tokenizers/osb.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-02 17:09:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-02 17:09:38 +0400
commitf3ad9c6f1e91c9912dbe730fdec350b5fc908672 (patch)
tree005e5568431db09becaa9b67a33dfc11f80bba7f /src/tokenizers/osb.c
parente6a1d22de250c10992b484635fd95a03f197f779 (diff)
downloadrspamd-f3ad9c6f1e91c9912dbe730fdec350b5fc908672.tar.gz
rspamd-f3ad9c6f1e91c9912dbe730fdec350b5fc908672.zip
* Retab, no functional changes
Diffstat (limited to 'src/tokenizers/osb.c')
-rw-r--r--src/tokenizers/osb.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tokenizers/osb.c b/src/tokenizers/osb.c
index d2a1fe22f..8bbf30d7f 100644
--- a/src/tokenizers/osb.c
+++ b/src/tokenizers/osb.c
@@ -32,24 +32,24 @@
/* Minimum length of token */
#define MIN_LEN 4
-extern const int primes[];
+extern const int primes[];
int
-osb_tokenize_text (struct tokenizer *tokenizer, memory_pool_t *pool, f_str_t *input, GTree **tree)
+osb_tokenize_text (struct tokenizer *tokenizer, memory_pool_t * pool, f_str_t * input, GTree ** tree)
{
- token_node_t *new = NULL;
- f_str_t token = { NULL, 0, 0 }, *res;
- uint32_t hashpipe[FEATURE_WINDOW_SIZE], h1, h2;
- int i;
+ token_node_t *new = NULL;
+ f_str_t token = { NULL, 0, 0 }, *res;
+ uint32_t hashpipe[FEATURE_WINDOW_SIZE], h1, h2;
+ int i;
/* First set all bytes of hashpipe to some common value */
- for (i = 0; i < FEATURE_WINDOW_SIZE; i ++) {
+ for (i = 0; i < FEATURE_WINDOW_SIZE; i++) {
hashpipe[i] = 0xABCDEF;
}
-
+
if (*tree == NULL) {
*tree = g_tree_new (token_node_compare_func);
- memory_pool_add_destructor (pool, (pool_destruct_func)g_tree_destroy, *tree);
+ memory_pool_add_destructor (pool, (pool_destruct_func) g_tree_destroy, *tree);
}
msg_debug ("osb_tokenize_text: got input length: %zd", input->len);
@@ -60,14 +60,14 @@ osb_tokenize_text (struct tokenizer *tokenizer, memory_pool_t *pool, f_str_t *in
continue;
}
/* Shift hashpipe */
- for (i = FEATURE_WINDOW_SIZE - 1; i > 0; i --) {
+ for (i = FEATURE_WINDOW_SIZE - 1; i > 0; i--) {
hashpipe[i] = hashpipe[i - 1];
}
hashpipe[0] = fstrhash (&token);
-
- for (i = 1; i < FEATURE_WINDOW_SIZE; i ++) {
- h1 = hashpipe[0]* primes[0] + hashpipe[i] * primes[i<<1];
- h2 = hashpipe[0] * primes[1] + hashpipe[i] * primes[(i<<1)-1];
+
+ for (i = 1; i < FEATURE_WINDOW_SIZE; i++) {
+ h1 = hashpipe[0] * primes[0] + hashpipe[i] * primes[i << 1];
+ h2 = hashpipe[0] * primes[1] + hashpipe[i] * primes[(i << 1) - 1];
new = memory_pool_alloc (pool, sizeof (token_node_t));
new->h1 = h1;
new->h2 = h2;