Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Sebastian Kuzminsky
On 10/24/2013 10:09 PM, Robert Ellenberg wrote: > Thanks for your input. I think you're right about the second "const". I > added it for the extra checking from the compiler, to prevent the dumb > bugs from accidentally changing pointer. It's a lot of extra verbiage > just for that one benefit, tho

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Robert Ellenberg
Hi Sebastian, Thanks for your input. I think you're right about the second "const". I added it for the extra checking from the compiler, to prevent the dumb bugs from accidentally changing pointer. It's a lot of extra verbiage just for that one benefit, though. The reason I put the const after th

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Sebastian Kuzminsky
On 10/24/2013 11:23 AM, Robert Ellenberg wrote: > It seems like the "right" way is to pass pure inputs by reference using > constant pointers: I almost agree! I think the right way to pass big inputs is to use pointers to constant memory. > Instead of this: > > pmCartCartDot(PmCartesian v1,

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Sebastian Kuzminsky
On 10/24/2013 01:02 PM, Jeff Epler wrote: > The main problem would be if there are any out-of-tree users of these > routines. Since it's C there's no function overloading, so we can't > provide both signatures under the same name. So that means the > alternatives are something like: > * do noth

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Kent A. Reed
On 10/24/2013 3:19 PM, Robert Ellenberg wrote: > That's a good point about the out-of-tree users, though I wonder if it > would be better for them to use a standalone libnml version. If there's a > lot of pushback from other users, I can make the few call-by-reference > changes I need under a diffe

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Robert Ellenberg
That's a good point about the out-of-tree users, though I wonder if it would be better for them to use a standalone libnml version. If there's a lot of pushback from other users, I can make the few call-by-reference changes I need under a different name. To be clear, a total overhaul isn't strictl

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Jeff Epler
The main problem would be if there are any out-of-tree users of these routines. Since it's C there's no function overloading, so we can't provide both signatures under the same name. So that means the alternatives are something like: * do nothing * break out-of-tree users * provide the call-by

Re: [Emc-developers] PoseMath pass-by-value question

2013-10-24 Thread Kent A. Reed
On 10/24/2013 1:23 PM, Robert Ellenberg wrote: > Hi All, > > Many posemath functions (like pmCartCartDot, for example) pass compound > data types like PmCartesion and PmPose by value. Is there a specific reason > for this design choice? > > Robert: The posemath library predates LinuxCNC by a numb