Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.io.base
Commits
74f797e5
Commit
74f797e5
authored
9 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Corrected error cases in module creation
parent
de4cd846
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/io/base/main.cpp
+4
-3
4 additions, 3 deletions
bob/io/base/main.cpp
bob/io/base/version.cpp
+4
-4
4 additions, 4 deletions
bob/io/base/version.cpp
with
8 additions
and
7 deletions
bob/io/base/main.cpp
+
4
−
3
View file @
74f797e5
...
@@ -84,11 +84,13 @@ static PyObject* create_module (void) {
...
@@ -84,11 +84,13 @@ static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
# if PY_VERSION_HEX >= 0x03000000
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
auto
m_
=
make_xsafe
(
m
);
const
char
*
ret
=
"O"
;
# else
# else
PyObject
*
m
=
Py_InitModule3
(
BOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
PyObject
*
m
=
Py_InitModule3
(
BOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
const
char
*
ret
=
"N"
;
# endif
# endif
if
(
!
m
)
return
0
;
if
(
!
m
)
return
0
;
auto
m_
=
make_safe
(
m
);
/* register some constants */
/* register some constants */
if
(
!
init_File
(
m
))
return
0
;
if
(
!
init_File
(
m
))
return
0
;
...
@@ -164,8 +166,7 @@ static PyObject* create_module (void) {
...
@@ -164,8 +166,7 @@ static PyObject* create_module (void) {
/* imports dependencies */
/* imports dependencies */
if
(
import_bob_blitz
()
<
0
)
return
0
;
if
(
import_bob_blitz
()
<
0
)
return
0
;
return
Py_BuildValue
(
"O"
,
m
);
return
Py_BuildValue
(
ret
,
m
);
}
}
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
bob/io/base/version.cpp
+
4
−
4
View file @
74f797e5
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
* @brief Binds configuration information available from bob
* @brief Binds configuration information available from bob
*/
*/
#define BOB_IMPORT_VERSION
#define BOB_IMPORT_VERSION
#include
<bob.blitz/config.h>
#include
<bob.blitz/config.h>
#include
<bob.blitz/cleanup.h>
#include
<bob.blitz/cleanup.h>
...
@@ -53,11 +52,13 @@ static PyObject* create_module (void) {
...
@@ -53,11 +52,13 @@ static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
# if PY_VERSION_HEX >= 0x03000000
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
auto
m_
=
make_xsafe
(
m
);
const
char
*
ret
=
"O"
;
# else
# else
PyObject
*
m
=
Py_InitModule3
(
BOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
PyObject
*
m
=
Py_InitModule3
(
BOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
const
char
*
ret
=
"N"
;
# endif
# endif
if
(
!
m
)
return
0
;
if
(
!
m
)
return
0
;
auto
m_
=
make_safe
(
m
);
///< protects against early returns
/* register version numbers and constants */
/* register version numbers and constants */
if
(
PyModule_AddIntConstant
(
m
,
"api"
,
BOB_IO_BASE_API_VERSION
)
<
0
)
if
(
PyModule_AddIntConstant
(
m
,
"api"
,
BOB_IO_BASE_API_VERSION
)
<
0
)
...
@@ -69,8 +70,7 @@ static PyObject* create_module (void) {
...
@@ -69,8 +70,7 @@ static PyObject* create_module (void) {
// call bob_io_base_version once to avoid compiler warning
// call bob_io_base_version once to avoid compiler warning
auto
_
=
make_safe
(
bob_io_base_version
());
auto
_
=
make_safe
(
bob_io_base_version
());
return
Py_BuildValue
(
"O"
,
m
);
return
Py_BuildValue
(
ret
,
m
);
}
}
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment