summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 16:45:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 16:45:38 +0400
commit7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00 (patch)
treef69121ee5c1a0e43fe987db8ed2c9e5cc66c79f0 /lib
parentc93cca709b13da41b8d5bcd08874d75669e125f0 (diff)
downloadrspamd-7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00.tar.gz
rspamd-7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00.zip
Use DB_HASH access method for bdb backend.
Fix signed and unsigned comparasion while I'm here.
Diffstat (limited to 'lib')
-rw-r--r--lib/client/librspamdclient.c30
-rw-r--r--lib/kvstorage/libkvstorageclient.c12
2 files changed, 21 insertions, 21 deletions
diff --git a/lib/client/librspamdclient.c b/lib/client/librspamdclient.c
index dad2a3388..2488abd37 100644
--- a/lib/client/librspamdclient.c
+++ b/lib/client/librspamdclient.c
@@ -328,7 +328,7 @@ parse_rspamd_first_line (struct rspamd_connection *conn, guint len, GError **err
p = b;
c = p;
- while (p - b < remain) {
+ while (p - b < (gint)remain) {
switch (state) {
case 0:
/* Read version */
@@ -359,7 +359,7 @@ parse_rspamd_first_line (struct rspamd_connection *conn, guint len, GError **err
break;
case 2:
/* Read message */
- if (g_ascii_isspace (*p) || p - b == remain - 1) {
+ if (g_ascii_isspace (*p) || p - b == (gint)remain - 1) {
state = 99;
next_state = 3;
}
@@ -411,7 +411,7 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er
}
c = p;
- while (p - b < remain) {
+ while (p - b < (gint)remain) {
switch (state) {
case 0:
/* Read metric's name */
@@ -475,7 +475,7 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er
break;
case 4:
/* Read required score */
- if (g_ascii_isspace (*p) || p - b == remain - 1) {
+ if (g_ascii_isspace (*p) || p - b == (gint)remain - 1) {
new->required_score = strtod (c, &err_str);
if (*err_str != *p && *err_str != *(p + 1)) {
/* Invalid score */
@@ -499,7 +499,7 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er
break;
case 6:
/* Read reject score */
- if (g_ascii_isspace (*p) || p - b == remain - 1) {
+ if (g_ascii_isspace (*p) || p - b == (gint)remain - 1) {
new->reject_score = strtod (c, &err_str);
if (*err_str != *p && *err_str != *(p + 1)) {
/* Invalid score */
@@ -551,17 +551,17 @@ parse_rspamd_symbol_line (struct rspamd_connection *conn, guint len, GError **er
p ++;
}
c = p;
- while (p - b < remain) {
+ while (p - b < (gint)remain) {
switch (state) {
case 0:
/* Read symbol's name */
- if (p - b == remain - 1 || *p == ';' || *p == '(') {
+ if (p - b == (gint)remain - 1 || *p == ';' || *p == '(') {
if (p - c <= 1) {
/* Empty symbol name */
goto err;
}
else {
- if (p - b == remain - 1) {
+ if (p - b == (gint)remain - 1) {
l = p - c + 1;
}
else {
@@ -614,7 +614,7 @@ parse_rspamd_symbol_line (struct rspamd_connection *conn, guint len, GError **er
break;
case 2:
/* Read description */
- if (*p == ';' || p - b == remain - 1) {
+ if (*p == ';' || p - b == (gint)remain - 1) {
if (*p == ';') {
l = p - c;
}
@@ -635,10 +635,10 @@ parse_rspamd_symbol_line (struct rspamd_connection *conn, guint len, GError **er
break;
case 3:
/* Read option */
- if (*p == ',' || p - b == remain - 1) {
+ if (*p == ',' || p - b == (gint)remain - 1) {
/* Insert option into linked list */
l = p - c;
- if (p - b == remain - 1) {
+ if (p - b == (gint)remain - 1) {
l ++;
}
sym = g_malloc (l + 1);
@@ -688,7 +688,7 @@ parse_rspamd_action_line (struct rspamd_connection *conn, guint len, GError **er
p = b;
c = b;
- while (p - b < remain) {
+ while (p - b < (gint)remain) {
switch (state) {
case 0:
/* Read action */
@@ -701,7 +701,7 @@ parse_rspamd_action_line (struct rspamd_connection *conn, guint len, GError **er
}
break;
case 1:
- if (p - b == remain - 1) {
+ if (p - b == (gint)remain - 1) {
if (p - c <= 1) {
/* Empty action name */
goto err;
@@ -756,7 +756,7 @@ parse_rspamd_header_line (struct rspamd_connection *conn, guint len, GError **er
p = b;
c = b;
- while (p - b < remain) {
+ while (p - b < (gint)remain) {
switch (state) {
case 0:
/* Read header name */
@@ -777,7 +777,7 @@ parse_rspamd_header_line (struct rspamd_connection *conn, guint len, GError **er
p ++;
break;
case 1:
- if (p - b == remain - 1) {
+ if (p - b == (gint)remain - 1) {
if (p - c <= 1) {
/* Empty action name */
goto err;
diff --git a/lib/kvstorage/libkvstorageclient.c b/lib/kvstorage/libkvstorageclient.c
index d05e8b5e0..10e9be8a4 100644
--- a/lib/kvstorage/libkvstorageclient.c
+++ b/lib/kvstorage/libkvstorageclient.c
@@ -182,10 +182,10 @@ rspamd_kvstorage_buf_drainline (struct kvstorage_buf *buf)
p = buf->data + buf->pos;
/* Skip \r and \n characters */
- while (p - buf->data < buf->len && (*p == '\r' || *p == '\n')) {
+ while (p - buf->data < (gint)buf->len && (*p == '\r' || *p == '\n')) {
p ++;
}
- if (p - buf->data == buf->len) {
+ if (p - buf->data == (gint)buf->len) {
/* Do not move anything */
buf->pos = 0;
return;
@@ -207,9 +207,9 @@ rspamd_kvstorage_parse_reply_error (struct kvstorage_buf *buf)
/* Get one word */
p = buf->data;
- while (p - buf->data < buf->pos) {
+ while (p - buf->data < (gint)buf->pos) {
if (g_ascii_isspace (*p)) {
- while (p - buf->data < buf->pos && g_ascii_isspace (*p)) {
+ while (p - buf->data < (gint)buf->pos && g_ascii_isspace (*p)) {
p ++;
}
break;
@@ -262,7 +262,7 @@ rspamd_kvstorage_parse_get_line (struct kvstorage_buf *buf, guint *len, guint *f
while (p < end) {
if (g_ascii_isspace (*p)) {
error = FALSE;
- while (p - buf->data < buf->pos && g_ascii_isspace (*p)) {
+ while (p - buf->data < (gint)buf->pos && g_ascii_isspace (*p)) {
p ++;
}
break;
@@ -302,7 +302,7 @@ rspamd_kvstorage_parse_get_line (struct kvstorage_buf *buf, guint *len, guint *f
if (g_ascii_isspace (*p)) {
error = FALSE;
/* Skip spaces after flags */
- while (p - buf->data < buf->pos && g_ascii_isspace (*p)) {
+ while (p - buf->data < (gint)buf->pos && g_ascii_isspace (*p)) {
p ++;
}
break;