summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/drivers/lcd/ug-2864ambag01.c2
-rw-r--r--nuttx/libc/stdlib/lib_rand.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/nuttx/drivers/lcd/ug-2864ambag01.c b/nuttx/drivers/lcd/ug-2864ambag01.c
index e133f3901..2a47b38eb 100644
--- a/nuttx/drivers/lcd/ug-2864ambag01.c
+++ b/nuttx/drivers/lcd/ug-2864ambag01.c
@@ -970,7 +970,7 @@ static int ug2864ambag01_setcontrast(struct lcd_dev_s *dev, unsigned int contras
*/
#if CONFIG_LCD_MAXCONTRAST != 255
- newcontrast = ((contrast << 8) - 1) / CONFIG_LCD_MAXCONTRAST;
+ scaled = ((contrast << 8) - 1) / CONFIG_LCD_MAXCONTRAST;
#else
scaled = contrast;
#endif
diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c
index 465cce47f..bbefaee5d 100644
--- a/nuttx/libc/stdlib/lib_rand.c
+++ b/nuttx/libc/stdlib/lib_rand.c
@@ -175,13 +175,13 @@ static inline void fgenerate2(void)
unsigned long randint;
/* Second order congruential generator. One may be added to the result of the
- * generated value to avoid the value zero (I am not sure if this is necessor
+ * generated value to avoid the value zero (I am not sure if this is necessary
* for higher order random number generators or how this may effect the quality
* of the generated numbers).
*/
randint = (RND2_CONSTK1 * g_randint1 +
- RND2_CONSTK2 * g_randint2) % RND2_CONSTP + 1;
+ RND2_CONSTK2 * g_randint2) % RND2_CONSTP;
g_randint2 = g_randint1;
g_randint1 = (randint == 0 ? 1 : randint);
@@ -208,14 +208,14 @@ static inline void fgenerate3(void)
unsigned long randint;
/* Third order congruential generator. One may be added to the result of the
- * generated value to avoid the value zero (I am not sure if this is necessor
+ * generated value to avoid the value zero (I am not sure if this is necessary
* for higher order random number generators or how this may effect the quality
* of the generated numbers).
*/
randint = (RND3_CONSTK1 * g_randint1 +
RND3_CONSTK2 * g_randint2 +
- RND3_CONSTK2 * g_randint3) % RND3_CONSTP + 1;
+ RND3_CONSTK2 * g_randint3) % RND3_CONSTP;
g_randint3 = g_randint2;
g_randint2 = g_randint1;