summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-10-11 09:59:03 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-10-11 10:03:32 -0300
commit60807a3d1e3d8e6ba722ec59a0e5f7b0b0c753a5 (patch)
tree8ae483d585dfb91883394196cbedaf640eebb551 /libshiboken
parent74cdaf8e5fe459abfcf39de7cf41bfc375a99e2a (diff)
downloadshiboken-60807a3d1e3d8e6ba722ec59a0e5f7b0b0c753a5.tar.gz
shiboken-60807a3d1e3d8e6ba722ec59a0e5f7b0b0c753a5.tar.xz
shiboken-60807a3d1e3d8e6ba722ec59a0e5f7b0b0c753a5.zip
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 08f6679a..b925770c 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