Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to Nuttx 7.9 (plus) Includes fix for RAND_MAX #2047

Merged
merged 1 commit into from
Apr 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NuttX
Submodule NuttX updated from 66a565 to 4127e3
8 changes: 4 additions & 4 deletions nuttx-patches/Fixed-Shadow-wanings.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git NuttX/nuttx/include/signal.h NuttX/nuttx/include/signal.h
index ffb77e0..cca6a15 100644
index 8ef4d5f..f970a49 100644
--- NuttX/nuttx/include/signal.h
+++ NuttX/nuttx/include/signal.h
@@ -260,8 +260,11 @@ int sigfillset(FAR sigset_t *set);
@@ -271,8 +271,11 @@ int sigfillset(FAR sigset_t *set);
int sigaddset(FAR sigset_t *set, int signo);
int sigdelset(FAR sigset_t *set, int signo);
int sigismember(FAR const sigset_t *set, int signo);
Expand All @@ -11,9 +11,9 @@ index ffb77e0..cca6a15 100644
int sigaction(int sig, FAR const struct sigaction *act,
FAR struct sigaction *oact);
+#pragma GCC diagnostic pop
void (*sigset(int signo, void (*disp)(int)))(int);
int sigignore(int signo);
int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
int sigpending(FAR sigset_t *set);
int sigsuspend(FAR const sigset_t *sigmask);
diff --git NuttX/nuttx/include/stdio.h NuttX/nuttx/include/stdio.h
index cb16366..6ff12bb 100644
--- NuttX/nuttx/include/stdio.h
Expand Down
1 change: 0 additions & 1 deletion src/lib/px4_eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#pragma once

#pragma GCC diagnostic push
#define RAND_MAX __RAND_MAX
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wfloat-equal"
#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 1
Expand Down
6 changes: 3 additions & 3 deletions src/modules/controllib/blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class __EXPORT BlockRandUniform: public Block
};
virtual ~BlockRandUniform() {};
float update() {
static float rand_max = MAX_RAND;
static float rand_max = RAND_MAX;
float rand_val = rand();
float bounds = getMax() - getMin();
return getMin() + (rand_val * bounds) / rand_max;
Expand Down Expand Up @@ -483,8 +483,8 @@ class __EXPORT BlockRandGauss: public Block

if (phase == 0) {
do {
float U1 = (float)rand() / MAX_RAND;
float U2 = (float)rand() / MAX_RAND;
float U1 = (float)rand() / RAND_MAX;
float U2 = (float)rand() / RAND_MAX;
V1 = 2 * U1 - 1;
V2 = 2 * U2 - 1;
S = V1 * V1 + V2 * V2;
Expand Down