/**
- * collectd - src/target_set.c
- * Copyright (C) 2008 Florian Forster
+ * collectd - src/target_scale.c
+ * Copyright (C) 2008-2009 Florian Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/* 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 */
{