*/
static int compare_uid(const void *a, const void *b)
{
- struct Email **ea = (struct Email **) a;
- struct Email **eb = (struct Email **) b;
- return imap_edata_get(*ea)->uid - imap_edata_get(*eb)->uid;
+ const struct Email *ea = *(struct Email const *const *) a;
+ const struct Email *eb = *(struct Email const *const *) b;
+ return imap_edata_get((struct Email *) ea)->uid -
+ imap_edata_get((struct Email *) eb)->uid;
}
/**
*/
int nntp_compare_order(const void *a, const void *b)
{
- struct Email **ea = (struct Email **) a;
- struct Email **eb = (struct Email **) b;
+ const struct Email *ea = *(struct Email const *const *) a;
+ const struct Email *eb = *(struct Email const *const *) b;
- anum_t na = nntp_edata_get(*ea)->article_num;
- anum_t nb = nntp_edata_get(*eb)->article_num;
+ anum_t na = nntp_edata_get((struct Email *) ea)->article_num;
+ anum_t nb = nntp_edata_get((struct Email *) eb)->article_num;
int result = (na == nb) ? 0 : (na > nb) ? 1 : -1;
result = perform_auxsort(result, a, b);
return SORT_CODE(result);