NO_UNUSED
This commit is contained in:
@@ -246,6 +246,10 @@
|
||||
extern char ** environ;
|
||||
#endif
|
||||
|
||||
#ifndef NO_UNUSED
|
||||
# define NO_UNUSED(x) (void)x
|
||||
#endif
|
||||
|
||||
#ifndef assert
|
||||
# define assert(x)
|
||||
# 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);
|
||||
|
||||
//! \relatesalso PIByteArray
|
||||
//! \~english Store operator, see \ref PIByteArray_sec1 for details
|
||||
//! \~russian Оператор сохранения, подробнее в \ref PIByteArray_sec1
|
||||
//! \~english Store operator
|
||||
//! \~russian Оператор сохранения
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const PIByteArray::RawData & v) {
|
||||
int os = s.size_s();
|
||||
if (v.s > 0) {
|
||||
@@ -406,8 +406,8 @@ inline PIByteArray::StreamRef operator >>(PIByteArray & s, T & v) {
|
||||
PIP_EXPORT PIByteArray & operator >>(PIByteArray & s, PIByteArray & v);
|
||||
|
||||
//! \relatesalso PIByteArray
|
||||
//! \~english Restore operator, see \ref PIByteArray_sec1 for details
|
||||
//! \~russian Оператор извлечения, подробнее в \ref PIByteArray_sec1
|
||||
//! \~english Restore operator
|
||||
//! \~russian Оператор извлечения
|
||||
inline PIByteArray & operator >>(PIByteArray & s, PIByteArray::RawData v) {
|
||||
if (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;
|
||||
int ret = 0;
|
||||
NO_UNUSED(ret);
|
||||
switch(dir) {
|
||||
case In:
|
||||
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);
|
||||
GPIOData & g(gpio_[gpio_num]);
|
||||
int ret = 0;
|
||||
NO_UNUSED(ret);
|
||||
if (g.fd != -1) {
|
||||
if (value) ret = ::write(g.fd, "1", 1);
|
||||
else ret = ::write(g.fd, "0", 1);
|
||||
|
||||
Reference in New Issue
Block a user