[Lldb-commits] [lldb] r162753 - /lldb/trunk/scripts/Python/python-typemaps.swig
Filipe Cabecinhas
me at filcab.net
Tue Aug 28 06:49:02 PDT 2012
Author: filcab
Date: Tue Aug 28 08:49:02 2012
New Revision: 162753
URL: http://llvm.org/viewvc/llvm-project?rev=162753&view=rev
Log:
Simplify the typecheck code.
Modified:
lldb/trunk/scripts/Python/python-typemaps.swig
Modified: lldb/trunk/scripts/Python/python-typemaps.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-typemaps.swig?rev=162753&r1=162752&r2=162753&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-typemaps.swig (original)
+++ lldb/trunk/scripts/Python/python-typemaps.swig Tue Aug 28 08:49:02 2012
@@ -369,11 +369,8 @@
}
%typemap(typecheck) (lldb::SBInputReader::Callback callback, void *baton) {
- if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
- $1 = 0;
- } else {
- $1 = 1;
- }
+ $1 = $input == Py_None;
+ $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
}
// For Log::LogOutputCallback
@@ -395,11 +392,8 @@
}
%typemap(typecheck) (lldb::LogOutputCallback log_callback, void *baton) {
- if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
- $1 = 0;
- } else {
- $1 = 1;
- }
+ $1 = $input == Py_None;
+ $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
}
%typemap(in) FILE * {
More information about the lldb-commits
mailing list