summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f62854)
raw | patch | inline | side by side (parent: 4f62854)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 13 Sep 2009 12:45:58 +0000 (14:45 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 13 Sep 2009 12:45:58 +0000 (14:45 +0200) |
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 --
-- 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 | patch | blob | history |
diff --git a/src/target_scale.c b/src/target_scale.c
index 5c5e9aac330ee9be2038c8ba886bfe257b3c5ced..6b261c7cb84e12c06e1d1c799cd35f5edabaad6e 100644 (file)
--- a/src/target_scale.c
+++ b/src/target_scale.c
/* 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 */
{