dovecot-2.2: Fixed compiler warnings in some systems.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Sep 27 17:48:49 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/ca0916045005
changeset: 19223:ca0916045005
user: Timo Sirainen <tss at iki.fi>
date: Sun Sep 27 20:46:29 2015 +0300
description:
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.
diffstat:
src/imap-hibernate/imap-client.c | 5 +++--
src/imap/imap-client-hibernate.c | 5 +++--
src/imap/imap-master-client.c | 11 ++++++-----
3 files changed, 12 insertions(+), 9 deletions(-)
diffs (51 lines):
diff -r e97a8dd8d2b6 -r ca0916045005 src/imap-hibernate/imap-client.c
--- a/src/imap-hibernate/imap-client.c Sun Sep 27 19:03:31 2015 +0300
+++ b/src/imap-hibernate/imap-client.c Sun Sep 27 20:46:29 2015 +0300
@@ -118,8 +118,9 @@
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 -r e97a8dd8d2b6 -r ca0916045005 src/imap/imap-client-hibernate.c
--- a/src/imap/imap-client-hibernate.c Sun Sep 27 19:03:31 2015 +0300
+++ b/src/imap/imap-client-hibernate.c Sun Sep 27 20:46:29 2015 +0300
@@ -51,8 +51,9 @@
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 -r e97a8dd8d2b6 -r ca0916045005 src/imap/imap-master-client.c
--- a/src/imap/imap-master-client.c Sun Sep 27 19:03:31 2015 +0300
+++ b/src/imap/imap-master-client.c Sun Sep 27 20:46:29 2015 +0300
@@ -165,11 +165,12 @@
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;
}
More information about the dovecot-cvs
mailing list