forked from OSchip/llvm-project
[lldb] (Semi-automatically) format .swig files
I've found my recent ventures into the swig land painful because of the strange way they are formatted. This patch attempts to alleviate future headaches by formatting these files into something resembling the normal llvm style. Unfortunately, completely formatting these files automatically does not work because clang format gets confused by swigs % syntax, so I have employed a hybrid approach where I formatted blocks of c++ code with clang-format and then manually massaged the code until it looked reasonable (and compiled). I don't expect these files to remain perfectly formatted (although, if one's editor is configured to configure the current line/block on request, one can get pretty good results by using it judiciously), but at least it will prevent the (mangled form of the) old lldb style being proliferated endlessly. Differential Revision: https://reviews.llvm.org/D115736
This commit is contained in:
parent
5b139a583d
commit
9d5e37ed8c
|
@ -1,27 +1,20 @@
|
|||
template <typename SBClass>
|
||||
void
|
||||
PushSBClass (lua_State* L, SBClass* obj);
|
||||
template <typename SBClass> void PushSBClass(lua_State *L, SBClass *obj);
|
||||
|
||||
void
|
||||
PushSBClass (lua_State* L, lldb::SBFrame* frame_sb)
|
||||
{
|
||||
void PushSBClass(lua_State *L, lldb::SBFrame *frame_sb) {
|
||||
SWIG_NewPointerObj(L, frame_sb, SWIGTYPE_p_lldb__SBFrame, 0);
|
||||
}
|
||||
|
||||
void
|
||||
PushSBClass (lua_State* L, lldb::SBBreakpointLocation* breakpoint_location_sb)
|
||||
{
|
||||
SWIG_NewPointerObj(L, breakpoint_location_sb, SWIGTYPE_p_lldb__SBBreakpointLocation, 0);
|
||||
void PushSBClass(lua_State *L,
|
||||
lldb::SBBreakpointLocation *breakpoint_location_sb) {
|
||||
SWIG_NewPointerObj(L, breakpoint_location_sb,
|
||||
SWIGTYPE_p_lldb__SBBreakpointLocation, 0);
|
||||
}
|
||||
|
||||
void
|
||||
PushSBClass (lua_State* L, lldb::SBWatchpoint* watchpoint_sb)
|
||||
{
|
||||
void PushSBClass(lua_State *L, lldb::SBWatchpoint *watchpoint_sb) {
|
||||
SWIG_NewPointerObj(L, watchpoint_sb, SWIGTYPE_p_lldb__SBWatchpoint, 0);
|
||||
}
|
||||
|
||||
void
|
||||
PushSBClass (lua_State* L, lldb::SBStructuredData* structured_data_sb)
|
||||
{
|
||||
SWIG_NewPointerObj(L, structured_data_sb, SWIGTYPE_p_lldb__SBStructuredData, 0);
|
||||
void PushSBClass(lua_State *L, lldb::SBStructuredData *structured_data_sb) {
|
||||
SWIG_NewPointerObj(L, structured_data_sb, SWIGTYPE_p_lldb__SBStructuredData,
|
||||
0);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
|
|||
if ($2 <= 0) {
|
||||
return luaL_error(L, "Positive integer expected");
|
||||
}
|
||||
$1 = (char *) malloc($2);
|
||||
$1 = (char *)malloc($2);
|
||||
}
|
||||
|
||||
// SBProcess::ReadCStringFromMemory() uses a void*, but needs to be treated
|
||||
|
@ -278,7 +278,7 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
|
|||
lua_pop(L, 1);
|
||||
return luaL_error(L, "List should only contain numbers");
|
||||
}
|
||||
$1[j++] = ($*1_ltype)lua_tonumber(L, -1);
|
||||
$1[j++] = ($*1_ltype) lua_tonumber(L, -1);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
} else if (lua_isnil(L, $input)) {
|
||||
|
@ -307,8 +307,7 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
|
|||
if (lua_isnil(L, $input)) {
|
||||
$1 = NULL;
|
||||
$2 = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$1 = (char *)luaL_checklstring(L, $input, (size_t *)&$2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
%header %{
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
PushSBClass(lua_State* L, T* obj);
|
||||
template <typename T> void PushSBClass(lua_State * L, T * obj);
|
||||
|
||||
// This function is called from Lua::CallBreakpointCallback
|
||||
llvm::Expected<bool>
|
||||
lldb_private::LLDBSwigLuaBreakpointCallbackFunction
|
||||
(
|
||||
lua_State *L,
|
||||
lldb::StackFrameSP stop_frame_sp,
|
||||
llvm::Expected<bool> lldb_private::LLDBSwigLuaBreakpointCallbackFunction(
|
||||
lua_State * L, lldb::StackFrameSP stop_frame_sp,
|
||||
lldb::BreakpointLocationSP bp_loc_sp,
|
||||
const StructuredDataImpl &extra_args_impl
|
||||
)
|
||||
{
|
||||
const StructuredDataImpl &extra_args_impl) {
|
||||
lldb::SBFrame sb_frame(stop_frame_sp);
|
||||
lldb::SBBreakpointLocation sb_bp_loc(bp_loc_sp);
|
||||
int nargs = 2;
|
||||
|
@ -48,14 +41,8 @@ lldb_private::LLDBSwigLuaBreakpointCallbackFunction
|
|||
}
|
||||
|
||||
// This function is called from Lua::CallWatchpointCallback
|
||||
llvm::Expected<bool>
|
||||
lldb_private::LLDBSwigLuaWatchpointCallbackFunction
|
||||
(
|
||||
lua_State *L,
|
||||
lldb::StackFrameSP stop_frame_sp,
|
||||
lldb::WatchpointSP wp_sp
|
||||
)
|
||||
{
|
||||
llvm::Expected<bool> lldb_private::LLDBSwigLuaWatchpointCallbackFunction(
|
||||
lua_State * L, lldb::StackFrameSP stop_frame_sp, lldb::WatchpointSP wp_sp) {
|
||||
lldb::SBFrame sb_frame(stop_frame_sp);
|
||||
lldb::SBWatchpoint sb_wp(wp_sp);
|
||||
int nargs = 2;
|
||||
|
@ -82,8 +69,7 @@ lldb_private::LLDBSwigLuaWatchpointCallbackFunction
|
|||
return stop;
|
||||
}
|
||||
|
||||
static void
|
||||
LLDBSwigLuaCallLuaLogOutputCallback(const char *str, void *baton) {
|
||||
static void LLDBSwigLuaCallLuaLogOutputCallback(const char *str, void *baton) {
|
||||
lua_State *L = (lua_State *)baton;
|
||||
|
||||
lua_pushlightuserdata(L, (void *)&LLDBSwigLuaCallLuaLogOutputCallback);
|
||||
|
@ -94,7 +80,7 @@ LLDBSwigLuaCallLuaLogOutputCallback(const char *str, void *baton) {
|
|||
lua_pcall(L, 1, 0, 0);
|
||||
}
|
||||
|
||||
static int LLDBSwigLuaCloseFileHandle(lua_State *L) {
|
||||
static int LLDBSwigLuaCloseFileHandle(lua_State * L) {
|
||||
return luaL_error(L, "You cannot close a file handle used by lldb.");
|
||||
}
|
||||
|
||||
|
|
|
@ -12,22 +12,22 @@
|
|||
PythonList list(PyRefType::Borrowed, $input);
|
||||
int size = list.GetSize();
|
||||
int i = 0;
|
||||
$1 = (char**)malloc((size+1)*sizeof(char*));
|
||||
$1 = (char **)malloc((size + 1) * sizeof(char *));
|
||||
for (i = 0; i < size; i++) {
|
||||
PythonString py_str = list.GetItemAtIndex(i).AsType<PythonString>();
|
||||
if (!py_str.IsAllocated()) {
|
||||
PyErr_SetString(PyExc_TypeError,"list must contain strings");
|
||||
PyErr_SetString(PyExc_TypeError, "list must contain strings");
|
||||
free($1);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
$1[i] = const_cast<char*>(py_str.GetString().data());
|
||||
$1[i] = const_cast<char *>(py_str.GetString().data());
|
||||
}
|
||||
$1[i] = 0;
|
||||
} else if ($input == Py_None) {
|
||||
$1 = NULL;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_TypeError,"not a list");
|
||||
PyErr_SetString(PyExc_TypeError, "not a list");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -41,12 +41,12 @@
|
|||
int i = 0;
|
||||
for (i = 0; i < size; i++) {
|
||||
PythonString s = list.GetItemAtIndex(i).AsType<PythonString>();
|
||||
if (!s.IsAllocated()) { $1 = 0; }
|
||||
if (!s.IsAllocated()) {
|
||||
$1 = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$1 = ( ($input == Py_None) ? 1 : 0);
|
||||
} else {
|
||||
$1 = (($input == Py_None) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,8 @@
|
|||
int len;
|
||||
int i;
|
||||
len = 0;
|
||||
while ($1[len]) len++;
|
||||
while ($1[len])
|
||||
len++;
|
||||
PythonList list(len);
|
||||
for (i = 0; i < len; i++)
|
||||
list.SetItemAtIndex(i, PythonString($1[i]));
|
||||
|
@ -99,7 +100,7 @@
|
|||
PyErr_SetString(PyExc_ValueError, "Positive integer expected");
|
||||
return NULL;
|
||||
}
|
||||
$1 = (char *) malloc($2);
|
||||
$1 = (char *)malloc($2);
|
||||
}
|
||||
// SBProcess::ReadCStringFromMemory() uses a void*, but needs to be treated
|
||||
// as char data instead of byte data.
|
||||
|
@ -113,7 +114,7 @@
|
|||
$result = string.release();
|
||||
Py_INCREF($result);
|
||||
} else {
|
||||
llvm::StringRef ref(static_cast<const char*>($1), result);
|
||||
llvm::StringRef ref(static_cast<const char *>($1), result);
|
||||
PythonString string(ref);
|
||||
$result = string.release();
|
||||
}
|
||||
|
@ -135,7 +136,7 @@
|
|||
PyErr_SetString(PyExc_ValueError, "Positive integer expected");
|
||||
return NULL;
|
||||
}
|
||||
$1 = (char *) malloc($2);
|
||||
$1 = (char *)malloc($2);
|
||||
}
|
||||
%typemap(argout) (char *dst_or_null, size_t dst_len) {
|
||||
Py_XDECREF($result); /* Blow away any previous result */
|
||||
|
@ -153,20 +154,17 @@
|
|||
(const char *src, size_t src_len) {
|
||||
if (PythonString::Check($input)) {
|
||||
PythonString str(PyRefType::Borrowed, $input);
|
||||
$1 = (char*)str.GetString().data();
|
||||
$1 = (char *)str.GetString().data();
|
||||
$2 = str.GetSize();
|
||||
}
|
||||
else if(PythonByteArray::Check($input)) {
|
||||
} else if (PythonByteArray::Check($input)) {
|
||||
PythonByteArray bytearray(PyRefType::Borrowed, $input);
|
||||
$1 = (char*)bytearray.GetBytes().data();
|
||||
$1 = (char *)bytearray.GetBytes().data();
|
||||
$2 = bytearray.GetSize();
|
||||
}
|
||||
else if (PythonBytes::Check($input)) {
|
||||
} else if (PythonBytes::Check($input)) {
|
||||
PythonBytes bytes(PyRefType::Borrowed, $input);
|
||||
$1 = (char*)bytes.GetBytes().data();
|
||||
$1 = (char *)bytes.GetBytes().data();
|
||||
$2 = bytes.GetSize();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
PyErr_SetString(PyExc_ValueError, "Expecting a string");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -176,20 +174,17 @@
|
|||
(const void *data, size_t data_len) {
|
||||
if (PythonString::Check($input)) {
|
||||
PythonString str(PyRefType::Borrowed, $input);
|
||||
$1 = (void*)str.GetString().data();
|
||||
$1 = (void *)str.GetString().data();
|
||||
$2 = str.GetSize();
|
||||
}
|
||||
else if(PythonByteArray::Check($input)) {
|
||||
} else if (PythonByteArray::Check($input)) {
|
||||
PythonByteArray bytearray(PyRefType::Borrowed, $input);
|
||||
$1 = (void*)bytearray.GetBytes().data();
|
||||
$1 = (void *)bytearray.GetBytes().data();
|
||||
$2 = bytearray.GetSize();
|
||||
}
|
||||
else if (PythonBytes::Check($input)) {
|
||||
} else if (PythonBytes::Check($input)) {
|
||||
PythonBytes bytes(PyRefType::Borrowed, $input);
|
||||
$1 = (void*)bytes.GetBytes().data();
|
||||
$1 = (void *)bytes.GetBytes().data();
|
||||
$2 = bytes.GetSize();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
PyErr_SetString(PyExc_ValueError, "Expecting a buffer");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -210,7 +205,7 @@
|
|||
PyErr_SetString(PyExc_ValueError, "Positive integer expected");
|
||||
return NULL;
|
||||
}
|
||||
$1 = (void *) malloc($2);
|
||||
$1 = (void *)malloc($2);
|
||||
}
|
||||
|
||||
// Return the buffer. Discarding any previous return result
|
||||
|
@ -221,7 +216,7 @@
|
|||
$result = Py_None;
|
||||
Py_INCREF($result);
|
||||
} else {
|
||||
PythonBytes bytes(static_cast<const uint8_t*>($1), result);
|
||||
PythonBytes bytes(static_cast<const uint8_t *>($1), result);
|
||||
$result = bytes.release();
|
||||
}
|
||||
free($1);
|
||||
|
@ -250,19 +245,18 @@ template <> int32_t PyLongAsT<int32_t>(PyObject *obj) {
|
|||
return static_cast<int32_t>(PyLong_AsLong(obj));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool SetNumberFromPyObject(T &number, PyObject *obj) {
|
||||
template <class T> bool SetNumberFromPyObject(T &number, PyObject *obj) {
|
||||
if (PyInt_Check(obj))
|
||||
number = static_cast<T>(PyInt_AsLong(obj));
|
||||
else if (PyLong_Check(obj))
|
||||
number = PyLongAsT<T>(obj);
|
||||
else return false;
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
||||
template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
||||
if (PyFloat_Check(obj)) {
|
||||
number = PyFloat_AsDouble(obj);
|
||||
return true;
|
||||
|
@ -287,11 +281,11 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
int size = PyList_Size($input);
|
||||
int i = 0;
|
||||
$2 = size;
|
||||
$1 = ($1_type) malloc(size * sizeof($*1_type));
|
||||
$1 = ($1_type)malloc(size * sizeof($*1_type));
|
||||
for (i = 0; i < size; i++) {
|
||||
PyObject *o = PyList_GetItem($input,i);
|
||||
PyObject *o = PyList_GetItem($input, i);
|
||||
if (!SetNumberFromPyObject($1[i], o)) {
|
||||
PyErr_SetString(PyExc_TypeError,"list must contain numbers");
|
||||
PyErr_SetString(PyExc_TypeError, "list must contain numbers");
|
||||
free($1);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -305,7 +299,7 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
$1 = NULL;
|
||||
$2 = 0;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_TypeError,"not a list");
|
||||
PyErr_SetString(PyExc_TypeError, "not a list");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -326,7 +320,7 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
}
|
||||
|
||||
%typemap(in, numinputs=0) (uint32_t *versions) {
|
||||
$1 = (uint32_t*)malloc(sizeof(uint32_t) * 50);
|
||||
$1 = (uint32_t *)malloc(sizeof(uint32_t) * 50);
|
||||
}
|
||||
|
||||
%typemap(in, numinputs=0) (uint32_t num_versions) {
|
||||
|
@ -337,13 +331,11 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
uint32_t count = result;
|
||||
if (count >= $2)
|
||||
count = $2;
|
||||
PyObject* list = PyList_New(count);
|
||||
for (uint32_t j = 0; j < count; j++)
|
||||
{
|
||||
PyObject* item = PyInt_FromLong($1[j]);
|
||||
int ok = PyList_SetItem(list,j,item);
|
||||
if (ok != 0)
|
||||
{
|
||||
PyObject *list = PyList_New(count);
|
||||
for (uint32_t j = 0; j < count; j++) {
|
||||
PyObject *item = PyInt_FromLong($1[j]);
|
||||
int ok = PyList_SetItem(list, j, item);
|
||||
if (ok != 0) {
|
||||
$result = Py_None;
|
||||
break;
|
||||
}
|
||||
|
@ -358,7 +350,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
|
||||
// For Log::LogOutputCallback
|
||||
%typemap(in) (lldb::LogOutputCallback log_callback, void *baton) {
|
||||
if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
|
||||
if (!($input == Py_None ||
|
||||
PyCallable_Check(reinterpret_cast<PyObject *>($input)))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -376,7 +369,7 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
|
||||
%typemap(typecheck) (lldb::LogOutputCallback log_callback, void *baton) {
|
||||
$1 = $input == Py_None;
|
||||
$1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
|
||||
$1 = $1 || PyCallable_Check(reinterpret_cast<PyObject *>($input));
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,7 +391,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
PyErr_SetString(PyExc_TypeError, "not a file");
|
||||
return nullptr;
|
||||
}
|
||||
auto sp = unwrapOrSetPythonException(py_file.ConvertToFileForcingUseOfScriptingIOMethods());
|
||||
auto sp = unwrapOrSetPythonException(
|
||||
py_file.ConvertToFileForcingUseOfScriptingIOMethods());
|
||||
if (!sp)
|
||||
return nullptr;
|
||||
$1 = sp;
|
||||
|
@ -410,7 +404,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
PyErr_SetString(PyExc_TypeError, "not a file");
|
||||
return nullptr;
|
||||
}
|
||||
auto sp = unwrapOrSetPythonException(py_file.ConvertToFile(/*borrowed=*/true));
|
||||
auto sp =
|
||||
unwrapOrSetPythonException(py_file.ConvertToFile(/*borrowed=*/true));
|
||||
if (!sp)
|
||||
return nullptr;
|
||||
$1 = sp;
|
||||
|
@ -422,7 +417,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
PyErr_SetString(PyExc_TypeError, "not a file");
|
||||
return nullptr;
|
||||
}
|
||||
auto sp = unwrapOrSetPythonException(py_file.ConvertToFileForcingUseOfScriptingIOMethods(/*borrowed=*/true));
|
||||
auto sp = unwrapOrSetPythonException(
|
||||
py_file.ConvertToFileForcingUseOfScriptingIOMethods(/*borrowed=*/true));
|
||||
if (!sp)
|
||||
return nullptr;
|
||||
$1 = sp;
|
||||
|
@ -446,24 +442,20 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
return nullptr;
|
||||
$result = pyfile.release();
|
||||
}
|
||||
if (!$result)
|
||||
{
|
||||
if (!$result) {
|
||||
$result = Py_None;
|
||||
Py_INCREF(Py_None);
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(in) (const char* string, int len) {
|
||||
if ($input == Py_None)
|
||||
{
|
||||
if ($input == Py_None) {
|
||||
$1 = NULL;
|
||||
$2 = 0;
|
||||
}
|
||||
else if (PythonString::Check($input))
|
||||
{
|
||||
} else if (PythonString::Check($input)) {
|
||||
PythonString py_str(PyRefType::Borrowed, $input);
|
||||
llvm::StringRef str = py_str.GetString();
|
||||
$1 = const_cast<char*>(str.data());
|
||||
$1 = const_cast<char *>(str.data());
|
||||
$2 = str.size();
|
||||
// In Python 2, if $input is a PyUnicode object then this
|
||||
// will trigger a Unicode -> String conversion, in which
|
||||
|
@ -474,10 +466,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
// releasing the string will not leak anything, since we
|
||||
// created this as a borrowed reference.
|
||||
py_str.release();
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError,"not a string-like object");
|
||||
} else {
|
||||
PyErr_SetString(PyExc_TypeError, "not a string-like object");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -491,7 +481,9 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
|
||||
%define %pybuffer_mutable_binary(TYPEMAP, SIZE)
|
||||
%typemap(in) (TYPEMAP, SIZE) (Py_buffer_RAII view) {
|
||||
int res; Py_ssize_t size = 0; void *buf = 0;
|
||||
int res;
|
||||
Py_ssize_t size = 0;
|
||||
void *buf = 0;
|
||||
res = PyObject_GetBuffer($input, &view.buffer, PyBUF_WRITABLE);
|
||||
if (res < 0) {
|
||||
PyErr_Clear();
|
||||
|
@ -499,14 +491,16 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
}
|
||||
size = view.buffer.len;
|
||||
buf = view.buffer.buf;
|
||||
$1 = ($1_ltype) buf;
|
||||
$2 = ($2_ltype) (size/sizeof($*1_type));
|
||||
$1 = ($1_ltype)buf;
|
||||
$2 = ($2_ltype)(size / sizeof($*1_type));
|
||||
}
|
||||
%enddef
|
||||
|
||||
%define %pybuffer_binary(TYPEMAP, SIZE)
|
||||
%typemap(in) (TYPEMAP, SIZE) (Py_buffer_RAII view) {
|
||||
int res; Py_ssize_t size = 0; const void *buf = 0;
|
||||
int res;
|
||||
Py_ssize_t size = 0;
|
||||
const void *buf = 0;
|
||||
res = PyObject_GetBuffer($input, &view.buffer, PyBUF_CONTIG_RO);
|
||||
if (res < 0) {
|
||||
PyErr_Clear();
|
||||
|
@ -514,8 +508,8 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
|
|||
}
|
||||
size = view.buffer.len;
|
||||
buf = view.buffer.buf;
|
||||
$1 = ($1_ltype) buf;
|
||||
$2 = ($2_ltype) (size / sizeof($*1_type));
|
||||
$1 = ($1_ltype)buf;
|
||||
$2 = ($2_ltype)(size / sizeof($*1_type));
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue