Browse Source

Fixed 32bits/64bits conversions (fixed #162)

merge-experiment
Hoa V. DINH 7 years ago
parent
commit
6de5766e8f
53 changed files with 162 additions and 160 deletions
  1. +2
    -2
      src/data-types/mail_cache_db.c
  2. +1
    -1
      src/data-types/maillock.c
  3. +2
    -2
      src/data-types/mailstream_cancel.c
  4. +3
    -3
      src/data-types/mailstream_compress.c
  5. +2
    -2
      src/data-types/mailstream_low.c
  6. +2
    -2
      src/data-types/mailstream_ssl.c
  7. +5
    -5
      src/driver/implementation/db/dbdriver.c
  8. +3
    -3
      src/driver/implementation/feed/feeddriver.c
  9. +1
    -1
      src/driver/implementation/feed/feeddriver_message.c
  10. +2
    -2
      src/driver/implementation/imap/imapdriver.c
  11. +6
    -6
      src/driver/implementation/imap/imapdriver_cached.c
  12. +2
    -2
      src/driver/implementation/maildir/maildirdriver.c
  13. +4
    -4
      src/driver/implementation/maildir/maildirdriver_cached.c
  14. +1
    -1
      src/driver/implementation/maildir/maildirdriver_cached_message.c
  15. +1
    -1
      src/driver/implementation/maildir/maildirdriver_message.c
  16. +1
    -1
      src/driver/implementation/mbox/mboxdriver.c
  17. +2
    -2
      src/driver/implementation/mbox/mboxdriver_cached.c
  18. +1
    -1
      src/driver/implementation/mh/mhdriver.c
  19. +2
    -2
      src/driver/implementation/mh/mhdriver_cached.c
  20. +1
    -1
      src/driver/implementation/nntp/nntpdriver.c
  21. +1
    -1
      src/driver/implementation/nntp/nntpdriver_cached.c
  22. +4
    -4
      src/driver/interface/maildriver_tools.c
  23. +2
    -2
      src/driver/interface/mailstorage_tools.c
  24. +1
    -1
      src/driver/tools/imfcache.c
  25. +6
    -6
      src/driver/tools/mailthread.c
  26. +3
    -3
      src/engine/mailengine.c
  27. +3
    -3
      src/engine/mailprivacy_gnupg.c
  28. +6
    -6
      src/engine/mailprivacy_smime.c
  29. +2
    -2
      src/engine/mailprivacy_tools.c
  30. +10
    -8
      src/low-level/feed/date.c
  31. +1
    -1
      src/low-level/imap/mailimap_helper.c
  32. +1
    -1
      src/low-level/imap/mailimap_helper.h
  33. +5
    -5
      src/low-level/imap/mailimap_keywords.c
  34. +3
    -3
      src/low-level/imap/mailimap_keywords.h
  35. +4
    -4
      src/low-level/imap/mailimap_oauth2.c
  36. +9
    -9
      src/low-level/imap/mailimap_sender.c
  37. +3
    -3
      src/low-level/imap/mailimap_sender.h
  38. +1
    -1
      src/low-level/imap/uidplus.c
  39. +1
    -1
      src/low-level/imap/uidplus.h
  40. +1
    -1
      src/low-level/imf/mailimf_types_helper.c
  41. +1
    -1
      src/low-level/imf/mailimf_write_file.c
  42. +1
    -1
      src/low-level/imf/mailimf_write_mem.c
  43. +5
    -5
      src/low-level/maildir/maildir.c
  44. +1
    -1
      src/low-level/mbox/mailmbox.c
  45. +2
    -2
      src/low-level/mbox/mailmbox_parse.c
  46. +7
    -7
      src/low-level/mh/mailmh.c
  47. +1
    -1
      src/low-level/mime/mailmime_content.c
  48. +1
    -1
      src/low-level/mime/mailmime_write_file.c
  49. +9
    -9
      src/low-level/nntp/newsnntp.c
  50. +2
    -2
      src/low-level/nntp/newsnntp_types.h
  51. +12
    -12
      src/low-level/pop3/mailpop3.c
  52. +5
    -5
      src/low-level/smtp/mailsmtp.c
  53. +4
    -4
      src/low-level/smtp/mailsmtp_oauth2.c

+ 2
- 2
src/data-types/mail_cache_db.c View File

@ -348,7 +348,7 @@ int mail_cache_db_clean_up(struct mail_cache_db * cache_db,
chashdatum hash_data;
hash_key.data = db_key.data;
hash_key.len = db_key.size;
hash_key.len = (unsigned int) db_key.size;
r = chash_get(exist, &hash_key, &hash_data);
if (r < 0) {
@ -475,7 +475,7 @@ int mail_cache_db_get_keys(struct mail_cache_db * cache_db,
chashdatum hash_data;
hash_key.data = db_key.data;
hash_key.len = db_key.size;
hash_key.len = (unsigned int) db_key.size;
hash_data.data = NULL;
hash_data.len = 0;


+ 1
- 1
src/data-types/maillock.c View File

@ -255,7 +255,7 @@ static int lock_common(const char * filename, int fd, short locktype)
fd2 = open(lockfilename, O_WRONLY|O_EXCL|O_CREAT, 0);
if (fd2 >= 0) {
/* defeat lock checking programs which test pid */
r = write(fd2, "0", 2);
r = (int) write(fd2, "0", 2);
close(fd2);
break;
}


+ 2
- 2
src/data-types/mailstream_cancel.c View File

@ -174,7 +174,7 @@ void mailstream_cancel_notify(struct mailstream_cancel * cancel)
ch = 0;
#ifndef WIN32
r = write(cancel->ms_fds[1], &ch, 1);
r = (int) write(cancel->ms_fds[1], &ch, 1);
#else
SetEvent(ms_internal->event);
#endif
@ -185,7 +185,7 @@ void mailstream_cancel_ack(struct mailstream_cancel * cancel)
#ifndef WIN32
char ch;
int r;
r = read(cancel->ms_fds[0], &ch, 1);
r = (int) read(cancel->ms_fds[0], &ch, 1);
#endif
}


+ 3
- 3
src/data-types/mailstream_compress.c View File

@ -166,7 +166,7 @@ static ssize_t mailstream_low_compress_read(mailstream_low * s, void * buf, size
do {
/* if there is no compressed data, read more */
if (strm->avail_in == 0) {
int read = data->ms->driver->mailstream_read(data->ms, data->input_buf, CHUNK_SIZE);
int read = (int) data->ms->driver->mailstream_read(data->ms, data->input_buf, CHUNK_SIZE);
if (read <= 0) {
return read;
}
@ -176,7 +176,7 @@ static ssize_t mailstream_low_compress_read(mailstream_low * s, void * buf, size
/* set the output buffer */
strm->next_out = buf;
strm->avail_out = count;
strm->avail_out = (int) count;
/* uncompress any waiting data */
zr = inflate(strm, Z_NO_FLUSH);
@ -209,7 +209,7 @@ static ssize_t mailstream_low_compress_write(mailstream_low * s, const void * bu
strm->next_in = (Bytef *)buf;
/* we won't try to compress more than CHUNK_SIZE at a time so we always have enough buffer space */
int compress_len = MIN(count, CHUNK_SIZE);
int compress_len = MIN((int) count, CHUNK_SIZE);
strm->avail_in = compress_len;
strm->avail_out = CHUNK_SIZE;
strm->next_out = data->output_buf;


+ 2
- 2
src/data-types/mailstream_low.c View File

@ -95,7 +95,7 @@ static inline void mailstream_logger_internal(mailstream_low * s, int is_stream_
if (f != NULL) { \
int nmemb; \
maillock_write_lock(LOG_FILE, fileno(f)); \
nmemb = fwrite((buf), 1, (size), f); \
nmemb = fwrite((buf), 1, (size_t) (size), f); \
maillock_write_unlock(LOG_FILE, fileno(f)); \
fclose(f); \
} \
@ -122,7 +122,7 @@ static inline void mailstream_logger_internal(mailstream_low * s, int is_stream_
if (f != NULL) { \
int nmemb; \
maillock_write_lock(LOG_FILE, fileno(f)); \
nmemb = fwrite((buf), 1, (size), f); \
nmemb = fwrite((buf), 1, (size_t) (size), f); \
maillock_write_unlock(LOG_FILE, fileno(f)); \
fclose(f); \
} \


+ 2
- 2
src/data-types/mailstream_ssl.c View File

@ -837,7 +837,7 @@ static ssize_t mailstream_low_ssl_read(mailstream_low * s,
while (1) {
int ssl_r;
r = SSL_read(ssl_data->ssl_conn, buf, count);
r = SSL_read(ssl_data->ssl_conn, buf, (int) count);
if (r > 0)
return r;
@ -985,7 +985,7 @@ static ssize_t mailstream_low_ssl_write(mailstream_low * s,
if (r <= 0)
return r;
r = SSL_write(ssl_data->ssl_conn, buf, count);
r = SSL_write(ssl_data->ssl_conn, buf, (int) count);
if (r > 0)
return r;


+ 5
- 5
src/driver/implementation/db/dbdriver.c View File

@ -504,19 +504,19 @@ static int expunge_folder(mailsession * session)
if (!deleted) {
snprintf(key_value, sizeof(key_value), "%lu", (unsigned long) num);
key.data = key_value;
key.len = strlen(key_value);
key.len = (unsigned int) strlen(key_value);
chash_set(msg_table, &key, &value, NULL);
snprintf(key_value, sizeof(key_value), "%lu-envelope",
(unsigned long) num);
key.data = key_value;
key.len = strlen(key_value);
key.len = (unsigned int) strlen(key_value);
chash_set(msg_table, &key, &value, NULL);
snprintf(key_value, sizeof(key_value), "%lu-flags",
(unsigned long) num);
key.data = key_value;
key.len = strlen(key_value);
key.len = (unsigned int) strlen(key_value);
chash_set(msg_table, &key, &value, NULL);
i ++;
@ -1039,7 +1039,7 @@ static int get_message(mailsession * session,
size = 0;
snprintf(key, sizeof(key), "%lu", (unsigned long) num);
r = mail_cache_db_get_size(maildb, key, strlen(key), &size);
r = mail_cache_db_get_size(maildb, key, (size_t) strlen(key), &size);
/* ignore error */
r = mailmessage_init(msg, session, db_message_driver,
@ -1065,7 +1065,7 @@ static int get_message_by_uid(mailsession * session,
{
uint32_t msg_num;
msg_num = strtoul(uid, NULL, 10);
msg_num = (uint32_t) strtoul(uid, NULL, 10);
return get_message(session, msg_num, result);
}

+ 3
- 3
src/driver/implementation/feed/feeddriver.c View File

@ -390,7 +390,7 @@ static inline int quote_word(const char * display_charset,
if (mmap_string_append(mmapstr, "?Q?") == NULL)
return -1;
col = mmapstr->len;
col = (int) mmapstr->len;
cur = word;
for(i = 0 ; i < size ; i ++) {
@ -409,7 +409,7 @@ static inline int quote_word(const char * display_charset,
if (mmap_string_append(mmapstr, " ") == NULL)
return -1;
old_pos = mmapstr->len;
old_pos = (int) mmapstr->len;
if (mmap_string_append(mmapstr, "=?") == NULL)
return -1;
@ -418,7 +418,7 @@ static inline int quote_word(const char * display_charset,
if (mmap_string_append(mmapstr, "?Q?") == NULL)
return -1;
col = mmapstr->len - old_pos;
col = (int) mmapstr->len - old_pos;
}
do_quote_char = 0;


+ 1
- 1
src/driver/implementation/feed/feeddriver_message.c View File

@ -196,5 +196,5 @@ static int feed_fetch_size(mailmessage * msg_info,
}
msg = msg_info->msg_data;
return msg->msg_length;
return (int) msg->msg_length;
}

+ 2
- 2
src/driver/implementation/imap/imapdriver.c View File

@ -1210,12 +1210,12 @@ static int imapdriver_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
uidvalidity = strtoul(uid, &p1, 10);
uidvalidity = (uint32_t) strtoul(uid, &p1, 10);
if (p1 == uid || * p1 != '-')
return MAIL_ERROR_INVAL;
p1++;
num = strtoul(p1, &p2, 10);
num = (uint32_t) strtoul(p1, &p2, 10);
if (p2 == p1 || * p2 != '\0')
return MAIL_ERROR_INVAL;


+ 6
- 6
src/driver/implementation/imap/imapdriver_cached.c View File

@ -316,7 +316,7 @@ static int update_uid_cache(mailsession * session,
}
msg = carray_get(env_list->msg_tab, i);
cache_item->uid = msg->msg_index;
cache_item->size = msg->msg_size;
cache_item->size = (uint32_t) msg->msg_size;
carray_set(data->imap_uid_list, i, cache_item);
}
@ -934,7 +934,7 @@ static int boostrap_cache(mailsession * session)
get_uid_from_filename(msg_uid);
key.data = msg_uid;
key.len = strlen(msg_uid) + 1;
key.len = (unsigned int) strlen(msg_uid) + 1;
value.data = NULL;
value.len = 0;
chash_set(keys_uid, &key, &value, NULL);
@ -951,14 +951,14 @@ static int boostrap_cache(mailsession * session)
chash_key(iter, &key);
uid = key.data;
uidvalidity = strtoul(uid, &p1, 10);
uidvalidity = (uint32_t) strtoul(uid, &p1, 10);
if (p1 == uid || * p1 != '-')
continue;
data->imap_uidvalidity = uidvalidity;
p1++;
indx = strtoul(p1, &p2, 10);
indx = (uint32_t) strtoul(p1, &p2, 10);
if (p2 == p1 || * p2 != '\0')
continue;
@ -1514,12 +1514,12 @@ static int imapdriver_cached_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
uidvalidity = strtoul(uid, &p1, 10);
uidvalidity = (uint32_t) strtoul(uid, &p1, 10);
if (p1 == uid || * p1 != '-')
return MAIL_ERROR_INVAL;
p1++;
num = strtoul(p1, &p2, 10);
num = (uint32_t) strtoul(p1, &p2, 10);
if (p2 == p1 || * p2 != '\0')
return MAIL_ERROR_INVAL;


+ 2
- 2
src/driver/implementation/maildir/maildirdriver.c View File

@ -413,7 +413,7 @@ static int append_message_flags(mailsession * session,
goto exit;
key.data = uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
goto exit;
@ -506,7 +506,7 @@ static int get_envelopes_list(mailsession * session,
msg = carray_get(env_list->msg_tab, i);
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
continue;


+ 4
- 4
src/driver/implementation/maildir/maildirdriver_cached.c View File

@ -523,7 +523,7 @@ static int append_message_flags(mailsession * session,
goto exit;
key.data = uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
goto exit;
@ -581,7 +581,7 @@ static int uid_clean_up(struct mail_cache_db * uid_db,
value.len = 0;
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
r = chash_set(hash_exist, &key, &value, NULL);
if (r < 0) {
res = MAIL_ERROR_MEMORY;
@ -591,7 +591,7 @@ static int uid_clean_up(struct mail_cache_db * uid_db,
snprintf(key_str, sizeof(key_str), "uid-%lu",
(unsigned long) msg->msg_index);
key.data = key_str;
key.len = strlen(key_str);
key.len = (unsigned int) strlen(key_str);
r = chash_set(hash_exist, &key, &value, NULL);
if (r < 0) {
res = MAIL_ERROR_MEMORY;
@ -623,9 +623,9 @@ static int get_messages_list(mailsession * session,
struct mail_cache_db * uid_db;
void * value;
size_t value_len;
unsigned long i;
struct maildir_cached_session_state_data * data;
char key[PATH_MAX];
unsigned int i;
data = get_cached_data(session);


+ 1
- 1
src/driver/implementation/maildir/maildirdriver_cached_message.c View File

@ -327,7 +327,7 @@ static int get_flags(mailmessage * msg_info,
return MAIL_ERROR_BAD_STATE;
key.data = msg_info->msg_uid;
key.len = strlen(msg_info->msg_uid);
key.len = (unsigned int) strlen(msg_info->msg_uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
return MAIL_ERROR_MSG_NOT_FOUND;


+ 1
- 1
src/driver/implementation/maildir/maildirdriver_message.c View File

@ -246,7 +246,7 @@ static int get_flags(mailmessage * msg_info,
return MAIL_ERROR_BAD_STATE;
key.data = msg_info->msg_uid;
key.len = strlen(msg_info->msg_uid);
key.len = (unsigned int) strlen(msg_info->msg_uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
return MAIL_ERROR_MSG_NOT_FOUND;


+ 1
- 1
src/driver/implementation/mbox/mboxdriver.c View File

@ -497,7 +497,7 @@ static int mboxdriver_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
num = strtoul(uid, &p, 10);
num = (uint32_t) strtoul(uid, &p, 10);
if (p == uid || * p != '-')
return MAIL_ERROR_INVAL;


+ 2
- 2
src/driver/implementation/mbox/mboxdriver_cached.c View File

@ -519,7 +519,7 @@ static int write_max_uid_value(mailsession * session)
goto free_mmapstr;
}
r = fwrite(mmapstr->str, 1, mmapstr->len, f);
r = (int) fwrite(mmapstr->str, 1, mmapstr->len, f);
if ((size_t) r != mmapstr->len) {
res = MAIL_ERROR_FILE;
goto free_mmapstr;
@ -1320,7 +1320,7 @@ static int mboxdriver_cached_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
num = strtoul(uid, &p, 10);
num = (uint32_t) strtoul(uid, &p, 10);
if (p == uid || * p != '-')
return MAIL_ERROR_INVAL;


+ 1
- 1
src/driver/implementation/mh/mhdriver.c View File

@ -861,7 +861,7 @@ static int mhdriver_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
indx = strtoul(uid, &p, 10);
indx = (uint32_t) strtoul(uid, &p, 10);
if (p == uid || * p != '-')
return MAIL_ERROR_INVAL;


+ 2
- 2
src/driver/implementation/mh/mhdriver_cached.c View File

@ -287,7 +287,7 @@ static int write_max_uid_value(mailsession * session)
goto free_mmapstr;
}
r = fwrite(mmapstr->str, 1, mmapstr->len, f);
r = (int) fwrite(mmapstr->str, 1, mmapstr->len, f);
if ((size_t) r != mmapstr->len) {
res = MAIL_ERROR_FILE;
goto free_mmapstr;
@ -1281,7 +1281,7 @@ static int mhdriver_cached_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
indx = strtoul(uid, &p, 10);
indx = (uint32_t) strtoul(uid, &p, 10);
if (p == uid || * p != '-')
return MAIL_ERROR_INVAL;


+ 1
- 1
src/driver/implementation/nntp/nntpdriver.c View File

@ -1182,7 +1182,7 @@ static int nntpdriver_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
num = strtoul(uid, &p, 10);
num = (uint32_t) strtoul(uid, &p, 10);
if ((p == uid) || (* p != '\0'))
return MAIL_ERROR_INVAL;


+ 1
- 1
src/driver/implementation/nntp/nntpdriver_cached.c View File

@ -1061,7 +1061,7 @@ static int nntpdriver_cached_get_message_by_uid(mailsession * session,
if (uid == NULL)
return MAIL_ERROR_INVAL;
num = strtoul(uid, &p, 10);
num = (uint32_t) strtoul(uid, &p, 10);
if ((p == uid) || (* p != '\0'))
return MAIL_ERROR_INVAL;


+ 4
- 4
src/driver/interface/maildriver_tools.c View File

@ -664,7 +664,7 @@ int maildriver_cache_clean_up(struct mail_cache_db * cache_db_env,
snprintf(keyname, PATH_MAX, "%s-envelope", msg->msg_uid);
key.data = keyname;
key.len = strlen(keyname);
key.len = (unsigned int) strlen(keyname);
r = chash_set(hash_exist, &key, &value, NULL);
if (r < 0) {
res = MAIL_ERROR_MEMORY;
@ -676,7 +676,7 @@ int maildriver_cache_clean_up(struct mail_cache_db * cache_db_env,
snprintf(keyname, PATH_MAX, "%s-flags", msg->msg_uid);
key.data = keyname;
key.len = strlen(keyname);
key.len = (unsigned int) strlen(keyname);
r = chash_set(hash_exist, &key, &value, NULL);
if (r < 0) {
res = MAIL_ERROR_MEMORY;
@ -741,7 +741,7 @@ int maildriver_message_cache_clean_up(char * cache_dir,
msg = carray_get(env_list->msg_tab, i);
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
value.data = NULL;
value.len = 0;
r = chash_set(hash_exist, &key, &value, NULL);
@ -774,7 +774,7 @@ int maildriver_message_cache_clean_up(char * cache_dir,
continue;
key.data = keyname;
key.len = strlen(keyname);
key.len = (unsigned int) strlen(keyname);
r = chash_get(hash_exist, &key, &value);
if (r < 0) {


+ 2
- 2
src/driver/interface/mailstorage_tools.c View File

@ -75,7 +75,7 @@
static void do_exec_command(int fd, const char *command,
char *servername, uint16_t port)
{
int i, maxopen;
long i, maxopen;
#ifndef HAVE_SETENV
char env_buffer[ENV_BUFFER_SIZE];
#endif
@ -127,7 +127,7 @@ static void do_exec_command(int fd, const char *command,
maxopen = sysconf(_SC_OPEN_MAX);
for (i=3; i < maxopen; i++)
close(i);
close((int) i);
#ifdef TIOCNOTTY
/* Detach from the controlling tty if we have one. Otherwise,


+ 1
- 1
src/driver/tools/imfcache.c View File

@ -226,7 +226,7 @@ int mailimf_cache_string_write(MMAPString * mmapstr, size_t * indx,
if (r != MAIL_NO_ERROR)
return r;
r = mailimf_cache_int_write(mmapstr, indx, length);
r = mailimf_cache_int_write(mmapstr, indx, (uint32_t) length);
if (r != MAIL_NO_ERROR)
return r;


+ 6
- 6
src/driver/tools/mailthread.c View File

@ -772,7 +772,7 @@ mail_build_thread_references(char * default_from,
}
else {
hashkey.data = msgid;
hashkey.len = strlen(msgid);
hashkey.len = (unsigned int) strlen(msgid);
if (chash_get(msg_id_hash, &hashkey, &hashdata) == 0)
msgid = mailimf_get_message_id();
@ -801,7 +801,7 @@ mail_build_thread_references(char * default_from,
}
hashkey.data = msgid;
hashkey.len = strlen(msgid);
hashkey.len = (unsigned int) strlen(msgid);
hashdata.data = env_tree;
hashdata.len = 0;
@ -858,7 +858,7 @@ mail_build_thread_references(char * default_from,
msgid = clist_content(cur_ref);
hashkey.data = msgid;
hashkey.len = strlen(msgid);
hashkey.len = (unsigned int) strlen(msgid);
r = chash_get(msg_id_hash, &hashkey, &hashdata);
if (r < 0) {
@ -884,7 +884,7 @@ mail_build_thread_references(char * default_from,
}
hashkey.data = msgid;
hashkey.len = strlen(msgid);
hashkey.len = (unsigned int) strlen(msgid);
hashdata.data = env_cur_tree;
hashdata.len = 0;
@ -1062,7 +1062,7 @@ mail_build_thread_references(char * default_from,
*/
key.data = base_subject;
key.len = strlen(base_subject);
key.len = (unsigned int) strlen(base_subject);
r = chash_get(subject_hash, &key, &data);
@ -1166,7 +1166,7 @@ mail_build_thread_references(char * default_from,
*/
key.data = env_tree->node_base_subject;
key.len = strlen(env_tree->node_base_subject);
key.len = (unsigned int) strlen(env_tree->node_base_subject);
r = chash_get(subject_hash, &key, &data);
if (r < 0)


+ 3
- 3
src/engine/mailengine.c View File

@ -286,7 +286,7 @@ folder_info_get_msg_by_uid(struct folder_ref_info * ref_info,
int r;
key.data = uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(ref_info->uid_hash, &key, &data);
if (r < 0)
return NULL;
@ -381,7 +381,7 @@ static int folder_message_add(struct folder_ref_info * ref_info,
if (msg->msg_uid != NULL) {
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
data.data = msg;
data.len = 0;
@ -411,7 +411,7 @@ static void folder_message_remove(struct folder_ref_info * ref_info,
if (msg->msg_uid != NULL) {
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
chash_delete(ref_info->uid_hash, &key, NULL);
}


+ 3
- 3
src/engine/mailprivacy_gnupg.c View File

@ -3003,9 +3003,9 @@ int mailprivacy_gnupg_set_encryption_id(struct mailprivacy * privacy,
}
key.data = buf;
key.len = strlen(buf) + 1;
key.len = (unsigned int) strlen(buf) + 1;
value.data = passphrase;
value.len = strlen(passphrase) + 1;
value.len = (unsigned int) strlen(passphrase) + 1;
r = chash_set(passphrase_hash, &key, &value, NULL);
if (r < 0) {
@ -3034,7 +3034,7 @@ static char * get_passphrase(struct mailprivacy * privacy,
return NULL;
key.data = buf;
key.len = strlen(buf) + 1;
key.len = (unsigned int) strlen(buf) + 1;
r = chash_get(passphrase_hash, &key, &value);
if (r < 0)


+ 6
- 6
src/engine/mailprivacy_smime.c View File

@ -1320,9 +1320,9 @@ static void set_file(chash * hash, char * email, char * filename)
strip_string(buf);
key.data = buf;
key.len = strlen(buf);
key.len = (unsigned int) strlen(buf);
data.data = filename;
data.len = strlen(filename) + 1;
data.len = (unsigned int) strlen(filename) + 1;
chash_set(hash, &key, &data, NULL);
}
@ -1342,7 +1342,7 @@ static char * get_file(chash * hash, char * email)
strip_string(buf);
key.data = buf;
key.len = strlen(buf);
key.len = (unsigned int) strlen(buf);
r = chash_get(hash, &key, &data);
if (r < 0)
return NULL;
@ -1873,9 +1873,9 @@ int mailprivacy_smime_set_encryption_id(struct mailprivacy * privacy,
}
key.data = buf;
key.len = strlen(buf) + 1;
key.len = (unsigned int) strlen(buf) + 1;
value.data = passphrase;
value.len = strlen(passphrase) + 1;
value.len = (unsigned int) strlen(passphrase) + 1;
r = chash_set(passphrase_hash, &key, &value, NULL);
if (r < 0) {
@ -1904,7 +1904,7 @@ static char * get_passphrase(struct mailprivacy * privacy,
return NULL;
key.data = buf;
key.len = strlen(buf) + 1;
key.len = (unsigned int) strlen(buf) + 1;
r = chash_get(passphrase_hash, &key, &value);
if (r < 0)


+ 2
- 2
src/engine/mailprivacy_tools.c View File

@ -1530,7 +1530,7 @@ int mailprivacy_spawn_and_wait(char * command, char * passphrase,
close(passphrase_input[0]);
if ((passphrase != NULL) && (strlen(passphrase) > 0)) {
r = write(passphrase_input[1], passphrase, strlen(passphrase));
r = (int) write(passphrase_input[1], passphrase, strlen(passphrase));
if (r != (int) strlen(passphrase)) {
close(passphrase_input[1]);
return ERROR_PASSPHRASE_FILE;
@ -1538,7 +1538,7 @@ int mailprivacy_spawn_and_wait(char * command, char * passphrase,
}
else {
/* dummy password */
r = write(passphrase_input[1], "*dummy*", 7);
r = (int) write(passphrase_input[1], "*dummy*", 7);
if (r != 7) {
close(passphrase_input[1]);
return ERROR_PASSPHRASE_FILE;


+ 10
- 8
src/low-level/feed/date.c View File

@ -76,6 +76,7 @@ static time_t basic_format_parse(const char * str)
int apply_offset;
struct tm ts;
int local_time;
time_t result;
len = strlen(str);
current_index = 0;
@ -180,15 +181,15 @@ static time_t basic_format_parse(const char * str)
ts.tm_year = year - 1900;
if (local_time) {
value = mktime(&ts);
result = mktime(&ts);
}
else {
value = mail_mkgmtime(&ts);
result = mail_mkgmtime(&ts);
if (apply_offset)
value -= offset;
result -= offset;
}
return value;
return result;
}
/*
@ -216,6 +217,7 @@ static time_t extended_format_parse(const char * str)
int apply_offset;
struct tm ts;
int local_time;
time_t result;
len = strlen(str);
current_index = 0;
@ -359,15 +361,15 @@ static time_t extended_format_parse(const char * str)
ts.tm_year = year - 1900;
if (local_time) {
value = mktime(&ts);
result = mktime(&ts);
}
else {
value = mail_mkgmtime(&ts);
result = mail_mkgmtime(&ts);
if (apply_offset)
value -= offset;
result -= offset;
}
return value;
return result;
}
time_t newsfeed_iso8601_date_parse(const char * str)


+ 1
- 1
src/low-level/imap/mailimap_helper.c View File

@ -188,7 +188,7 @@ int mailimap_fetch_envelope(mailimap * session,
}
int mailimap_append_simple(mailimap * session, const char * mailbox,
const char * content, uint32_t size)
const char * content, size_t size)
{
return mailimap_append(session, mailbox, NULL, NULL, content, size);
}


+ 1
- 1
src/low-level/imap/mailimap_helper.h View File

@ -54,7 +54,7 @@ int mailimap_fetch_envelope(mailimap * session,
clist ** result);
int mailimap_append_simple(mailimap * session, const char * mailbox,
const char * content, uint32_t size);
const char * content, size_t size);
int mailimap_login_simple(mailimap * session,
const char * userid, const char * password);


+ 5
- 5
src/low-level/imap/mailimap_keywords.c View File

@ -56,7 +56,7 @@ int mailimap_token_case_insensitive_parse(mailstream * fd,
size_t * indx,
const char * token)
{
int len;
size_t len;
size_t cur_token;
int r;
@ -87,7 +87,7 @@ static int is_space_or_tab(char ch)
int mailimap_char_parse(mailstream * fd, MMAPString * buffer,
size_t * indx, char token)
{
int cur_token;
size_t cur_token;
cur_token = * indx;
@ -201,7 +201,7 @@ int mailimap_status_att_get_token_value(mailstream * fd, MMAPString * buffer,
}
const char * mailimap_status_att_get_token_str(size_t indx)
const char * mailimap_status_att_get_token_str(int indx)
{
return mailimap_get_token_str(indx, status_att_tab);
}
@ -228,7 +228,7 @@ int mailimap_month_get_token_value(mailstream * fd, MMAPString * buffer,
}
const char * mailimap_month_get_token_str(size_t indx)
const char * mailimap_month_get_token_str(int indx)
{
return mailimap_get_token_str(indx, month_tab);
}
@ -253,7 +253,7 @@ int mailimap_flag_get_token_value(mailstream * fd, MMAPString * buffer,
}
const char * mailimap_flag_get_token_str(size_t indx)
const char * mailimap_flag_get_token_str(int indx)
{
return mailimap_get_token_str(indx, mailimap_flag_tab);
}


+ 3
- 3
src/low-level/imap/mailimap_keywords.h View File

@ -61,18 +61,18 @@ int mailimap_token_case_insensitive_parse(mailstream * fd,
int mailimap_status_att_get_token_value(mailstream * fd, MMAPString * buffer,
size_t * indx);
const char * mailimap_status_att_get_token_str(size_t indx);
const char * mailimap_status_att_get_token_str(int indx);
int mailimap_month_get_token_value(mailstream * fd, MMAPString * buffer,
size_t * indx);
const char * mailimap_month_get_token_str(size_t indx);
const char * mailimap_month_get_token_str(int indx);
int mailimap_flag_get_token_value(mailstream * fd, MMAPString * buffer,
size_t * indx);
const char * mailimap_flag_get_token_str(size_t indx);
const char * mailimap_flag_get_token_str(int indx);
int mailimap_encoding_get_token_value(mailstream * fd, MMAPString * buffer,
size_t * indx);


+ 4
- 4
src/low-level/imap/mailimap_oauth2.c View File

@ -134,9 +134,9 @@ int mailimap_oauth2_authenticate_send(mailimap * session,
char * ptr;
char * full_auth_string;
char * full_auth_string_b64;
int auth_user_len;
int access_token_len;
int full_auth_string_len;
size_t auth_user_len;
size_t access_token_len;
size_t full_auth_string_len;
int res;
full_auth_string = NULL;
@ -159,7 +159,7 @@ int mailimap_oauth2_authenticate_send(mailimap * session,
ptr = memcpy(ptr + access_token_len, "\1\1\0", 3);
/* Convert to base64 */
full_auth_string_b64 = encode_base64(full_auth_string, full_auth_string_len);
full_auth_string_b64 = encode_base64(full_auth_string, (int) full_auth_string_len);
if (full_auth_string_b64 == NULL) {
res = MAILIMAP_ERROR_MEMORY;
goto free;


+ 9
- 9
src/low-level/imap/mailimap_sender.c View File

@ -182,7 +182,7 @@ static int mailimap_astring_literalplus_send(mailstream * fd, const char * astri
int literalplus_enabled);
static int
mailimap_literalplus_count_send(mailstream * fd, uint32_t count);
mailimap_literalplus_count_send(mailstream * fd, size_t count);
@ -417,7 +417,7 @@ static int is_atom(const char * str)
static int mailimap_literalplus_send(mailstream * fd, const char * literal)
{
size_t len;
uint32_t literal_len;
size_t literal_len;
int r;
len = strlen(literal);
@ -1544,7 +1544,7 @@ mailimap_literal_send(mailstream * fd, const char * literal,
progress_function * progr_fun)
{
size_t len;
uint32_t literal_len;
size_t literal_len;
int r;
len = strlen(literal);
@ -1564,7 +1564,7 @@ mailimap_literal_send(mailstream * fd, const char * literal,
"{" number "}" CRLF
*/
static int literal_count_send(mailstream * fd, uint32_t count, int literalplus_enabled)
static int literal_count_send(mailstream * fd, size_t count, int literalplus_enabled)
{
int r;
@ -1572,7 +1572,7 @@ static int literal_count_send(mailstream * fd, uint32_t count, int literalplus_e
if (r != MAILIMAP_NO_ERROR)
return r;
r = mailimap_number_send(fd, count);
r = mailimap_number_send(fd, (uint32_t) count);
if (r != MAILIMAP_NO_ERROR)
return r;
@ -1594,13 +1594,13 @@ static int literal_count_send(mailstream * fd, uint32_t count, int literalplus_e
}
int
mailimap_literal_count_send(mailstream * fd, uint32_t count)
mailimap_literal_count_send(mailstream * fd, size_t count)
{
return literal_count_send(fd, count, 0);
}
static int
mailimap_literalplus_count_send(mailstream * fd, uint32_t count)
mailimap_literalplus_count_send(mailstream * fd, size_t count)
{
return literal_count_send(fd, count, 1);
}
@ -1610,7 +1610,7 @@ mailimap_literalplus_count_send(mailstream * fd, uint32_t count)
*/
int
mailimap_literal_data_send(mailstream * fd, const char * literal, uint32_t len,
mailimap_literal_data_send(mailstream * fd, const char * literal, size_t len,
size_t progr_rate,
progress_function * progr_fun)
{
@ -1618,7 +1618,7 @@ mailimap_literal_data_send(mailstream * fd, const char * literal, uint32_t len,
}
int
mailimap_literal_data_send_with_context(mailstream * fd, const char * literal, uint32_t len,
mailimap_literal_data_send_with_context(mailstream * fd, const char * literal, size_t len,
mailprogress_function * progr_fun,
void * context)
{


+ 3
- 3
src/low-level/imap/mailimap_sender.h View File

@ -165,15 +165,15 @@ mailimap_literal_send(mailstream * fd, const char * literal,
progress_function * progr_fun);
int
mailimap_literal_count_send(mailstream * fd, uint32_t count);
mailimap_literal_count_send(mailstream * fd, size_t count);
int
mailimap_literal_data_send(mailstream * fd, const char * literal, uint32_t len,
mailimap_literal_data_send(mailstream * fd, const char * literal, size_t len,
size_t progr_rate,
progress_function * progr_fun);
int
mailimap_literal_data_send_with_context(mailstream * fd, const char * literal, uint32_t len,
mailimap_literal_data_send_with_context(mailstream * fd, const char * literal, size_t len,
mailprogress_function * progr_fun,
void * context);


+ 1
- 1
src/low-level/imap/uidplus.c View File

@ -252,7 +252,7 @@ int mailimap_uidplus_append(mailimap * session, const char * mailbox,
LIBETPAN_EXPORT
int mailimap_uidplus_append_simple(mailimap * session, const char * mailbox,
const char * content, uint32_t size,
const char * content, size_t size,
uint32_t * uidvalidity_result,
uint32_t * uid_result)
{


+ 1
- 1
src/low-level/imap/uidplus.h View File

@ -70,7 +70,7 @@ int mailimap_uidplus_append(mailimap * session, const char * mailbox,
LIBETPAN_EXPORT
int mailimap_uidplus_append_simple(mailimap * session, const char * mailbox,
const char * content, uint32_t size,
const char * content, size_t size,
uint32_t * uidvalidity_result,
uint32_t * uid_result);


+ 1
- 1
src/low-level/imf/mailimf_types_helper.c View File

@ -1306,7 +1306,7 @@ struct mailimf_date_time * mailimf_get_date(time_t t)
if (localtime_r(&t, &lt) == NULL)
return NULL;
off = (mail_mkgmtime(&lt) - mail_mkgmtime(&gmt)) * 100 / (60 * 60);
off = (int) ((mail_mkgmtime(&lt) - mail_mkgmtime(&gmt)) * 100 / (60 * 60));
date_time = mailimf_date_time_new(lt.tm_mday, lt.tm_mon + 1, lt.tm_year + 1900,
lt.tm_hour, lt.tm_min, lt.tm_sec,


+ 1
- 1
src/low-level/imf/mailimf_write_file.c View File

@ -42,7 +42,7 @@ static int do_write(void * data, const char * str, size_t length)
f = data;
return fwrite(str, 1, length, f);
return (int) fwrite(str, 1, length, f);
}
LIBETPAN_EXPORT


+ 1
- 1
src/low-level/imf/mailimf_write_mem.c View File

@ -45,7 +45,7 @@ static int do_write(void * data, const char * str, size_t length)
if (mmap_string_append_len(f, str, length) == NULL)
return 0;
else
return length;
return (int) length;
}
int mailimf_string_write_mem(MMAPString * f, int * col,


+ 5
- 5
src/low-level/maildir/maildir.c View File

@ -280,7 +280,7 @@ static void maildir_flush(struct maildir * md, int new_msg)
chashdatum key;
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
chash_delete(md->mdir_msg_hash, &key, NULL);
carray_delete(md->mdir_msg_list, i);
@ -315,7 +315,7 @@ static int add_message(struct maildir * md,
}
key.data = msg->msg_uid;
key.len = strlen(msg->msg_uid);
key.len = (unsigned int) strlen(msg->msg_uid);
value.data = msg;
value.len = 0;
@ -654,7 +654,7 @@ char * maildir_message_get(struct maildir * md, const char * uid)
int r;
key.data = (void *) uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0)
return NULL;
@ -686,7 +686,7 @@ int maildir_message_remove(struct maildir * md, const char * uid)
int res;
key.data = (void *) uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0) {
res = MAILDIR_ERROR_NOT_FOUND;
@ -730,7 +730,7 @@ int maildir_message_change_flags(struct maildir * md,
char * dup_filename;
key.data = (void *) uid;
key.len = strlen(uid);
key.len = (unsigned int) strlen(uid);
r = chash_get(md->mdir_msg_hash, &key, &value);
if (r < 0) {
res = MAILDIR_ERROR_NOT_FOUND;


+ 1
- 1
src/low-level/mbox/mailmbox.c View File

@ -1165,10 +1165,10 @@ static int mailmbox_expunge_to_file_no_lock(char * dest_filename, int dest_fd,
{
int r;
int res;
unsigned long i;
size_t cur_offset;
char * dest;
size_t size;
int i;
size = 0;
for(i = 0 ; i < carray_count(folder->mb_tab) ; i ++) {


+ 2
- 2
src/low-level/mbox/mailmbox_parse.c View File

@ -73,7 +73,7 @@ mailmbox_fields_parse(char * str, size_t length,
size_t cur_token;
int r;
size_t hlen;
size_t uid;
uint32_t uid;
int end;
cur_token = * indx;
@ -96,7 +96,7 @@ mailmbox_fields_parse(char * str, size_t length,
while (str[begin] == ' ')
begin ++;
uid = strtoul(str + begin, NULL, 10);
uid = (uint32_t) strtoul(str + begin, NULL, 10);
}
}


+ 7
- 7
src/low-level/mh/mailmh.c View File

@ -253,7 +253,7 @@ struct mailmh_folder * mailmh_folder_find(struct mailmh_folder * root,
}
else {
key.data = pathname;
key.len = strlen(pathname);
key.len = (unsigned int) strlen(pathname);
r = chash_get(root->fl_subfolders_hash, &key, &data);
if (r < 0)
return NULL;
@ -327,7 +327,7 @@ int mailmh_folder_update(struct mailmh_folder * folder)
continue;
if (S_ISREG(buf.st_mode)) {
indx = strtoul(ent->d_name, NULL, 10);
indx = (uint32_t) strtoul(ent->d_name, NULL, 10);
if (indx != 0) {
struct mailmh_msg_info * msg_info;
unsigned int array_index;
@ -379,7 +379,7 @@ int mailmh_folder_update(struct mailmh_folder * folder)
}
key.data = ent->d_name;
key.len = strlen(ent->d_name);
key.len = (unsigned int) strlen(ent->d_name);
r = chash_get(folder->fl_subfolders_hash, &key, &data);
if (r < 0) {
subfolder = mailmh_folder_new(folder, ent->d_name);
@ -397,7 +397,7 @@ int mailmh_folder_update(struct mailmh_folder * folder)
subfolder->fl_array_index = array_index;
key.data = subfolder->fl_filename;
key.len = strlen(subfolder->fl_filename);
key.len = (unsigned int) strlen(subfolder->fl_filename);
data.data = subfolder;
data.len = 0;
r = chash_set(folder->fl_subfolders_hash, &key, &data, NULL);
@ -482,7 +482,7 @@ int mailmh_folder_add_subfolder(struct mailmh_folder * parent,
folder->fl_array_index = array_index;
key.data = folder->fl_filename;
key.len = strlen(folder->fl_filename);
key.len = (unsigned int) strlen(folder->fl_filename);
data.data = folder;
data.len = 0;
@ -506,7 +506,7 @@ int mailmh_folder_remove_subfolder(struct mailmh_folder * folder)
parent = folder->fl_parent;
key.data = folder->fl_filename;
key.len = strlen(folder->fl_filename);
key.len = (unsigned int) strlen(folder->fl_filename);
r = chash_get(parent->fl_subfolders_hash, &key, &data);
if (r < 0)
@ -637,7 +637,7 @@ int mailmh_folder_get_message_filename(struct mailmh_folder * folder,
uint32_t indx, char ** result)
{
char * filename;
int len;
size_t len;
len = strlen(folder->fl_filename) + 20;
filename = malloc(len);


+ 1
- 1
src/low-level/mime/mailmime_content.c View File

@ -1171,7 +1171,7 @@ char * mailmime_extract_boundary(struct mailmime_content * content_type)
/* XXX - this should be unquoted properly, should use
mailimf_quoted_string_parse() */
if (boundary != NULL) {
int len;
size_t len;
char * new_boundary;
len = strlen(boundary);


+ 1
- 1
src/low-level/mime/mailmime_write_file.c View File

@ -62,7 +62,7 @@ static int do_write(void * data, const char * str, size_t length)
f = data;
return fwrite(str, 1, length, f);
return (int) fwrite(str, 1, length, f);
}


+ 9
- 9
src/low-level/nntp/newsnntp.c View File

@ -522,7 +522,7 @@ void newsnntp_list_free(clist * l)
/* ******************** POST ******************************** */
static void send_data(newsnntp * f, const char * message, uint32_t size)
static void send_data(newsnntp * f, const char * message, size_t size)
{
mailstream_send_data(f->nntp_stream, message, size,
f->nntp_progr_rate, f->nntp_progr_fun);
@ -1817,7 +1817,7 @@ static int parse_response(newsnntp * f, char * response)
{
int code;
code = strtol(response, &response, 10);
code = (int) strtol(response, &response, 10);
if (response == NULL) {
f->nntp_response = NULL;
@ -1866,15 +1866,15 @@ static int parse_group_info(char * response,
line = response;