From: scipio Date: Sun, 5 Aug 2007 22:29:46 +0000 (+0000) Subject: Fix possible size bug on bin count. X-Git-Tag: release_tinyos_2_1_0_0~833 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=f01e13b3b13d85ca5f6682fd1723040996b71204;p=tinyos-2.x.git Fix possible size bug on bin count. --- diff --git a/tos/lib/tossim/sim_noise.h b/tos/lib/tossim/sim_noise.h index 73c9b52c..6c9ddfe1 100644 --- a/tos/lib/tossim/sim_noise.h +++ b/tos/lib/tossim/sim_noise.h @@ -40,12 +40,14 @@ extern "C" { #endif +// BIN_SIZE (the number of bins) has a + 1 in case the range is not +// evenly divisible by INTERVAL -pal 5.aug.07 enum { NOISE_MIN = -115, NOISE_MAX = -5, NOISE_MIN_QUANTIZE = -115, NOISE_QUANTIZE_INTERVAL = 5, - NOISE_BIN_SIZE = (NOISE_MAX - NOISE_MIN)/NOISE_QUANTIZE_INTERVAL, + NOISE_BIN_SIZE = ((NOISE_MAX - NOISE_MIN) / NOISE_QUANTIZE_INTERVAL) + 1, NOISE_HISTORY = 20, NOISE_DEFAULT_ELEMENT_SIZE = 8, NOISE_HASHTABLE_SIZE = 128,