Skip to content

Commit e7cb456

Browse files
committed
enum: Simplify function names
Signed-off-by: andypugh <andy@bodgesoc.org>
1 parent 49433d4 commit e7cb456

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

docs/src/man/man9/enum.9.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ E and D-type enumerations may be freely mixed in separate instances.
5454

5555
== FUNCTIONS
5656

57-
*enum-decode._NN_.decode* - if instance type = "D"
57+
*enum-decode._NN_* - if instance type = "D"
5858

59-
*enum-encode._NN_.encode* - if instance type = "E"
59+
*enum-encode._NN_* - if instance type = "E"
6060

6161
== PINS
6262

src/hal/components/enum.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ int rtapi_app_main(void){
100100
for (i = 0; i < e.num_insts; i++){
101101
enum_inst_t *inst = &(e.insts[i]);
102102
char this[HAL_NAME_LEN];
103-
char func[HAL_NAME_LEN];
104103

105104
// Count the pins
106105
inst->num_pins = 0;
@@ -165,11 +164,9 @@ int rtapi_app_main(void){
165164
}
166165
}
167166
if (inst->dir == HAL_OUT){
168-
retval = rtapi_snprintf(func, HAL_NAME_LEN, "%s.decode", this);
169-
hal_export_funct(func, decode, inst, 0, 0, comp_id);
167+
hal_export_funct(this, decode, inst, 0, 0, comp_id);
170168
} else {
171-
retval = rtapi_snprintf(func, HAL_NAME_LEN, "%s.encode", this);
172-
hal_export_funct(func, encode, inst, 0, 0, comp_id);
169+
hal_export_funct(this, encode, inst, 0, 0, comp_id);
173170
}
174171
if (retval < 0){
175172
rtapi_print_msg(RTAPI_MSG_ERR, "Failed to export functions\n");

0 commit comments

Comments
 (0)