Csound Csound-dev Csound-tekno Search About

[Cs-dev] Odd code in OOps/bus.c

Date2013-04-16 08:44
Fromjohn ffitch
Subject[Cs-dev] Odd code in OOps/bus.c
AttachmentsNone  None  
I am seeing a number of lines like

/home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c: In function ‘chani_opcode_perf_k’:
/home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c:129:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]

I think this comes from

    if (UNLIKELY(n < 0 || n > 999999999999999))
      return csound->PerfError(csound, Str("chani: invalid index"));

What is the intent?  I understand the n<0 but 999999999999999 is
larger than INT_MAX on mt 64bit computer.

Also

/home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c:126:11: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]

Surely there should be a call to PerfError?

This is not my area so am not sure what this is about

==John ffitch


Date2013-04-16 16:20
FromAndres Cabrera
SubjectRe: [Cs-dev] Odd code in OOps/bus.c
Thanks for checking. Now fixed.

Cheers,
Andrés

On Tue, Apr 16, 2013 at 12:44 AM, john ffitch  wrote:
> I am seeing a number of lines like
>
> /home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c: In function ‘chani_opcode_perf_k’:
> /home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c:129:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
>
> I think this comes from
>
>     if (UNLIKELY(n < 0 || n > 999999999999999))
>       return csound->PerfError(csound, Str("chani: invalid index"));
>
> What is the intent?  I understand the n<0 but 999999999999999 is
> larger than INT_MAX on mt 64bit computer.
>
> Also
>
> /home/jpff/Sourceforge/csound/New/csound6/OOps/bus.c:126:11: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
>
> Surely there should be a call to PerfError?
>
> This is not my area so am not sure what this is about
>
> ==John ffitch
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/