@@ -412,7 +412,7 @@ public PythonObject
412412private:
413413 size_t size (leftv iter, size_t distance = 0 ) const
414414 {
415- if (iter) { do { ++distance; } while (iter = iter->next ); };
415+ if (iter) { do { ++distance; } while (( iter = iter->next ) ); };
416416 return distance;
417417 }
418418
@@ -462,7 +462,7 @@ BOOLEAN python_run(leftv result, leftv arg)
462462 PyRun_SimpleString (reinterpret_cast <const char *>(arg->Data ()));
463463 sync_contexts ();
464464
465- Py_XINCREF (Py_None);
465+ Py_INCREF (Py_None);
466466 return PythonCastStatic<>(Py_None).assign_to (result);
467467}
468468
@@ -495,14 +495,14 @@ BOOLEAN python_import(leftv result, leftv value) {
495495 from_module_import_all (reinterpret_cast <const char *>(value->Data ()));
496496 sync_contexts ();
497497
498- Py_XINCREF (Py_None);
498+ Py_INCREF (Py_None);
499499 return PythonCastStatic<>(Py_None).assign_to (result);
500500}
501501
502502// / blackbox support - initialization
503503void * pyobject_Init (blackbox*)
504504{
505- Py_XINCREF (Py_None);
505+ Py_INCREF (Py_None);
506506 return Py_None;
507507}
508508
@@ -714,11 +714,10 @@ blackbox* pyobject_blackbox(int& tok) {
714714
715715
716716#define PYOBJECT_ADD_C_PROC (name ) \
717- add_C_proc ((currPack->libname? currPack->libname: " " ), (char *)#name, FALSE , name);
717+ psModulFunctions->iiAddCproc ((currPack->libname? currPack->libname: " " ),\
718+ (char *)#name, FALSE , name);
718719
719- typedef BOOLEAN (*func_type)(leftv, leftv);
720- void pyobject_init (int (*add_C_proc)(const char *, const char *, BOOLEAN,
721- func_type) )
720+ int pyobject_mod_init (SModulFunctions* psModulFunctions)
722721{
723722 int tok = -1 ;
724723 blackbox* bbx = pyobject_blackbox (tok);
@@ -733,22 +732,23 @@ void pyobject_init(int (*add_C_proc)(const char*, const char*, BOOLEAN,
733732 bbx->blackbox_Op2 = pyobject_Op2;
734733 bbx->blackbox_Op3 = pyobject_Op3;
735734 bbx->blackbox_OpM = pyobject_OpM;
736- bbx->data = omAlloc0 (newstruct_desc_size ());
735+ bbx->data = ( void *) omAlloc0 (newstruct_desc_size ());
737736
738737 PythonInterpreter::init (tok);
739738
740739 PYOBJECT_ADD_C_PROC (python_import);
741740 PYOBJECT_ADD_C_PROC (python_eval);
742741 PYOBJECT_ADD_C_PROC (python_run);
743742 }
743+ return 0 ;
744744}
745745#undef PYOBJECT_ADD_C_PROC
746746
747747#ifndef EMBED_PYTHON
748748extern " C" {
749- void mod_init (SModulFunctions* psModulFunctions)
749+ int mod_init (SModulFunctions* psModulFunctions)
750750 {
751- pyobject_init (psModulFunctions-> iiAddCproc );
751+ return pyobject_mod_init (psModulFunctions);
752752 }
753753}
754754#endif
0 commit comments