NO_UNUSED
This commit is contained in:
@@ -246,6 +246,10 @@
|
|||||||
extern char ** environ;
|
extern char ** environ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_UNUSED
|
||||||
|
# define NO_UNUSED(x) (void)x
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef assert
|
#ifndef assert
|
||||||
# define assert(x)
|
# define assert(x)
|
||||||
# define assertm(exp, msg)
|
# define assertm(exp, msg)
|
||||||
|
|||||||
@@ -272,8 +272,8 @@ inline PIByteArray::StreamRef operator <<(PIByteArray & s, const T & v) {
|
|||||||
PIP_EXPORT PIByteArray & operator <<(PIByteArray & s, const PIByteArray & v);
|
PIP_EXPORT PIByteArray & operator <<(PIByteArray & s, const PIByteArray & v);
|
||||||
|
|
||||||
//! \relatesalso PIByteArray
|
//! \relatesalso PIByteArray
|
||||||
//! \~english Store operator, see \ref PIByteArray_sec1 for details
|
//! \~english Store operator
|
||||||
//! \~russian Оператор сохранения, подробнее в \ref PIByteArray_sec1
|
//! \~russian Оператор сохранения
|
||||||
inline PIByteArray & operator <<(PIByteArray & s, const PIByteArray::RawData & v) {
|
inline PIByteArray & operator <<(PIByteArray & s, const PIByteArray::RawData & v) {
|
||||||
int os = s.size_s();
|
int os = s.size_s();
|
||||||
if (v.s > 0) {
|
if (v.s > 0) {
|
||||||
@@ -406,8 +406,8 @@ inline PIByteArray::StreamRef operator >>(PIByteArray & s, T & v) {
|
|||||||
PIP_EXPORT PIByteArray & operator >>(PIByteArray & s, PIByteArray & v);
|
PIP_EXPORT PIByteArray & operator >>(PIByteArray & s, PIByteArray & v);
|
||||||
|
|
||||||
//! \relatesalso PIByteArray
|
//! \relatesalso PIByteArray
|
||||||
//! \~english Restore operator, see \ref PIByteArray_sec1 for details
|
//! \~english Restore operator
|
||||||
//! \~russian Оператор извлечения, подробнее в \ref PIByteArray_sec1
|
//! \~russian Оператор извлечения
|
||||||
inline PIByteArray & operator >>(PIByteArray & s, PIByteArray::RawData v) {
|
inline PIByteArray & operator >>(PIByteArray & s, PIByteArray::RawData v) {
|
||||||
if (s.size_s() < v.s) {
|
if (s.size_s() < v.s) {
|
||||||
printf("error with RawData %d < %d\n", (int)s.size_s(), v.s);
|
printf("error with RawData %d < %d\n", (int)s.size_s(), v.s);
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ void PIGPIO::initPin(int gpio_num, Direction dir) {
|
|||||||
}
|
}
|
||||||
g.dir = dir;
|
g.dir = dir;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
NO_UNUSED(ret);
|
||||||
switch(dir) {
|
switch(dir) {
|
||||||
case In:
|
case In:
|
||||||
ret = system(("echo in >> /sys/class/gpio/" + g.name + "/direction").dataAscii());
|
ret = system(("echo in >> /sys/class/gpio/" + g.name + "/direction").dataAscii());
|
||||||
@@ -239,6 +240,7 @@ void PIGPIO::pinSet(int gpio_num, bool value) {
|
|||||||
PIMutexLocker ml(mutex);
|
PIMutexLocker ml(mutex);
|
||||||
GPIOData & g(gpio_[gpio_num]);
|
GPIOData & g(gpio_[gpio_num]);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
NO_UNUSED(ret);
|
||||||
if (g.fd != -1) {
|
if (g.fd != -1) {
|
||||||
if (value) ret = ::write(g.fd, "1", 1);
|
if (value) ret = ::write(g.fd, "1", 1);
|
||||||
else ret = ::write(g.fd, "0", 1);
|
else ret = ::write(g.fd, "0", 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user