-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce hal_export_functf() #2774
Conversation
…ion; eliminate rtapi_snprintf() by using new hal_export_functf()
This seems like a great deal of trouble to have gone to to save a few keystrokes on the rare occasions that someone writes a new HAL component. |
Absolutely not. Any decent IDE should make such a PR an easy task. (I would still betatest such a PR before including it in a stable release ;)
This surely isn't the best example since it's not a critical part of the code (I don't feel familiar enough with linuxcnc for that yet) but I see multiple reasons beyond saving keystrokes why cleanups like this are important for a codebase in general:
Adding HAL components probably will be the only thing in linuxcnc that cannot ever be feature complete. As long as people build new hardware, there's new HAL components, right? The project should encourage new components and strive for a feature complete API. |
Maybe I wasn't clear. I am not proposing to reject this, just expressing surprise that you chose this to work on when LinuxCNC is broken in so many other ways. |
ah! I'm sorry. I totally didn't get it.
That's actually an important point imho, hence I'll elaborate briefly: But currently I'm not profiting from fixing other stuff. Despite seeing potential for a lot of fun, working on the linuxcnc codebase on free time isn't exactly fun. |
To deduplicate some repeating code, this PR introduces a formatting
hal_export_functf()
similar to thehal_*_newf()
functions.Existing occurences of
static char buf[HAL_NAME_LEN+1]; ... ; rtapi_snprintf(buf, ...); hal_export_funct(buf, ...)
were replaced.Additionally, some unused/buggy code was removed from
boss_plc.c
.