Browse code

- warning message fixed (integer overflow) - added set_msg_id_val

Andrei Pelinescu-Onciul authored on 10/12/2005 15:48:39
Showing 2 changed files
... ...
@@ -402,10 +402,11 @@ inline static void adjust_ticks()
402 402
 			delta=(s_ticks_t)(diff_time_ticks-diff_ticks_raw);
403 403
 			if (delta<-1){
404 404
 				LOG(L_WARN, "WARNING: our timer runs faster then real-time"
405
-						" (%u ms / %u ticks our time .->"
406
-						 " %ld ms / %u ticks real time)\n", 
407
-						diff_ticks_raw*1000/TIMER_TICKS_HZ, diff_ticks_raw,
408
-						(long)(diff_time/1000), diff_time_ticks);
405
+						" (%lu ms / %u ticks our time .->"
406
+						 " %lu ms / %u ticks real time)\n", 
407
+						(unsigned long)(diff_ticks_raw*1000L/TIMER_TICKS_HZ),
408
+						diff_ticks_raw,
409
+						(unsigned long)(diff_time/1000), diff_time_ticks);
409 410
 				last_time=crt_time;
410 411
 				last_ticks=*ticks;
411 412
 			}else{
... ...
@@ -107,6 +107,12 @@ struct msgid_var{
107 107
 #define get_msgid_val(var, id, type)\
108 108
 	(type)((type)((var).msgid!=(id))-1)&((var).u.type##_val)
109 109
 
110
+#define set_msgid_val(var, id, type, value)\
111
+	do{\
112
+		(var).msgid=(id); \
113
+		(var).u.type##_val=(value); \
114
+	}while(0)
115
+
110 116
 /* char to hex conversion table */
111 117
 static char fourbits2char[16] = { '0', '1', '2', '3', '4', '5',
112 118
 	'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };