changeset 29325:6b0c4667c4fb

Let's just do this mod on the fly instead of changing the variable
author Mark Doliner <mark@kingant.net>
date Tue, 02 Feb 2010 23:24:20 +0000
parents da49e136fb34
children 89bece95a522
files libpurple/protocols/oscar/family_oservice.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_oservice.c	Tue Feb 02 23:18:09 2010 +0000
+++ b/libpurple/protocols/oscar/family_oservice.c	Tue Feb 02 23:24:20 2010 +0000
@@ -342,8 +342,7 @@
 		}
 
 		rateclass->last.tv_sec = now.tv_sec - delta / 1000;
-		delta %= 1000;
-		rateclass->last.tv_usec = now.tv_usec - delta * 1000;
+		rateclass->last.tv_usec = now.tv_usec - (delta % 1000) * 1000;
 
 		rateclass->members = g_hash_table_new(g_direct_hash, g_direct_equal);
 		conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass);
@@ -485,8 +484,7 @@
 	}
 
 	rateclass->last.tv_sec = now.tv_sec - delta / 1000;
-	delta %= 1000;
-	rateclass->last.tv_usec = now.tv_usec - delta * 1000;
+	rateclass->last.tv_usec = now.tv_usec - (delta % 1000) * 1000;
 
 	purple_debug_misc("oscar", "rate %s (param ID 0x%04hx): curavg = %u, "
 			"maxavg = %u, alert at %u, clear warning at %u, limit at %u, "