Minor cleanup

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@207 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-02-10 15:06:19 +00:00
commit 38c2518d77
2 changed files with 17 additions and 17 deletions

View file

@ -144,18 +144,18 @@ void PYTHON::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l)
// Now add it to the class
if (use_kw)
*pyclass << tab4 << "def " << realname << "(*_args, **_kwargs):\n";
*pyclass << tab4 << "def " << realname << "(*args, **kwargs):\n";
else
*pyclass << tab4 << "def " << realname << "(*_args):\n";
*pyclass << tab4 << "def " << realname << "(*args):\n";
// Create a doc string
if (docstring && doc_entry) {
*pyclass << tab8 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
}
if (use_kw)
*pyclass << tab8 << "val = apply(" << module << "." << name_member(realname,class_name) << ",_args, _kwargs)\n";
*pyclass << tab8 << "val = apply(" << module << "." << name_member(realname,class_name) << ",args, kwargs)\n";
else
*pyclass << tab8 << "val = apply(" << module << "." << name_member(realname,class_name) << ",_args)\n";
*pyclass << tab8 << "val = apply(" << module << "." << name_member(realname,class_name) << ",args)\n";
// Check to see if the return type is an object
if ((hash.lookup(t->name)) && (t->is_pointer <= 1)) {
@ -222,17 +222,17 @@ void PYTHON::cpp_constructor(char *name, char *iname, ParmList *l) {
// Create a new constructor
if (use_kw)
*construct << tab4 << "def __init__(self,*_args,**_kwargs):\n";
*construct << tab4 << "def __init__(self,*args,**kwargs):\n";
else
*construct << tab4 << "def __init__(self,*_args):\n";
*construct << tab4 << "def __init__(self,*args):\n";
if (docstring && doc_entry)
*construct << tab8 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
if (use_kw)
*construct << tab8 << "self.this = apply(" << module << "." << name_construct(realname) << ",_args,_kwargs)\n";
*construct << tab8 << "self.this = apply(" << module << "." << name_construct(realname) << ",args,kwargs)\n";
else
*construct << tab8 << "self.this = apply(" << module << "." << name_construct(realname) << ",_args)\n";
*construct << tab8 << "self.this = apply(" << module << "." << name_construct(realname) << ",args)\n";
*construct << tab8 << "self.thisown = 1\n";
emitAddPragmas(*construct,"__init__",tab8);
have_constructor = 1;
@ -242,15 +242,15 @@ void PYTHON::cpp_constructor(char *name, char *iname, ParmList *l) {
// function for it.
if (use_kw)
*additional << "def " << realname << "(*_args,**_kwargs):\n";
*additional << "def " << realname << "(*args,**kwargs):\n";
else
*additional << "def " << realname << "(*_args):\n";
*additional << "def " << realname << "(*args):\n";
*additional << tab4 << "val = " << class_name << "Ptr(apply(";
if (use_kw)
*additional << module << "." << name_construct(realname) << ",_args,_kwargs))\n";
*additional << module << "." << name_construct(realname) << ",args,kwargs))\n";
else
*additional << module << "." << name_construct(realname) << ",_args))\n";
*additional << module << "." << name_construct(realname) << ",args))\n";
*additional << tab4 << "val.thisown = 1\n"
<< tab4 << "return val\n\n";
}

View file

@ -355,7 +355,7 @@ void PYTHON::initialize(void)
<< tab4 << "long lvalue;\n"
<< tab4 << "double dvalue;\n"
<< tab4 << "void *pvalue;\n"
<< tab4 << "_swig_type_info *ptype;\n"
<< tab4 << "_swig_type_info **ptype;\n"
<< "} _swig_const_info;\n";
const_code << "#define SWIG_PY_INT 1\n"
@ -490,7 +490,7 @@ void PYTHON::close_cmodule(void)
<< tab8 << tab8 << "PyDict_SetItemString(d,_swig_const_table[i].name, PyString_FromString((char *) _swig_const_table[i].pvalue));\n"
<< tab8 << tab8 << "break;\n"
<< tab8 << tab4 << "case SWIG_PY_POINTER:\n"
<< tab8 << tab8 << "PyDict_SetItemString(d,_swig_const_table[i].name, SWIG_NewPointerObj(_swig_const_table[i].pvalue, _swig_const_table[i].ptype));\n"
<< tab8 << tab8 << "PyDict_SetItemString(d,_swig_const_table[i].name, SWIG_NewPointerObj(_swig_const_table[i].pvalue, *(_swig_const_table[i].ptype)));\n"
<< tab8 << tab8 << "break;\n"
<< tab8 << tab4 << "default:\n"
<< tab8 << tab8 << "break;\n"
@ -1049,14 +1049,14 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
if (!need_wrapper) {
func << iname << " = " << module << "." << iname << "\n\n";
} else {
func << "def " << iname << "(*_args, **_kwargs):\n";
func << "def " << iname << "(*args, **kwargs):\n";
// Create a docstring for this
if (docstring && doc_entry) {
func << tab4 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
}
func << tab4 << "val = apply(" << module << "." << iname << ",_args,_kwargs)\n";
func << tab4 << "val = apply(" << module << "." << iname << ",args,kwargs)\n";
if (munge_return) {
// If the output of this object has been remapped in any way, we're
@ -1370,7 +1370,7 @@ void PYTHON::declare_const(char *name, char *, DataType *type, char *value) {
} else {
// A funky user-defined type. We're going to munge it into a string pointer value
type->remember();
const_code << tab4 << "{ SWIG_PY_POINTER, \"" << name << "\", 0, 0, (void *) " << value << ", SWIGTYPE" << type->print_mangle() << ")); \n";
const_code << tab4 << "{ SWIG_PY_POINTER, \"" << name << "\", 0, 0, (void *) " << value << ", &SWIGTYPE" << type->print_mangle() << "}, \n";
}
}