1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-14 16:10:44 +02:00

53060: silence build warnings

This commit is contained in:
Clinton Bunch 2024-08-31 09:10:12 -05:00 committed by Oliver Kiddle
parent 58bda59130
commit 6b9704e2c4
3 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2024-08-31 Oliver Kiddle <opk@zsh.org>
* Clinton Bunch: 53060: Doc/Zsh/mod_random.yo,
Src/Modules/random.c: silence build warnings
* Clinton Bunch: 53056: Completion/Zsh/Type/_module_math_func,
Doc/Makefile.in, Doc/Zsh/mod_random.yo, Src/Modules/random.c,
Src/Modules/random.mdd, Src/Modules/random_real.c, configure.ac:

View File

@ -41,7 +41,7 @@ tt(inclusive) is a flag that controls whether the result is ever equal to
tt(upper). By default it is not. If this argument is set to a non-zero value
then it may be.
This is to facilitate a construct like tt($a[zrand_int($#a)+1]) rather
This is to facilitate a construct like tt($a[zrand_int+LPAR()$#a+RPAR()+1]) rather
than tt($a[zrand_int+LPAR()$#a-1+RPAR()+1]).
For example, if $#a is 16, you would use tt(zrand_int+LPAR()16RPAR()) which has
16 possible return values 0-15. Because the function can return zero, in order

View File

@ -62,8 +62,10 @@ ssize_t
getrandom_buffer(void *buf, size_t len)
{
ssize_t ret;
#ifndef HAVE_ARC4RANDOM_BUF
size_t val = 0;
uint8_t *bufptr = buf;
#endif
do {
errno = 0;
@ -81,8 +83,10 @@ getrandom_buffer(void *buf, size_t len)
return -1;
}
}
#ifndef HAVE_ARC4RANDOM_BUF
bufptr += ret;
val += ret;
#endif
} while (ret < len);
return ret;
}