From 6701199be8c0afa6160f3a3b3ddab36ff8916d95 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 13 Sep 2009 14:45:58 +0200 Subject: [PATCH] scale target: Fix C90 warning (which is upgraded to an error by default). Should fix this warning: -- 8< -- target_scale.c: In function 'ts_invoke_counter': target_scale.c:90: warning: this decimal constant is unsigned only in ISO C90 target_scale.c:91: warning: this decimal constant is unsigned only in ISO C90 target_scale.c:93: warning: integer constant is too large for 'unsigned long' type -- >8 -- --- src/target_scale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target_scale.c b/src/target_scale.c index 5c5e9aac..6b261c7c 100644 --- a/src/target_scale.c +++ b/src/target_scale.c @@ -87,10 +87,10 @@ static int ts_invoke_counter (const data_set_t *ds, value_list_t *vl, /* {{{ */ /* Calcualte the rate */ if (prev_counter > curr_counter) /* => counter overflow */ { - if (prev_counter <= 4294967295) /* 32 bit overflow */ - difference = (4294967295 - prev_counter) + curr_counter; + if (prev_counter <= 4294967295UL) /* 32 bit overflow */ + difference = (4294967295UL - prev_counter) + curr_counter; else /* 64 bit overflow */ - difference = (18446744073709551615U - prev_counter) + curr_counter; + difference = (18446744073709551615ULL - prev_counter) + curr_counter; } else /* no overflow */ { -- 2.30.2