Skip to content

Commit 0276824

Browse files
jeplerpetterreinholdtsen
authored andcommitted
halmodule: better check for HAL being initialized
.. the old check, SHMPTR(0), will become a compile error soon since this file is C++ and 0 carries no type information. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
1 parent 7da442e commit 0276824

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/hal/halmodule.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ static PyObject * pyhal_pin_new(halitem * pin, const char * name) {
773773
PyObject *pin_has_writer(PyObject *self, PyObject *args) {
774774
char *name;
775775
if(!PyArg_ParseTuple(args, "s", &name)) return NULL;
776-
if(!SHMPTR(0)) {
776+
if(!hal_shmem_base) {
777777
PyErr_Format(PyExc_RuntimeError,
778778
"Cannot call before creating component");
779779
return NULL;
@@ -797,7 +797,7 @@ PyObject *pin_has_writer(PyObject *self, PyObject *args) {
797797
PyObject *component_exists(PyObject *self, PyObject *args) {
798798
char *name;
799799
if(!PyArg_ParseTuple(args, "s", &name)) return NULL;
800-
if(!SHMPTR(0)) {
800+
if(!hal_shmem_base) {
801801
PyErr_Format(PyExc_RuntimeError,
802802
"Cannot call before creating component");
803803
return NULL;
@@ -809,7 +809,7 @@ PyObject *component_exists(PyObject *self, PyObject *args) {
809809
PyObject *component_is_ready(PyObject *self, PyObject *args) {
810810
char *name;
811811
if(!PyArg_ParseTuple(args, "s", &name)) return NULL;
812-
if(!SHMPTR(0)) {
812+
if(!hal_shmem_base) {
813813
PyErr_Format(PyExc_RuntimeError,
814814
"Cannot call before creating component");
815815
return NULL;
@@ -824,7 +824,7 @@ PyObject *new_sig(PyObject *self, PyObject *args) {
824824
char *name;
825825
int type,retval;
826826
if(!PyArg_ParseTuple(args, "si", &name,&type)) return NULL;
827-
if(!SHMPTR(0)) {
827+
if(!hal_shmem_base) {
828828
PyErr_Format(PyExc_RuntimeError,
829829
"Cannot call before creating component");
830830
return NULL;
@@ -853,7 +853,7 @@ PyObject *new_sig(PyObject *self, PyObject *args) {
853853
PyObject *connect(PyObject *self, PyObject *args) {
854854
char *signame,*pinname;
855855
if(!PyArg_ParseTuple(args, "ss", &pinname,&signame)) return NULL;
856-
if(!SHMPTR(0)) {
856+
if(!hal_shmem_base) {
857857
PyErr_Format(PyExc_RuntimeError,
858858
"Cannot call before creating component");
859859
return NULL;
@@ -941,7 +941,7 @@ PyObject *set_p(PyObject *self, PyObject *args) {
941941
void *d_ptr;
942942

943943
if(!PyArg_ParseTuple(args, "ss", &name,&value)) return NULL;
944-
if(!SHMPTR(0)) {
944+
if(!hal_shmem_base) {
945945
PyErr_Format(PyExc_RuntimeError,
946946
"Cannot call before creating component");
947947
return NULL;

0 commit comments

Comments
 (0)