]> Pileus Git - ~andy/fetchmail/commitdiff
C++ compat: cast types explicitly.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 12 Dec 2010 17:33:40 +0000 (18:33 +0100)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 12 Dec 2010 17:33:40 +0000 (18:33 +0100)
uid.c
uid_db.c

diff --git a/uid.c b/uid.c
index 937fba37dcdb21565737da8c7ec3ae2bfc0942d3..b69e662d52a410f76afbe08a97419a2e66e9033d 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -320,7 +320,7 @@ static int dump_uid_db_record(struct uid_db_record *rec, void *arg)
        unsigned *n_recs;
        char *t;
 
-       n_recs = arg;
+       n_recs = (unsigned int *)arg;
        --*n_recs;
 
        t = sdump(rec->id, rec->id_len);
@@ -435,7 +435,7 @@ static int write_uid_db_record(struct uid_db_record *rec, void *arg)
     if (!(rec->status == UID_SEEN || rec->status == UID_DELETED))
        return 0;
 
-    info = arg;
+    info = (struct write_saved_info *)arg;
     rc = fprintf(info->fp, "%s@%s %s\n",
                 info->ctl->remotename, info->ctl->server.queryname,
                 rec->id);
index 9648e01a11ae21916103ce6e4aca2290e01677de..d9315892e662b1b527d0d8b38ca47805cb53febe 100644 (file)
--- a/uid_db.c
+++ b/uid_db.c
@@ -173,7 +173,7 @@ static struct pat_node *get_pat_node(struct uid_db_record *rec)
     */
     struct pat_node *np;
 
-    np = xmalloc(sizeof(*np));
+    np = (struct pat_node *)xmalloc(sizeof(*np));
     np->rec = rec;
     rec->next = NULL;
     return np;
@@ -290,10 +290,10 @@ static struct uid_db_record *get_uid_db_record(char const *id, unsigned status)
     struct uid_db_record *rec;
     size_t id_len;
 
-    rec = xmalloc(sizeof(*rec));
+    rec = (struct uid_db_record *)xmalloc(sizeof(*rec));
 
     id_len = strlen(id);
-    rec->id = memcpy(xmalloc(id_len + 1), id, id_len + 1);
+    rec->id = (char *)memcpy(xmalloc(id_len + 1), id, id_len + 1);
     rec->id_len = id_len;
     rec->status = status;
     rec->num = 0;
@@ -317,7 +317,7 @@ static void insert_into_records(struct uid_db *db,
 
     if (next == db->records_max) {
        want = db->records_max *= 2;
-       db->records = xrealloc(db->records, want * sizeof(rec));
+       db->records = (struct uid_db_record **)xrealloc(db->records, want * sizeof(rec));
     }
 
     rec->pos = next;
@@ -364,7 +364,7 @@ void set_uid_db_num(struct uid_db *db, struct uid_db_record *rec,
        want = num_ndx->pos_0_value - num + 1;
        num_ndx->end_value = num;
 
-       num_ndx->records = xrealloc(num_ndx->records, want * sizeof(rec));
+       num_ndx->records = (struct uid_db_record **)xrealloc(num_ndx->records, want * sizeof(rec));
        do num_ndx->records[--want] = NULL; while (want > have);
     }
 
@@ -541,7 +541,7 @@ void init_uid_db(struct uid_db *db)
 
     db->pat_root = NULL;
 
-    db->records = xmalloc(MIN_RECORDS * sizeof(*db->records));
+    db->records = (struct uid_db_record **)xmalloc(MIN_RECORDS * sizeof(*db->records));
     db->records_max = MIN_RECORDS;
     db->records_next = 0;