aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-10-11 09:59:03 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:22 -0300
commit0b1b29bf42271754657ec6b73471f59b38f9e462 (patch)
treee48b78a8fff303d89d69df17817233715f10297e /libshiboken
parentbf52cec4e9709071ac8eab5b88282fcae6b08553 (diff)
Made SbkChar_Check macro safer with parenthesis.
Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/conversions.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index 08f6679a7..b925770c2 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -37,6 +37,7 @@
// When the user adds a function with an argument unknown for the typesystem, the generator writes type checks as
// TYPENAME_Check, so this macro allows users to add PyObject arguments to their added functions.
#define PyObject_Check(X) true
+#define SbkChar_Check(X) (SbkNumber_Check(X) || Shiboken::String::checkChar(X))
#include "autodecref.h"
namespace Shiboken
@@ -345,11 +346,6 @@ struct Converter_PyULongInt : Converter_PyInt<T>
static inline PyObject* toPython(const T& cppobj) { return PyLong_FromUnsignedLong(cppobj); }
};
-#define SbkChar_Check(X) \
- SbkNumber_Check(X) || \
- Shiboken::String::checkChar(X)
-
-
/// Specialization to convert char and unsigned char, it accepts Python numbers and strings with just one character.
template <typename CharType>
struct CharConverter