dovecot-2.1: stats: Compiler warning fixes.

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 27 00:35:44 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/b36ad0f9b3cf
changeset: 13559:b36ad0f9b3cf
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 27 00:44:03 2011 +0300
description:
stats: Compiler warning fixes.

diffstat:

 src/stats/mail-command.c |  7 +++++--
 src/stats/mail-domain.c  |  7 +++++--
 src/stats/mail-ip.c      |  7 +++++--
 src/stats/mail-session.c |  7 +++++--
 src/stats/mail-user.c    |  7 +++++--
 5 files changed, 25 insertions(+), 10 deletions(-)

diffs (114 lines):

diff -r 4538030286f6 -r b36ad0f9b3cf src/stats/mail-command.c
--- a/src/stats/mail-command.c	Tue Sep 27 00:41:49 2011 +0300
+++ b/src/stats/mail-command.c	Tue Sep 27 00:44:03 2011 +0300
@@ -153,6 +153,8 @@
 
 void mail_commands_free_memory(void)
 {
+	unsigned int diff;
+
 	while (stable_mail_commands != NULL) {
 		struct mail_command *cmd = stable_mail_commands;
 
@@ -168,8 +170,9 @@
 
 		if (global_used_memory < stats_settings->memory_limit)
 			break;
-		if (ioloop_time -
-		    stable_mail_commands->last_update.tv_sec < stats_settings->command_min_time)
+
+		diff = ioloop_time - stable_mail_commands->last_update.tv_sec;
+		if (diff < stats_settings->command_min_time)
 			break;
 	}
 }
diff -r 4538030286f6 -r b36ad0f9b3cf src/stats/mail-domain.c
--- a/src/stats/mail-domain.c	Tue Sep 27 00:41:49 2011 +0300
+++ b/src/stats/mail-domain.c	Tue Sep 27 00:44:03 2011 +0300
@@ -95,13 +95,16 @@
 
 void mail_domains_free_memory(void)
 {
+	unsigned int diff;
+
 	while (mail_domains_head != NULL && mail_domains_head->refcount == 0) {
 		mail_domain_free(mail_domains_head);
 
 		if (global_used_memory < stats_settings->memory_limit)
 			break;
-		if (ioloop_time -
-		    mail_domains_head->last_update.tv_sec < stats_settings->domain_min_time)
+
+		diff = ioloop_time - mail_domains_head->last_update.tv_sec;
+		if (diff < stats_settings->domain_min_time)
 			break;
 	}
 }
diff -r 4538030286f6 -r b36ad0f9b3cf src/stats/mail-ip.c
--- a/src/stats/mail-ip.c	Tue Sep 27 00:41:49 2011 +0300
+++ b/src/stats/mail-ip.c	Tue Sep 27 00:44:03 2011 +0300
@@ -91,13 +91,16 @@
 
 void mail_ips_free_memory(void)
 {
+	unsigned int diff;
+
 	while (mail_ips_head != NULL && mail_ips_head->refcount == 0) {
 		mail_ip_free(mail_ips_head);
 
 		if (global_used_memory < stats_settings->memory_limit)
 			break;
-		if (ioloop_time -
-		    mail_ips_head->last_update.tv_sec < stats_settings->ip_min_time)
+
+		diff = ioloop_time - mail_ips_head->last_update.tv_sec;
+		if (diff < stats_settings->ip_min_time)
 			break;
 	}
 }
diff -r 4538030286f6 -r b36ad0f9b3cf src/stats/mail-session.c
--- a/src/stats/mail-session.c	Tue Sep 27 00:41:49 2011 +0300
+++ b/src/stats/mail-session.c	Tue Sep 27 00:44:03 2011 +0300
@@ -246,6 +246,8 @@
 
 void mail_sessions_free_memory(void)
 {
+	unsigned int diff;
+
 	while (mail_sessions_head != NULL &&
 	       mail_sessions_head->refcount == 0) {
 		i_assert(mail_sessions_head->disconnected);
@@ -253,8 +255,9 @@
 
 		if (global_used_memory < stats_settings->memory_limit)
 			break;
-		if (ioloop_time -
-		    mail_sessions_head->last_update.tv_sec < stats_settings->session_min_time)
+
+		diff = ioloop_time - mail_sessions_head->last_update.tv_sec;
+		if (diff < stats_settings->session_min_time)
 			break;
 	}
 }
diff -r 4538030286f6 -r b36ad0f9b3cf src/stats/mail-user.c
--- a/src/stats/mail-user.c	Tue Sep 27 00:41:49 2011 +0300
+++ b/src/stats/mail-user.c	Tue Sep 27 00:44:03 2011 +0300
@@ -112,13 +112,16 @@
 
 void mail_users_free_memory(void)
 {
+	unsigned int diff;
+
 	while (mail_users_head != NULL && mail_users_head->refcount == 0) {
 		mail_user_free(mail_users_head);
 
 		if (global_used_memory < stats_settings->memory_limit)
 			break;
-		if (ioloop_time -
-		    mail_users_head->last_update.tv_sec < stats_settings->user_min_time)
+
+		diff = ioloop_time - mail_users_head->last_update.tv_sec;
+		if (diff < stats_settings->user_min_time)
 			break;
 	}
 }


More information about the dovecot-cvs mailing list