mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
Use rand() instead of random(), it's more standard
Remove the random() stubs from the codebase PUBLISHED_FROM=0f56ec7dffa0af1f5061a17d8801239d6f0e32a5
This commit is contained in:
1 parent
b987df1974
commit
15643f8e67
2 files changed
+3
-17
No files matched your search
+3
-11
@@ -4113,15 +4113,15 @@ static uint32_t mg_ws_random_mask(void) {
|
||||
* is untrusted code that wouldn't have access to a lower level net API
|
||||
* anyway (e.g. web browsers). Hence this feature is low prio for most
|
||||
* mongoose use cases and thus can be disabled, e.g. when porting to a platform
|
||||
* that lacks random().
|
||||
* that lacks rand().
|
||||
*/
|
||||
#ifdef MG_DISABLE_WS_RANDOM_MASK
|
||||
mask = 0xefbeadde; /* generated with a random number generator, I swear */
|
||||
#else
|
||||
if (sizeof(long) >= 4) {
|
||||
mask = (uint32_t) random();
|
||||
mask = (uint32_t) rand();
|
||||
} else if (sizeof(long) == 2) {
|
||||
mask = (uint32_t) random() << 16 | (uint32_t) random();
|
||||
mask = (uint32_t) rand() << 16 | (uint32_t) rand();
|
||||
}
|
||||
#endif
|
||||
return mask;
|
||||
@@ -9568,10 +9568,6 @@ int gettimeofday(struct timeval *tp, void *tzp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int random(void) {
|
||||
return 42; /* FIXME */
|
||||
}
|
||||
|
||||
void fprint_str(FILE *fp, const char *str) {
|
||||
while (*str != '\0') {
|
||||
if (*str == '\n') MAP_UARTCharPut(CONSOLE_UART, '\r');
|
||||
@@ -9631,10 +9627,6 @@ int gettimeofday(struct timeval *tp, void *tzp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long int random(void) {
|
||||
return 42; /* FIXME */
|
||||
}
|
||||
|
||||
#endif /* CS_PLATFORM == CS_P_MSP432 */
|
||||
#ifdef MG_MODULE_LINES
|
||||
#line 1 "./src/../../common/platforms/simplelink/sl_fs_slfs.h"
|
||||
|
||||
Reference in new issue
Block a user