Activity log for bug #1093504

Date Who What changed Old value New value Message
2012-12-24 19:27:22 Mark Browning bug added bug
2012-12-24 19:27:40 Mark Browning description When a container is added for a list of pointers to const objects, the generated code has compilation errors. The generated method signature is int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec * *address); It needs to be: int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec const * *address); The following script will produce this error case in the pybindgen 0.16.0 archive. from pybindgen import Module, FileCodeSink import sys def main(): out = FileCodeSink(sys.stdout) module = Module('acc', cpp_namespace='::') module.add_include('"const_test.hpp"') module.add_class('CReportSpec', ) module.add_container('std::list< CReportSpec const * >', 'CReportSpec const *', container_type='list') module.generate(out) if __name__ == '__main__': main() When a container is added for a list of pointers to const objects, the generated code has compilation errors. The generated method signature is int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec * *address); It needs to be: int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec const * *address); The following script will produce this error case in the pybindgen 0.16.0 archive. from pybindgen import Module, FileCodeSink import sys def main():     out = FileCodeSink(sys.stdout)     module = Module('acc', cpp_namespace='::')     module.add_include('"const_test.hpp"')     module.add_class('CReportSpec', )     module.add_container('std::list< CReportSpec const * >', 'CReportSpec const *', container_type='list')     module.generate(out) if __name__ == '__main__':     main()
2012-12-24 19:52:35 Mark Browning description When a container is added for a list of pointers to const objects, the generated code has compilation errors. The generated method signature is int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec * *address); It needs to be: int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec const * *address); The following script will produce this error case in the pybindgen 0.16.0 archive. from pybindgen import Module, FileCodeSink import sys def main():     out = FileCodeSink(sys.stdout)     module = Module('acc', cpp_namespace='::')     module.add_include('"const_test.hpp"')     module.add_class('CReportSpec', )     module.add_container('std::list< CReportSpec const * >', 'CReportSpec const *', container_type='list')     module.generate(out) if __name__ == '__main__':     main() When a container is added for a list of pointers to const objects, the generated code has compilation errors. The generated method signature is int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec * *address); It needs to be: int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec const * *address); The following script will produce this error case in the pybindgen 0.16.0 archive. from pybindgen import Module, FileCodeSink import sys def main():     out = FileCodeSink(sys.stdout)     module = Module('acc', cpp_namespace='::')     module.add_include('"const_test.hpp"')     module.add_class('CReportSpec', )     module.add_container('std::list< CReportSpec const * >', 'CReportSpec const *', container_type='list')     module.generate(out) if __name__ == '__main__':     main() The problem is in that the converter function in pybindgen/converer_functions.py uses the type_traits.ctype_no_modifiers instead of type_traits.ctype. I'm sure there was a good reason for doing this, but changing it to just ctype seems to work for my codebase.