From 82f6edf345d8f9d30050f24be2deb2c5655fb994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Mon, 17 Apr 2017 12:16:05 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@372 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/containers/pideque.h | 12 ------------ src/core/pitime.cpp | 5 +---- src/core/pitime.h | 5 ++++- src/math/pimathbase.cpp | 12 ++++++++++++ src/math/pimathbase.h | 8 +------- src/piversion.h | 2 +- 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/containers/pideque.h b/src/containers/pideque.h index a9c7325f..29cc4b4b 100755 --- a/src/containers/pideque.h +++ b/src/containers/pideque.h @@ -217,18 +217,6 @@ public: pid_size = os; return *this; } - PIDeque & align() { - //printf("align %p\n", pid_data); - if (!pid_data) return *this; - T * p_d = (T*)(amalloc(pid_rsize*sizeof(T))); - //printf("alloc %p\n", p_d); - assert(p_d); - memcpy(p_d, pid_data, pid_size*sizeof(T)); - free((uchar*)pid_data); - pid_data = p_d; - //printf("%p\n", p_d); - return *this; - } PIDeque & insert(size_t index, const T & v = T()) { bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false); diff --git a/src/core/pitime.cpp b/src/core/pitime.cpp index b741815a..3a3c42aa 100755 --- a/src/core/pitime.cpp +++ b/src/core/pitime.cpp @@ -30,10 +30,7 @@ //# include extern clock_serv_t __pi_mac_clock; #endif -#include -#ifdef QNX -# include -#endif + /*! \class PISystemTime * \brief System time diff --git a/src/core/pitime.h b/src/core/pitime.h index 41f5a252..1d670e08 100755 --- a/src/core/pitime.h +++ b/src/core/pitime.h @@ -25,7 +25,10 @@ #include "pistring.h" - +#include +#ifdef QNX +# include +#endif //! \brief Sleep for "msecs" milliseconds void msleep(int msecs); diff --git a/src/math/pimathbase.cpp b/src/math/pimathbase.cpp index 1cf8d97c..89fa212f 100644 --- a/src/math/pimathbase.cpp +++ b/src/math/pimathbase.cpp @@ -19,6 +19,7 @@ #include "pimathbase.h" #include "pitime.h" +#include double piJ0(const double & v) { @@ -472,3 +473,14 @@ double randomn(double dv, double sv) { v0 = v0 * sqrt(-2 * log(s) / s); return v0 * sv + dv; } + + +double randomd() { + return (double) +#ifdef QNX + rand() +#else + random() +#endif + / RAND_MAX * 2. - 1.; +} diff --git a/src/math/pimathbase.h b/src/math/pimathbase.h index 5731f50e..a6c5c9fe 100644 --- a/src/math/pimathbase.h +++ b/src/math/pimathbase.h @@ -167,13 +167,7 @@ inline PIByteArray & operator >>(PIByteArray & s, complexld & v) {ldouble t0, t1 void randomize(); // [-1 ; 1] -inline double randomd() {return (double) -#ifdef QNX - rand() -#else - random() -#endif - / RAND_MAX * 2. - 1.;} +double randomd(); // [-1 ; 1] normal double randomn(double dv = 0., double sv = 1.); diff --git a/src/piversion.h b/src/piversion.h index 5942fad8..261b621d 100644 --- a/src/piversion.h +++ b/src/piversion.h @@ -5,6 +5,6 @@ #define PIP_VERSION_MAJOR 0 #define PIP_VERSION_MINOR 9 #define PIP_VERSION_REVISION 4 -#define PIP_VERSION_SUFFIX "alpha" +#define PIP_VERSION_SUFFIX "_prealpha" #endif // PIVERSION_H