aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2010-12-12 18:33:40 +0100
committerMatthias Andree <matthias.andree@gmx.de>2016-12-11 22:05:58 +0100
commit27564aac2eb2c1ab7b25bffad45647188d23e2fa (patch)
tree432debde5fc01d262fbdada9be8a2ae44411e285
parentcdbac47f9d811eb077c405ceecc6f84a0f8504af (diff)
downloadfetchmail-27564aac2eb2c1ab7b25bffad45647188d23e2fa.tar.gz
fetchmail-27564aac2eb2c1ab7b25bffad45647188d23e2fa.tar.bz2
fetchmail-27564aac2eb2c1ab7b25bffad45647188d23e2fa.zip
C++ compat: cast types explicitly.
-rw-r--r--uid.c4
-rw-r--r--uid_db.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/uid.c b/uid.c
index b7beedf4..14757d44 100644
--- a/uid.c
+++ b/uid.c
@@ -324,7 +324,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);
@@ -439,7 +439,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);
diff --git a/uid_db.c b/uid_db.c
index 9648e01a..d9315892 100644
--- 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;