$a and $b are problematic in relation to "use strict" because they are exceptions; they are grandfathered in as always "ok" because they are the special variables used in "sort" functions. If you must have generic variable names, PLEASE use $x and $y etc. Even better, take a moment, and have mercy on the poor individual who will try to read your code in the future (possibly yourself!) and name your variables.
A *.pd file can be "use strict" if you put that at the top, since it's fundamentally just a Perl script. -----Original Message----- From: Craig DeForest Sent: Wednesday, April 15, 2015 4:39 AM To: Derek Lamb Cc: pdl-devel Subject: Re: [Pdl-devel] 2 slices.pd questions That "$a = " appears to be my problem, since it's my commit. It is "harmless". I would've expected it to be nailed by "use strict" - but I don't think the environment in which the pp_def call is running, is using strict. The "IV" declaration should probably be changed to a "STRLEN". The "len" variable is just a dummy to work with Perl's SvPVbyte macro. That macro needs an lvalue to receive the length field. It could probably be replaced with "svpvbyte_nolen", but I bet the len gets optimized out by the compiler anyway. > On Apr 14, 2015, at 5:20 PM, Derek Lamb <de...@boulder.swri.edu> wrote: > > 1) In the current git, where index() is pp_def'd in slices.pd, there is a > funny > > $a = BadCode => > > at line 239 that I don't understand. It was introduced by this commit > [1]. My guess is the $a is wrong but harmless, but I wanted to check. > > 2) Also at line 3238 of slices.pd there is a declaration > > IV len; > > When it gets used (the only time) a few lines down in > > s = SvPVbyte(this, len); > > I get a compiler warning about comparing signed vs unsigned pointers. > Specifically > > "warning: passing 'IV *' (aka 'long *') to parameter of type 'STRLEN *' > (aka 'unsigned long *') converts between pointers to integer types with > different sign [-Wpointer-sign]" > > Changing that declaration to 'UV len;' makes the compiler warning go away, > and it seems to make sense that len should be >=0, but I'm loathe to fix > it without understanding what's going on. I remember seeing a note > somewhere (a comment in code? in a commit log?) about UVs and portability > (having to do with either Rob/Sisyphus or Judd Taylor), but I my git-log > fu is limited and of no help at the moment. So I'm punting. > > [1] > http://sourceforge.net/p/pdl/code/ci/5fa25a501c6761f7e01960dc35bf6beefada24a6/ > > Derek > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live > exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > pdl-devel mailing list > pdl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-devel > ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ pdl-devel mailing list pdl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-devel ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ pdl-devel mailing list pdl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-devel