From: Timo Sirainen Date: Sun, 27 Sep 2015 17:46:29 +0000 (+0300) Subject: Fixed compiler warnings in some systems. X-Git-Tag: 2.2.19.rc2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a326f9da3c18a4ccfb28e72f87161eaf3624eaf2;p=thirdparty%2Fdovecot%2Fcore.git Fixed compiler warnings in some systems. major() and minor() are unsigned ints nowadays, but in Solaris it's major_t. Cast them explicitly to avoid compiler warnings, and use unsigned longs instead of unsigned ints just in case. --- diff --git a/src/imap-hibernate/imap-client.c b/src/imap-hibernate/imap-client.c index e44d12e861..8c3e04c7bc 100644 --- a/src/imap-hibernate/imap-client.c +++ b/src/imap-hibernate/imap-client.c @@ -118,8 +118,9 @@ imap_client_move_back_send_callback(void *context, struct ostream *output) str_append_tabescaped(str, state->userdb_fields); } if (major(state->peer_dev) != 0 || minor(state->peer_dev) != 0) { - str_printfa(str, "\tpeer_dev_major=%u\tpeer_dev_minor=%u", - major(state->peer_dev), minor(state->peer_dev)); + str_printfa(str, "\tpeer_dev_major=%lu\tpeer_dev_minor=%lu", + (unsigned long)major(state->peer_dev), + (unsigned long)minor(state->peer_dev)); } if (state->peer_ino != 0) str_printfa(str, "\tpeer_ino=%llu", (unsigned long long)state->peer_ino); diff --git a/src/imap/imap-client-hibernate.c b/src/imap/imap-client-hibernate.c index 00b579bfcf..23ba2553d7 100644 --- a/src/imap/imap-client-hibernate.c +++ b/src/imap/imap-client-hibernate.c @@ -51,8 +51,9 @@ static void imap_hibernate_write_cmd(struct client *client, string_t *cmd, str_printfa(cmd, "\tidle_notify_interval=%u", client->set->imap_idle_notify_interval); if (fstat(client->fd_in, &peer_st) == 0) { - str_printfa(cmd, "\tpeer_dev_major=%u\tpeer_dev_minor=%u\tpeer_ino=%llu", - major(peer_st.st_dev), minor(peer_st.st_dev), + str_printfa(cmd, "\tpeer_dev_major=%lu\tpeer_dev_minor=%lu\tpeer_ino=%llu", + (unsigned long)major(peer_st.st_dev), + (unsigned long)minor(peer_st.st_dev), (unsigned long long)peer_st.st_ino); } diff --git a/src/imap/imap-master-client.c b/src/imap/imap-master-client.c index c291267aea..c13c55c050 100644 --- a/src/imap/imap-master-client.c +++ b/src/imap/imap-master-client.c @@ -165,11 +165,12 @@ static int imap_master_client_verify(const struct imap_master_input *master_inpu if (peer_st.st_ino != master_input->peer_ino || !CMP_DEV_T(peer_st.st_dev, master_input->peer_dev)) { *error_r = t_strdup_printf( - "BUG: Expected peer device=%u,%u inode=%s doesn't match " - "client fd's actual device=%u,%u inode=%s", - major(peer_st.st_dev), minor(peer_st.st_dev), dec2str(peer_st.st_ino), - major(master_input->peer_dev), - minor(master_input->peer_dev), + "BUG: Expected peer device=%lu,%lu inode=%s doesn't match " + "client fd's actual device=%lu,%lu inode=%s", + (unsigned long)major(peer_st.st_dev), + (unsigned long)minor(peer_st.st_dev), dec2str(peer_st.st_ino), + (unsigned long)major(master_input->peer_dev), + (unsigned long)minor(master_input->peer_dev), dec2str(master_input->peer_ino)); return -1; }