Csound Csound-dev Csound-tekno Search About

[Csnd-dev] type of locn

Date2017-05-29 15:54
Fromjpff
Subject[Csnd-dev] type of locn
I see that the type of the locn (line number in orc) as been changed from
32bit int to 64bit uint.  Why?  Who has orc with over 30K lines?

I would appreciate knowing  why the other type changes were made too.

Date2017-05-29 16:08
FromMichael Gogins
SubjectRe: [Csnd-dev] type of locn
I did not make these changes, but the compiler's default sizes for scalars, e.g. int and float or double, should be used for all scalars without some good reason to do otherwise. But they should be declared with explicit sizes if the size has some effect, e.g. int64_t. 

Best,
Mike

On May 29, 2017 10:54 AM, "jpff" <jpff@codemist.co.uk> wrote:
I see that the type of the locn (line number in orc) as been changed from
32bit int to 64bit uint.  Why?  Who has orc with over 30K lines?

I would appreciate knowing  why the other type changes were made too.

==John ffitch

Date2017-05-29 16:16
FromMichael Gogins
SubjectRe: [Csnd-dev] type of locn
In other words locn should be declared int unless some code needs to know the size in advance, in which case it should be uint32_t on 32 bit platforms and uint64_t on 64 bit platforms.

Csound doesn't follow good practice consistently in this regard.

Best,
Mike

On May 29, 2017 11:08 AM, "Michael Gogins" <michael.gogins@gmail.com> wrote:
I did not make these changes, but the compiler's default sizes for scalars, e.g. int and float or double, should be used for all scalars without some good reason to do otherwise. But they should be declared with explicit sizes if the size has some effect, e.g. int64_t. 

Best,
Mike

On May 29, 2017 10:54 AM, "jpff" <jpff@codemist.co.uk> wrote:
I see that the type of the locn (line number in orc) as been changed from
32bit int to 64bit uint.  Why?  Who has orc with over 30K lines?

I would appreciate knowing  why the other type changes were made too.

==John ffitch