It should probably be a tagged union. https://en.m.wikipedia.org/wiki/Tagged_union
-- Sebastian Kuzminsky On Fri, Dec 31, 2021, 09:22 andy pugh <bodge...@gmail.com> wrote: > > https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/motion.h#L216 > > Basically the command to be executed goes in the command field, and > then the system chooses the data fields that it wants to look at. > > But it seems rather wasteful. Would it not be more sensible to simply > have "enough" doubles, ints, bools etc for each command, with generic > names ("double_1" for example) > > As things stand, every time a new command is added, a few more > variables get added to the struct, to be used once or never every > run.... > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > — George Fitch, Atlanta Constitution Newspaper, 1912 > > > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers