summaryrefslogtreecommitdiff
path: root/dbmail-mailbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbmail-mailbox.c')
-rw-r--r--dbmail-mailbox.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/dbmail-mailbox.c b/dbmail-mailbox.c
index e8222725..eaaaa198 100644
--- a/dbmail-mailbox.c
+++ b/dbmail-mailbox.c
@@ -189,7 +189,7 @@ int dbmail_mailbox_open(struct DbmailMailbox *self)
GString *q = g_string_new("");
g_string_printf(q, "SELECT message_idnr FROM %smessages "
- "WHERE mailbox_idnr = %llu "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " "
"AND status IN (%d,%d) "
"ORDER BY message_idnr", DBPFX,
dbmail_mailbox_get_id(self),
@@ -211,7 +211,7 @@ int dbmail_mailbox_open(struct DbmailMailbox *self)
int dbmail_mailbox_remove_uid(struct DbmailMailbox *self, u64_t *id)
{
if (! g_tree_remove(self->ids, id)) {
- TRACE(TRACE_ERROR,"trying to remove unknown UID [%llu]", *id);
+ TRACE(TRACE_ERROR,"trying to remove unknown UID [%" U64_T_FORMAT "]", *id);
return DM_EGENERAL;
}
@@ -308,7 +308,7 @@ int dbmail_mailbox_dump(struct DbmailMailbox *self, FILE *file)
ids = g_tree_keys(self->ids);
while (ids) {
- cids = g_list_append(cids,g_strdup_printf("%llu", *(u64_t *)ids->data));
+ cids = g_list_append(cids,g_strdup_printf("%" U64_T_FORMAT, *(u64_t *)ids->data));
if (! g_list_next(ids))
break;
ids = g_list_next(ids);
@@ -326,7 +326,7 @@ int dbmail_mailbox_dump(struct DbmailMailbox *self, FILE *file)
g_string_printf(q,"SELECT is_header,messageblk,%s FROM %smessageblks b "
"JOIN %sphysmessage p ON b.physmessage_id = p.id "
"JOIN %smessages m ON m.physmessage_id = p.id "
- "WHERE mailbox_idnr = %llu AND message_idnr IN (%s) "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " AND message_idnr IN (%s) "
"ORDER BY messageblk_idnr ",
date2char,
DBPFX, DBPFX, DBPFX, self->id,
@@ -400,7 +400,7 @@ static gboolean _tree_foreach(gpointer key UNUSED, gpointer value, GString * dat
sublist = g_list_first(sublist);
while(sublist) {
id = sublist->data;
- g_string_append_printf(t, "(%llu)", *id);
+ g_string_append_printf(t, "(%" U64_T_FORMAT ")", *id);
if (! g_list_next(sublist))
break;
@@ -432,7 +432,7 @@ char * dbmail_mailbox_orderedsubject(struct DbmailMailbox *self)
"FROM %smessages "
"JOIN %ssubjectfield USING (physmessage_id) "
"JOIN %sdatefield USING (physmessage_id) "
- "WHERE mailbox_idnr=%llu "
+ "WHERE mailbox_idnr=%" U64_T_FORMAT " "
"AND status IN (%d, %d) "
"GROUP BY subjectfield",
DBPFX, DBPFX, DBPFX,
@@ -469,7 +469,7 @@ char * dbmail_mailbox_orderedsubject(struct DbmailMailbox *self)
"FROM %smessages "
"JOIN %ssubjectfield using (physmessage_id) "
"JOIN %sdatefield using (physmessage_id) "
- "WHERE mailbox_idnr=%llu "
+ "WHERE mailbox_idnr=%" U64_T_FORMAT " "
"AND status IN (%d,%d) "
"ORDER BY subjectfield,datefield",
DBPFX, DBPFX, DBPFX,
@@ -545,7 +545,7 @@ char * dbmail_mailbox_ids_as_string(struct DbmailMailbox *self)
h = l;
while(l->data) {
- g_string_append_printf(t,"%llu ", *(u64_t *)l->data);
+ g_string_append_printf(t,"%" U64_T_FORMAT " ", *(u64_t *)l->data);
if (! g_list_next(l))
break;
l = g_list_next(l);
@@ -578,9 +578,9 @@ char * dbmail_mailbox_sorted_as_string(struct DbmailMailbox *self)
msn = g_tree_lookup(self->ids, l->data);
if (msn) {
if (uid)
- g_string_append_printf(t,"%llu ", *(u64_t *)l->data);
+ g_string_append_printf(t,"%" U64_T_FORMAT " ", *(u64_t *)l->data);
else
- g_string_append_printf(t,"%llu ", *(u64_t *)msn);
+ g_string_append_printf(t,"%" U64_T_FORMAT " ", *(u64_t *)msn);
}
if (! g_list_next(l))
break;
@@ -1165,7 +1165,7 @@ int dbmail_mailbox_build_imap_search(struct DbmailMailbox *self, char **search_k
/* SEARCH */
while( search_keys[*idx] && ((result = _handle_search_args(self, search_keys, idx)) == 0) );
- TRACE(TRACE_DEBUG,"done [%d] at idx [%llu]", result, *idx);
+ TRACE(TRACE_DEBUG,"done [%d] at idx [%" U64_T_FORMAT "]", result, *idx);
return result;
}
@@ -1190,7 +1190,7 @@ static gboolean _do_sort(GNode *node, struct DbmailMailbox *self)
g_string_printf(q, "SELECT message_idnr FROM %smessages m "
"LEFT JOIN %sphysmessage p ON m.physmessage_id=p.id "
"%s"
- "WHERE m.mailbox_idnr = %llu AND m.status IN (%d,%d) "
+ "WHERE m.mailbox_idnr = %" U64_T_FORMAT " AND m.status IN (%d,%d) "
"ORDER BY %smessage_idnr", DBPFX, DBPFX, s->table,
dbmail_mailbox_get_id(self), MESSAGE_STATUS_NEW, MESSAGE_STATUS_SEEN, s->order);
@@ -1268,7 +1268,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
g_string_printf(q,"SELECT message_idnr FROM %smessages m "
"JOIN %sphysmessage p ON m.physmessage_id=p.id "
"JOIN %sdatefield d ON d.physmessage_id=p.id "
- "WHERE mailbox_idnr= %llu AND status IN (%d,%d) "
+ "WHERE mailbox_idnr= %" U64_T_FORMAT " AND status IN (%d,%d) "
"AND %s "
"ORDER BY message_idnr", DBPFX, DBPFX, DBPFX,
dbmail_mailbox_get_id(self),
@@ -1284,7 +1284,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
"JOIN %sphysmessage p ON m.physmessage_id=p.id "
"JOIN %sheadervalue v ON v.physmessage_id=p.id "
"JOIN %sheadername n ON v.headername_id=n.id "
- "WHERE mailbox_idnr = %llu "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " "
"AND status IN (%d,%d) "
"AND headername %s '%s' AND %s %s '%%%s%%' "
"ORDER BY message_idnr",
@@ -1303,7 +1303,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
"JOIN %sphysmessage p ON k.physmessage_id=p.id "
"JOIN %smessages m ON m.physmessage_id=p.id "
"JOIN %sheadervalue v ON v.physmessage_id=p.id "
- "WHERE m.mailbox_idnr=%llu AND m.status in (%d,%d) "
+ "WHERE m.mailbox_idnr=%" U64_T_FORMAT " AND m.status in (%d,%d) "
"HAVING %s %s '%%%s%%' "
"OR k.messageblk %s '%%%s%%'",
DBPFX,DBPFX,DBPFX,DBPFX,
@@ -1317,7 +1317,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
case IST_IDATE:
g_string_printf(q, "SELECT message_idnr FROM %smessages m "
"JOIN %sphysmessage p ON m.physmessage_id=p.id "
- "WHERE mailbox_idnr = %llu "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " "
"AND status IN (%d,%d) AND p.%s "
"ORDER BY message_idnr",
DBPFX, DBPFX,
@@ -1331,7 +1331,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
g_string_printf(q, "SELECT m.message_idnr,k.messageblk FROM %smessageblks k "
"JOIN %sphysmessage p ON k.physmessage_id = p.id "
"JOIN %smessages m ON p.id = m.physmessage_id "
- "WHERE mailbox_idnr = %llu "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " "
"AND status IN (%d,%d ) "
"AND k.is_header = '0' "
"GROUP BY m.message_idnr,k.messageblk "
@@ -1349,8 +1349,8 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
g_string_printf(q, "SELECT m.message_idnr FROM %smessages m "
"JOIN %sphysmessage p ON m.physmessage_id = p.id "
- "WHERE m.mailbox_idnr = %llu "
- "AND m.status IN (%d,%d) AND p.messagesize %c %llu "
+ "WHERE m.mailbox_idnr = %" U64_T_FORMAT " "
+ "AND m.status IN (%d,%d) AND p.messagesize %c %" U64_T_FORMAT " "
"ORDER BY message_idnr", DBPFX, DBPFX,
dbmail_mailbox_get_id(self),
MESSAGE_STATUS_NEW, MESSAGE_STATUS_SEEN,
@@ -1359,7 +1359,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
default:
g_string_printf(q, "SELECT message_idnr FROM %smessages "
- "WHERE mailbox_idnr = %llu "
+ "WHERE mailbox_idnr = %" U64_T_FORMAT " "
"AND status IN (%d,%d) AND %s "
"ORDER BY message_idnr", DBPFX,
dbmail_mailbox_get_id(self),
@@ -1387,7 +1387,7 @@ static GTree * mailbox_search(struct DbmailMailbox *self, search_key_t *s)
for (i=0; i < rows; i++) {
id = db_get_result_u64(i,0);
if (! (w = g_tree_lookup(self->ids, &id))) {
- TRACE(TRACE_ERROR, "key missing in self->ids: [%llu]\n", id);
+ TRACE(TRACE_ERROR, "key missing in self->ids: [%" U64_T_FORMAT "]\n", id);
continue;
}
assert(w);