Skip to content

Commit 5d787ca

Browse files
Update patch to the latest changes to master.
1 parent ae0b949 commit 5d787ca

3 files changed

Lines changed: 12 additions & 22 deletions

File tree

src/hal/hal_priv.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,6 @@ static_assert(sizeof(hal_shmfield<void>) == sizeof(int), "hal_shmfield size matc
202202
* PRIVATE HAL DATA STRUCTURES AND DECLARATIONS *
203203
************************************************************************/
204204

205-
/** HAL "data union" structure
206-
** This structure may hold any type of hal data
207-
*/
208-
typedef union hal_data_u {
209-
hal_bit_t b;
210-
hal_s32_t s;
211-
hal_u32_t u;
212-
hal_float_t f;
213-
} hal_data_u;
214-
215205
/** HAL "list element" data structure.
216206
This structure is used to implement generic double linked circular
217207
lists. Such lists have the following characteristics:

src/hal/halmodule.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ PyObject *connect(PyObject *self, PyObject *args) {
865865
PyObject *disconnect(PyObject *self, PyObject *args) {
866866
char *pinname;
867867
if(!PyArg_ParseTuple(args, "s", &pinname)) return NULL;
868-
if(!SHMPTR(0)) {
868+
if(!hal_shmem_base) {
869869
PyErr_Format(PyExc_RuntimeError,
870870
"Cannot call before creating component");
871871
return NULL;
@@ -1008,7 +1008,7 @@ PyObject *get_value(PyObject *self, PyObject *args) {
10081008
void *d_ptr;
10091009

10101010
if(!PyArg_ParseTuple(args, "s", &name)) return NULL;
1011-
if(!SHMPTR(0)) {
1011+
if(!hal_shmem_base) {
10121012
PyErr_Format(PyExc_RuntimeError,
10131013
"Cannot call before creating component");
10141014
return NULL;
@@ -1085,7 +1085,7 @@ PyObject *get_value(PyObject *self, PyObject *args) {
10851085
/*######################################*/
10861086
/* Get a dict of pin info for all pins in system */
10871087
PyObject *get_info_pins(PyObject *self, PyObject *args) {
1088-
int next;
1088+
SHMFIELD(hal_pin_t) next;
10891089
int type;
10901090
char str_n[] = "NAME";
10911091
char str_v[] = "VALUE";
@@ -1099,7 +1099,7 @@ PyObject *get_info_pins(PyObject *self, PyObject *args) {
10991099
PyObject* python_list = PyList_New(0);
11001100
PyObject *obj;
11011101

1102-
if(!SHMPTR(0)) {
1102+
if(!hal_shmem_base) {
11031103
PyErr_Format(PyExc_RuntimeError,
11041104
"Cannot call before creating component");
11051105
return NULL;
@@ -1109,7 +1109,7 @@ PyObject *get_info_pins(PyObject *self, PyObject *args) {
11091109
rtapi_mutex_get(&(hal_data->mutex));
11101110
next = hal_data->pin_list_ptr;
11111111
while (next != 0) {
1112-
pin = (hal_pin_t*)SHMPTR(next);
1112+
pin = SHMPTR(next);
11131113
type = pin->type;
11141114
if (pin->signal != 0) {
11151115
sig = (hal_sig_t*)SHMPTR(pin->signal);
@@ -1174,7 +1174,7 @@ PyObject *get_info_pins(PyObject *self, PyObject *args) {
11741174
/*######################################*/
11751175
/* Get a dict of signal info for all signals in system */
11761176
PyObject *get_info_signals(PyObject *self, PyObject *args) {
1177-
int next;
1177+
SHMFIELD(hal_sig_t) next;
11781178
int type;
11791179
char str_n[] = "NAME";
11801180
char str_v[] = "VALUE";
@@ -1186,7 +1186,7 @@ PyObject *get_info_signals(PyObject *self, PyObject *args) {
11861186
PyObject* python_list = PyList_New(0);
11871187
PyObject *obj;
11881188

1189-
if(!SHMPTR(0)) {
1189+
if(!hal_shmem_base) {
11901190
PyErr_Format(PyExc_RuntimeError,
11911191
"Cannot call before creating component");
11921192
return NULL;
@@ -1196,7 +1196,7 @@ PyObject *get_info_signals(PyObject *self, PyObject *args) {
11961196
rtapi_mutex_get(&(hal_data->mutex));
11971197
next = hal_data->sig_list_ptr;
11981198
while (next != 0) {
1199-
sig = (hal_sig_t*)SHMPTR(next);
1199+
sig = SHMPTR(next);
12001200
type = sig->type;
12011201
d_ptr = SHMPTR(sig->data_ptr);
12021202

@@ -1259,7 +1259,7 @@ PyObject *get_info_signals(PyObject *self, PyObject *args) {
12591259
/*######################################*/
12601260
/* Get a dict of parameter info for all parameters in system */
12611261
PyObject *get_info_params(PyObject *self, PyObject *args) {
1262-
int next;
1262+
SHMFIELD(hal_param_t) next;
12631263
int type;
12641264
char str_n[] = "NAME";
12651265
char str_v[] = "VALUE";
@@ -1269,7 +1269,7 @@ PyObject *get_info_params(PyObject *self, PyObject *args) {
12691269
PyObject* python_list = PyList_New(0);
12701270
PyObject *obj;
12711271

1272-
if(!SHMPTR(0)) {
1272+
if(!hal_shmem_base) {
12731273
PyErr_Format(PyExc_RuntimeError,
12741274
"Cannot call before creating component");
12751275
return NULL;
@@ -1279,7 +1279,7 @@ PyObject *get_info_params(PyObject *self, PyObject *args) {
12791279
rtapi_mutex_get(&(hal_data->mutex));
12801280
next = hal_data->param_list_ptr;
12811281
while (next != 0) {
1282-
param = (hal_param_t*)SHMPTR(next);
1282+
param = SHMPTR(next);
12831283
type = param->type;
12841284
d_ptr = SHMPTR(param->data_ptr);
12851285

src/hal/utils/halcmd_commands.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ static void save_unconnected_input_pin_values(FILE *dst)
27912791
{
27922792
hal_pin_t *pin;
27932793
void *dptr;
2794-
int next;
2794+
SHMFIELD(hal_pin_t) next;
27952795
fprintf(dst, "# unconnected pin values\n");
27962796
for(next = hal_data->pin_list_ptr; next; next=pin->next_ptr)
27972797
{

0 commit comments

Comments
 (0)