aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog72
-rw-r--r--camel/camel-block-file.c12
-rw-r--r--camel/camel-data-cache.c2
-rw-r--r--camel/camel-folder-search.c4
-rw-r--r--camel/camel-folder-summary.c5
-rw-r--r--camel/camel-html-parser.c4
-rw-r--r--camel/camel-http-stream.c3
-rw-r--r--camel/camel-mime-message.c4
-rw-r--r--camel/camel-mime-parser.c14
-rw-r--r--camel/camel-mime-parser.h2
-rw-r--r--camel/camel-mime-part-utils.c3
-rw-r--r--camel/camel-mime-part.c2
-rw-r--r--camel/camel-multipart-signed.c2
-rw-r--r--camel/camel-multipart.c2
-rw-r--r--camel/camel-seekable-substream.c16
-rw-r--r--camel/camel-session.c6
-rw-r--r--camel/camel-stream-filter.c6
-rw-r--r--camel/camel-text-index.c20
-rw-r--r--camel/camel-vee-folder.c14
-rw-r--r--camel/providers/imap/camel-imap-search.c4
-rw-r--r--camel/providers/imap/camel-imap-utils.c4
-rw-r--r--camel/providers/local/camel-mbox-summary.c4
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c4
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c2
24 files changed, 143 insertions, 68 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 9beaa50dfa..f668b1abbe 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,75 @@
+2003-05-16 Jeremy Katz <katzj@redhat.com>
+
+ * providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf
+ is initialized to avoid compiler warning.
+
+ * providers/local/camel-mbox-summary.c (summary_header_load): Cast
+ folder_size to uint32 to fix warning.
+ (camel_mbox_summary_sync_mbox): Update for new API.
+
+ * providers/imap/camel-imap-utils.c (parse_params):
+ imap_parse_nstring expects size_t, not int
+ (imap_body_decode): Likewise.
+
+ * camel-stream-filter.c (do_read): presize needs to be size_t
+ instead of int.
+ (do_write): Likewise.
+
+ * camel-seekable-substream.c (stream_read): Return ssize_t instead
+ of int to match prototypes.
+ (stream_write): Likewise.
+
+ * camel-mime-part.c (construct_from_parser): len needs to be
+ size_t instead of int.
+
+ * camel-mime-parser.c (folder_scan_step): datalength needs to be a
+ size_t* instead of an int* to make dependent APIs safe.
+ (camel_mime_parser_step): Likewise.
+ (folder_scan_content): Likewise.
+ * camel-mime-parser.h: Likewise.
+
+ * camel-mime-message.c (camel_mime_message_class_init): Use glib
+ macro for pointer/int conversions.
+ (construct_from_parser): Update for new API.
+
+ * camel-folder-summary.c
+ (camel_folder_summary_info_new_from_parser): Update len to be
+ size_t for new API.
+ (summary_build_content_info): Likewise.
+ * camel-http-stream.c (http_get_headers): Likewise.
+ * camel-mime-part-utils.c
+ (simple_data_wrapper_construct_from_parser): Likewise.
+ * camel-multipart-signed.c (signed_construct_from_parser): Likewise.
+ * camel-multipart.c (construct_from_parser): Likewise.
+
+ * camel-folder-search.c (match_words_index): Use glib macros for
+ pointer/int conversions.
+ * camel-html-parser.c (tokenise_setup): Likewise.
+ (convert_entity): Likewise.
+ * camel-block-file.c (block_hash_func): Likewise.
+ (camel_block_file_get_block): Likewise.
+ (camel_block_file_get_block): Likewise.
+ (camel_block_file_detach_block): Likewise.
+ * camel-session.c (session_thread_msg_new): Likewise.
+ (session_thread_msg_free): Likewise.
+ (session_thread_wait): Likewise.
+ * camel-text-index.c (text_index_compress_nosync): Likewise.
+ (text_index_compress_nosync): Likewise.
+ (camel_text_index_validate): Likewise.
+ * camel-vee-folder.c (vee_folder_remove_folder): Likewise.
+ (unmatched_check_uid): Likewise.
+ (folder_added_uid): Likewise.
+ (vee_folder_build_folder): Likewise.
+ (folder_changed_add_uid): Likewise.
+ (folder_changed_remove_uid): Likewise.
+ * providers/imap/camel-imap-search.c (imap_body_contains): Likewise.
+ * providers/pop3/camel-pop3-folder.c (cmd_list): Likewise.
+ (cmd_uidl): Likewise.
+
+ * camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc.
+ Fixes a warning.
+
+
2003-05-15 Not Zed <NotZed@Ximian.com>
* camel-mime-utils.c (header_decode_word): Simplistic quick-fix
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
index 9f0101c892..885ebc34f5 100644
--- a/camel/camel-block-file.c
+++ b/camel/camel-block-file.c
@@ -162,7 +162,7 @@ camel_block_file_class_init(CamelBlockFileClass *klass)
static guint
block_hash_func(const void *v)
{
- return ((camel_block_t)v) >> CAMEL_BLOCK_SIZE_BITS;
+ return ((camel_block_t) GPOINTER_TO_UINT(v)) >> CAMEL_BLOCK_SIZE_BITS;
}
static void
@@ -560,7 +560,7 @@ CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
- bl = g_hash_table_lookup(bs->blocks, (void *)id);
+ bl = g_hash_table_lookup(bs->blocks, GUINT_TO_POINTER(id));
d(printf("Get block %08x: %s\n", id, bl?"cached":"must read"));
@@ -582,7 +582,7 @@ CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
}
bs->block_cache_count++;
- g_hash_table_insert(bs->blocks, (void *)bl->id, bl);
+ g_hash_table_insert(bs->blocks, GUINT_TO_POINTER(bl->id), bl);
/* flush old blocks */
flush = (CamelBlock *)bs->block_cache.tailpred;
@@ -590,7 +590,7 @@ CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
while (bs->block_cache_count > bs->block_cache_limit && prev) {
if (flush->refcount == 0) {
if (sync_block_nolock(bs, flush) != -1) {
- g_hash_table_remove(bs->blocks, (void *)flush->id);
+ g_hash_table_remove(bs->blocks, GUINT_TO_POINTER(flush->id));
e_dlist_remove((EDListNode *)flush);
g_free(flush);
bs->block_cache_count--;
@@ -629,7 +629,7 @@ void camel_block_file_detach_block(CamelBlockFile *bs, CamelBlock *bl)
{
CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
- g_hash_table_remove(bs->blocks, (void *)bl->id);
+ g_hash_table_remove(bs->blocks, GUINT_TO_POINTER(bl->id));
e_dlist_remove((EDListNode *)bl);
bl->flags |= CAMEL_BLOCK_DETACHED;
@@ -647,7 +647,7 @@ void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl)
{
CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
- g_hash_table_insert(bs->blocks, (void *)bl->id, bl);
+ g_hash_table_insert(bs->blocks, GUINT_TO_POINTER(bl->id), bl);
e_dlist_addtail(&bs->block_cache, (EDListNode *)bl);
bl->flags &= ~CAMEL_BLOCK_DETACHED;
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index db0a0d5e50..b5e615a112 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -79,7 +79,7 @@ static void data_cache_init(CamelDataCache *cdc, CamelDataCacheClass *klass)
struct _CamelDataCachePrivate *p;
p = cdc->priv = g_malloc0(sizeof(*cdc->priv));
- p->busy_bag = camel_object_bag_new(g_str_hash, g_str_equal, g_strdup, g_free);
+ p->busy_bag = camel_object_bag_new(g_str_hash, g_str_equal, (CamelCopyFunc)g_strdup, g_free);
}
static void data_cache_finalise(CamelDataCache *cdc)
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 00315fafdc..9deac66843 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -811,8 +811,8 @@ match_words_index(CamelFolderSearch *search, struct _camel_search_words *words,
int mask;
const char *uid = camel_message_info_uid(mi);
- mask = ((int)g_hash_table_lookup(ht, uid)) | (1<<i);
- g_hash_table_insert(ht, (char *)uid, (void *)mask);
+ mask = (GPOINTER_TO_INT(g_hash_table_lookup(ht, uid))) | (1<<i);
+ g_hash_table_insert(ht, (char *)uid, GINT_TO_POINTER(mask));
}
}
camel_object_unref((CamelObject *)nc);
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 1552a08ced..ecb90b8d9d 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -905,7 +905,7 @@ CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *
{
CamelMessageInfo *info = NULL;
char *buffer;
- int len;
+ size_t len;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
off_t start;
CamelIndexName *name = NULL;
@@ -1952,7 +1952,8 @@ next_uid_string(CamelFolderSummary *s)
static CamelMessageContentInfo *
summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp)
{
- int state, len;
+ int state;
+ size_t len;
char *buffer;
CamelMessageContentInfo *info = NULL;
struct _header_content_type *ct;
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index 313e40d2af..31c0aee15b 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -469,7 +469,7 @@ static void tokenise_setup(void)
if (entities == NULL) {
entities = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<sizeof(entity_map)/sizeof(entity_map[0]);i++) {
- g_hash_table_insert(entities, (char *)entity_map[i].name, (void *)entity_map[i].val);
+ g_hash_table_insert(entities, (char *)entity_map[i].name, GUINT_TO_POINTER(entity_map[i].val));
}
}
}
@@ -518,7 +518,7 @@ static int convert_entity(const char *e, char *ent)
if (e[0] == '#')
return g_unichar_to_utf8(atoi(e+1), ent);
- val = (unsigned int)g_hash_table_lookup(entities, e);
+ val = GPOINTER_TO_UINT(g_hash_table_lookup(entities, e));
if (ent)
return g_unichar_to_utf8(val, ent);
else
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 5c226cd26c..9d4c62709a 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -254,7 +254,8 @@ http_get_headers (CamelHttpStream *http)
struct _header_raw *headers, *node, *tail;
const char *type;
char *buf;
- int len, err;
+ size_t len;
+ int err;
if (http->parser)
camel_object_unref (CAMEL_OBJECT (http->parser));
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index f3b79b4035..7f14218286 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -103,7 +103,7 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
header_name_table = g_hash_table_new (g_strcase_hash, g_strcase_equal);
for (i=0;header_names[i];i++)
- g_hash_table_insert (header_name_table, header_names[i], (gpointer)i+1);
+ g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
/* virtual method overload */
camel_data_wrapper_class->write_to_stream = write_to_stream;
@@ -449,7 +449,7 @@ static int
construct_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
{
char *buf;
- int len;
+ size_t len;
int state;
int ret;
int err;
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index a9f7704cca..511aa121ca 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -275,13 +275,13 @@ struct _header_scan_filter {
CamelMimeFilter *filter;
};
-static void folder_scan_step(struct _header_scan_state *s, char **databuffer, int *datalength);
+static void folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength);
static void folder_scan_drop_step(struct _header_scan_state *s);
static int folder_scan_init_with_fd(struct _header_scan_state *s, int fd);
static int folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream);
static struct _header_scan_state *folder_scan_init(void);
static void folder_scan_close(struct _header_scan_state *s);
-static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, int *length);
+static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length);
static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, int *lastone);
static int folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
static off_t folder_seek(struct _header_scan_state *s, off_t offset, int whence);
@@ -728,7 +728,7 @@ void camel_mime_parser_drop_step(CamelMimeParser *m)
* is returned.
**/
enum _header_state
-camel_mime_parser_step(CamelMimeParser *m, char **databuffer, int *datalength)
+camel_mime_parser_step(CamelMimeParser *m, char **databuffer, size_t *datalength)
{
struct _header_scan_state *s = _PRIVATE(m);
@@ -736,7 +736,7 @@ camel_mime_parser_step(CamelMimeParser *m, char **databuffer, int *datalength)
if (s->unstep <= 0) {
char *dummy;
- int dummylength;
+ size_t dummylength;
if (databuffer == NULL) {
databuffer = &dummy;
@@ -1358,7 +1358,7 @@ header_done:
}
static struct _header_scan_stack *
-folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, int *length)
+folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length)
{
int atleast = s->atleast, newatleast;
register char *inptr;
@@ -1570,7 +1570,7 @@ folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream)
#define USE_FROM
static void
-folder_scan_step(struct _header_scan_state *s, char **databuffer, int *datalength)
+folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength)
{
struct _header_scan_stack *h, *hb;
const char *content;
@@ -1853,7 +1853,7 @@ int main(int argc, char **argv)
int fd;
struct _header_scan_state *s;
char *data;
- int len;
+ size_t len;
int state;
char *name = "/tmp/evmail/Inbox";
struct _header_scan_stack *h;
diff --git a/camel/camel-mime-parser.h b/camel/camel-mime-parser.h
index 7f784a1065..25571bfb1c 100644
--- a/camel/camel-mime-parser.h
+++ b/camel/camel-mime-parser.h
@@ -103,7 +103,7 @@ void camel_mime_parser_scan_pre_from(CamelMimeParser *, int);
int camel_mime_parser_set_header_regex(CamelMimeParser *m, char *matchstr);
/* normal interface */
-enum _header_state camel_mime_parser_step(CamelMimeParser *, char **, int *);
+enum _header_state camel_mime_parser_step(CamelMimeParser *, char **, size_t *);
void camel_mime_parser_unstep(CamelMimeParser *);
void camel_mime_parser_drop_step(CamelMimeParser *m);
enum _header_state camel_mime_parser_state(CamelMimeParser *);
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index a3a5d390a4..7f55dc7639 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -282,7 +282,8 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser
{
CamelMimeFilter *fdec = NULL, *fcrlf = NULL;
CamelMimeFilterBasicType enctype = 0;
- int len, decid = -1, crlfid = -1;
+ size_t len;
+ int decid = -1, crlfid = -1;
struct _header_content_type *ct;
const char *charset = NULL;
char *encoding, *buf;
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 78cdb9c6b7..f049eb92bb 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -760,7 +760,7 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
struct _header_raw *headers;
const char *content;
char *buf;
- int len;
+ size_t len;
int err;
d(printf("mime_part::construct_from_parser()\n"));
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index a5c4cc3dff..5bce467295 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -431,7 +431,7 @@ signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser
struct _header_content_type *content_type;
CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
char *buf;
- unsigned int len;
+ size_t len;
CamelStream *mem;
/* we *must not* be in multipart state, otherwise the mime parser will
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 84e4ecd5c5..9366bf0e95 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -548,7 +548,7 @@ construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
struct _header_content_type *content_type;
CamelMimePart *bodypart;
char *buf;
- unsigned int len;
+ size_t len;
g_assert(camel_mime_parser_state(mp) == HSCAN_MULTIPART);
diff --git a/camel/camel-seekable-substream.c b/camel/camel-seekable-substream.c
index 42a51d3be1..c4561175df 100644
--- a/camel/camel-seekable-substream.c
+++ b/camel/camel-seekable-substream.c
@@ -32,8 +32,8 @@ static CamelSeekableStreamClass *parent_class = NULL;
/* Returns the class for a CamelSeekableSubStream */
#define CSS_CLASS(so) CAMEL_SEEKABLE_SUBSTREAM_CLASS (CAMEL_OBJECT(so)->klass)
-static int stream_read (CamelStream *stream, char *buffer, unsigned int n);
-static int stream_write (CamelStream *stream, const char *buffer, unsigned int n);
+static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
+static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
static int stream_flush (CamelStream *stream);
static int stream_close (CamelStream *stream);
static gboolean eos (CamelStream *stream);
@@ -142,13 +142,13 @@ parent_reset (CamelSeekableSubstream *seekable_substream, CamelSeekableStream *p
return camel_seekable_stream_seek (parent, seekable_stream->position, CAMEL_STREAM_SET) == seekable_stream->position;
}
-static int
-stream_read (CamelStream *stream, char *buffer, unsigned int n)
+static ssize_t
+stream_read (CamelStream *stream, char *buffer, size_t n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (stream);
- int v;
+ ssize_t v;
if (n == 0)
return 0;
@@ -179,13 +179,13 @@ stream_read (CamelStream *stream, char *buffer, unsigned int n)
return v;
}
-static int
-stream_write (CamelStream *stream, const char *buffer, unsigned int n)
+static ssize_t
+stream_write (CamelStream *stream, const char *buffer, size_t n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM(stream);
CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM(stream);
- int v;
+ ssize_t v;
if (n == 0)
return 0;
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 6d58b4e457..aa81b5672f 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -708,7 +708,7 @@ static void *session_thread_msg_new(CamelSession *session, CamelSessionThreadOps
CAMEL_SESSION_LOCK(session, thread_lock);
m->id = session->priv->thread_id++;
- g_hash_table_insert(session->priv->thread_active, (void *)m->id, m);
+ g_hash_table_insert(session->priv->thread_active, GINT_TO_POINTER(m->id), m);
CAMEL_SESSION_UNLOCK(session, thread_lock);
return m;
@@ -721,7 +721,7 @@ static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg
d(printf("free message %p session %p\n", msg, session));
CAMEL_SESSION_LOCK(session, thread_lock);
- g_hash_table_remove(session->priv->thread_active, (void *)msg->id);
+ g_hash_table_remove(session->priv->thread_active, GINT_TO_POINTER(msg->id));
CAMEL_SESSION_UNLOCK(session, thread_lock);
d(printf("free msg, ops->free = %p\n", msg->ops->free));
@@ -769,7 +769,7 @@ static void session_thread_wait(CamelSession *session, int id)
/* we just busy wait, only other alternative is to setup a reply port? */
do {
CAMEL_SESSION_LOCK(session, thread_lock);
- wait = g_hash_table_lookup(session->priv->thread_active, (void *)id) != NULL;
+ wait = g_hash_table_lookup(session->priv->thread_active, GINT_TO_POINTER(id)) != NULL;
CAMEL_SESSION_UNLOCK(session, thread_lock);
if (wait) {
usleep(20000);
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index e17fcb8377..3d38860ade 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -225,7 +225,7 @@ do_read (CamelStream *stream, char *buffer, size_t n)
g_check(p->realbuffer);
if (p->filteredlen<=0) {
- int presize = READ_PAD;
+ size_t presize = READ_PAD;
size = camel_stream_read(filter->source, p->buffer, READ_SIZE);
if (size <= 0) {
@@ -287,7 +287,7 @@ do_write (CamelStream *stream, const char *buf, size_t n)
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
- int presize;
+ size_t presize;
char *buffer = (char *)buf;
size_t len = n;
@@ -328,7 +328,7 @@ do_flush (CamelStream *stream)
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
char *buffer;
- int presize;
+ size_t presize;
size_t len;
if (p->last_was_read) {
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index dfc85a1f55..57c9bcaeef 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -427,7 +427,7 @@ text_index_compress_nosync(CamelIndex *idx)
goto fail;
rb->names++;
camel_partition_table_add(newp->name_hash, name, newkeyid);
- g_hash_table_insert(remap, (void *)oldkeyid, (void *)newkeyid);
+ g_hash_table_insert(remap, GINT_TO_POINTER(oldkeyid), GINT_TO_POINTER(newkeyid));
} else
io(printf("deleted name '%s'\n", name));
g_free(name);
@@ -453,7 +453,7 @@ text_index_compress_nosync(CamelIndex *idx)
goto fail;
}
for (i=0;i<count;i++) {
- newkeyid = (camel_key_t)g_hash_table_lookup(remap, (void *)records[i]);
+ newkeyid = (camel_key_t)GPOINTER_TO_INT(g_hash_table_lookup(remap, GINT_TO_POINTER(records[i])));
if (newkeyid) {
newrecords[newcount++] = newkeyid;
if (newcount == sizeof(newrecords)/sizeof(newrecords[0])) {
@@ -1275,16 +1275,16 @@ camel_text_index_validate(CamelTextIndex *idx)
keyid = 0;
while ( (keyid = camel_key_table_next(p->name_index, keyid, &word, &flags, &data)) ) {
- if ((oldword = g_hash_table_lookup(names, (void *)keyid)) != NULL
- || (oldword = g_hash_table_lookup(deleted, (void *)keyid)) != NULL) {
+ if ((oldword = g_hash_table_lookup(names, GINT_TO_POINTER(keyid))) != NULL
+ || (oldword = g_hash_table_lookup(deleted, GINT_TO_POINTER(keyid))) != NULL) {
printf("Warning, name '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
g_free(word);
} else {
g_hash_table_insert(name_word, word, (void *)1);
if ((flags & 1) == 0) {
- g_hash_table_insert(names, (void *)keyid, word);
+ g_hash_table_insert(names, GINT_TO_POINTER(keyid), word);
} else {
- g_hash_table_insert(deleted, (void *)keyid, word);
+ g_hash_table_insert(deleted, GINT_TO_POINTER(keyid), word);
}
}
}
@@ -1297,12 +1297,12 @@ camel_text_index_validate(CamelTextIndex *idx)
GHashTable *used;
/* first, check for duplicates of keyid, and data */
- if ((oldword = g_hash_table_lookup(words, (void *)keyid)) != NULL) {
+ if ((oldword = g_hash_table_lookup(words, GINT_TO_POINTER(keyid))) != NULL) {
printf("Warning, word '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
g_free(word);
word = oldword;
} else {
- g_hash_table_insert(words, (void *)keyid, word);
+ g_hash_table_insert(words, GINT_TO_POINTER(keyid), word);
}
if (data == 0) {
@@ -1310,10 +1310,10 @@ camel_text_index_validate(CamelTextIndex *idx)
though it is a problem if its a fresh index */
printf("Word '%s' has no data associated with it\n", word);
} else {
- if ((oldword = g_hash_table_lookup(keys, (void *)data)) != NULL) {
+ if ((oldword = g_hash_table_lookup(keys, GUINT_TO_POINTER(data))) != NULL) {
printf("Warning, word '%s' duplicates data (%x) with name '%s'\n", word, data, oldword);
} else {
- g_hash_table_insert(keys, (void *)data, word);
+ g_hash_table_insert(keys, GUINT_TO_POINTER(data), word);
}
}
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 9422f77e19..a20565f56c 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -955,7 +955,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
g_free(oldkey);
} else {
- g_hash_table_insert(unmatched_uids, oldkey, (void *)(n-1));
+ g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
}
}
} else {
@@ -1009,7 +1009,7 @@ unmatched_check_uid(char *uidin, void *value, struct _update_data *u)
uid = alloca(strlen(uidin)+9);
memcpy(uid, u->hash, 8);
strcpy(uid+8, uidin);
- n = (int)g_hash_table_lookup(unmatched_uids, uid);
+ n = GPOINTER_TO_INT(g_hash_table_lookup(unmatched_uids, uid));
if (n == 0) {
if (vee_folder_add_uid(folder_unmatched, u->source, uidin, u->hash))
camel_folder_change_info_add_uid(folder_unmatched->changes, uid);
@@ -1035,9 +1035,9 @@ folder_added_uid(char *uidin, void *value, struct _update_data *u)
if (!CAMEL_IS_VEE_FOLDER(u->source)) {
if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
- g_hash_table_insert(unmatched_uids, oldkey, (void *)(n+1));
+ g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
- g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(mi)), (void *)1);
+ g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(mi)), GINT_TO_POINTER(1));
}
}
}
@@ -1106,7 +1106,7 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
} else {
- g_hash_table_insert(unmatched_uids, oldkey, (void *)(n-1));
+ g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
}
}
} else {
@@ -1207,7 +1207,7 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
- g_hash_table_insert(unmatched_uids, oldkey, (void *)(n+1));
+ g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
g_hash_table_insert(unmatched_uids, g_strdup(vuid), (void *)1);
}
@@ -1248,7 +1248,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
g_free(oldkey);
} else {
- g_hash_table_insert(unmatched_uids, oldkey, (void *)(n-1));
+ g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
}
} else {
if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 0c8816e10c..8f65def872 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -480,13 +480,13 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
info = s->summary->pdata[i];
uid = (char *)camel_message_info_uid(info);
uidn = strtoul(uid, NULL, 10);
- g_hash_table_insert(uid_hash, (void *)uidn, uid);
+ g_hash_table_insert(uid_hash, GUINT_TO_POINTER(uidn), uid);
}
uidp = (guint32 *)mr->matches->data;
j = mr->matches->len;
for (i=0;i<j && !truth;i++) {
- uid = g_hash_table_lookup(uid_hash, (void *)*uidp++);
+ uid = g_hash_table_lookup(uid_hash, GUINT_TO_POINTER(*uidp++));
if (uid)
g_ptr_array_add(array, uid);
}
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index 61c27cb7a9..91b88a7ec4 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -735,7 +735,7 @@ parse_params (const char **parms_p, CamelContentType *type)
{
const char *parms = *parms_p;
char *name, *value;
- int len;
+ size_t len;
if (!strncasecmp (parms, "nil", 3)) {
*parms_p += 3;
@@ -777,7 +777,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
CamelContentType *ctype = NULL;
char *description = NULL;
char *encoding = NULL;
- unsigned int len;
+ size_t len;
size_t size;
char *p;
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 27c964f946..29eff1c83e 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -172,7 +172,7 @@ summary_header_load(CamelFolderSummary *s, FILE *in)
if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_load(s, in) == -1)
return -1;
- return camel_file_util_decode_uint32(in, &mbs->folder_size);
+ return camel_file_util_decode_uint32(in, (guint32 *) &mbs->folder_size);
}
static int
@@ -796,7 +796,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
int i, count;
CamelMboxMessageInfo *info = NULL;
char *buffer, *xevnew = NULL;
- int len;
+ size_t len;
const char *fromline;
int lastdel = FALSE;
#ifdef STATUS_PINE
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 1aef811e23..50584d228e 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -199,7 +199,7 @@ cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
if ((pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) == 0)
fi->cmd = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_builduid, fi, "TOP %u 0\r\n", id);
g_ptr_array_add(((CamelPOP3Folder *)folder)->uids, fi);
- g_hash_table_insert(((CamelPOP3Folder *)folder)->uids_id, (void *)id, fi);
+ g_hash_table_insert(((CamelPOP3Folder *)folder)->uids_id, GINT_TO_POINTER(id), fi);
}
}
} while (ret>0);
@@ -222,7 +222,7 @@ cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
if (strlen(line) > 1024)
line[1024] = 0;
if (sscanf(line, "%u %s", &id, uid) == 2) {
- fi = g_hash_table_lookup(folder->uids_id, (void *)id);
+ fi = g_hash_table_lookup(folder->uids_id, GINT_TO_POINTER(id));
if (fi) {
camel_operation_progress(NULL, (fi->index+1) * 100 / folder->uids->len);
fi->uid = g_strdup(uid);
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 84948f91eb..c5947dc0ad 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -859,7 +859,7 @@ static gboolean
smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
{
/* say hello to the server */
- char *name, *cmdbuf, *respbuf = NULL;
+ char *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
struct hostent *host;
CamelException err;
const char *token;