Looks like a good place to use the $T macro instead.  That guy DeForest looks 
like kind of a hack…

> On Sep 3, 2015, at 10:19 AM, Karl Glazebrook <karlglazebr...@mac.com> wrote:
> 
> Hi Chris
> 
> 
> It’s this cheesy code in ufunc.pd
> 
> pp_def( 
>       'average',
>       HandleBad => 1,
>       Pars => 'a(n); int+ [o]b();',
>       Code => 
>       '$GENERIC(b) tmp = 0;
>       if($SIZE(n)) {
>          loop(n) %{ tmp += $a(); %} ; 
>          $b() = tmp / ($GENERIC(b)) $SIZE(n);
>      }
>        else { $GENERIC(b) foo = 0.25; 
>                if(foo == 0) {  /* Cheesy check for floating-pointiness */
>                    $b() = 0;   /* Integer - set to 0 */
>                 } else {
>                    $b() = sqrt(-1);  /* Cheesy NaN -- CED */
>                }
>               }',
> 
>       BadCode => 
>       '$GENERIC(b) tmp = 0;
>       PDL_Indx cnt = 0;
>        loop(n) %{ 
>          if ( $ISGOOD(a()) ) { tmp += $a(); cnt++; }
>       %}
>       if ( cnt ) { $b() = tmp / ($GENERIC(b)) cnt; }
>       else       { $SETBAD(b()); }',
>       Doc => projectdocs( 'average', 'average', '' ),
>       );
> 
> 
> Needs to be an explicit conversion
> 
> Karl
> 
> 
> 
> 
>> On 31 Aug 2015, at 2:28 am, Chris Marshall <devel.chm...@gmail.com> wrote:
>> 
>> Hi Karl-
>> 
>> Could you post the code that goes with the warnings?
>> 
>> Also, kmx has fixed a number of the 64bit<->double issues in the 
>> longlong-double-fix
>> branch.  Do you get the same warnings from that?  I've re-added pdl-devel to 
>> the
>> cc list, don't know how it dropped off...
>> 
>> --Chris
>> 
>> On 8/28/2015 23:35, Karl Glazebrook wrote:
>>> Got some strange warnings on OS X build?
>>> 
>>> 
>>> 
>>> ——
>>> 
>>> func.xs:17517:33: warning: implicit conversion from 'double' to 'PDL_Long' 
>>> (aka 'int') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_Long foo = 0.25;
>>>                        ~~~   ^~~~
>>> Ufunc.xs:17624:33: warning: implicit conversion from 'double' to 'PDL_Long' 
>>> (aka 'int') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_Long foo = 0.25;
>>>                        ~~~   ^~~~
>>> Ufunc.xs:17731:33: warning: implicit conversion from 'double' to 'PDL_Long' 
>>> (aka 'int') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_Long foo = 0.25;
>>>                        ~~~   ^~~~
>>> Ufunc.xs:17838:33: warning: implicit conversion from 'double' to 'PDL_Long' 
>>> (aka 'int') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_Long foo = 0.25;
>>>                        ~~~   ^~~~
>>> Ufunc.xs:17945:33: warning: implicit conversion from 'double' to 'PDL_Indx' 
>>> (aka 'long') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_Indx foo = 0.25;
>>>                        ~~~   ^~~~
>>> Ufunc.xs:18052:37: warning: implicit conversion from 'double' to 
>>> 'PDL_LongLong' (aka 'long') changes value from 0.25 to 0
>>>    [-Wliteral-conversion]
>>>        else { PDL_LongLong foo = 0.25;
>>> 
>> 
> 
> 
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> pdl-devel mailing list
> pdl-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdl-devel


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to