[PD] creb compilation error woes

Martin Peach martin.peach at sympatico.ca
Mon Sep 11 03:05:35 CEST 2006


Mathieu Bouchard wrote:
> On Sat, 9 Sep 2006, Martin Peach wrote:
>
>> Line 114 of blosc.cc is:
>
>> sum += _play_voice_lint(table, ctl->c_index+i, ctl->c_frac[i], 
>> ctl->c_vscale[i]);
>> You could probably change it to:
>> sum += _play_voice_lint(table, &ctl->c_index[i], ctl->c_frac[i], 
>> ctl->c_vscale[i]);
>> ...which avoids any confusion the compiler might have about what size 
>> of object is being pointed at. Martin
>
> The compiler isn't confused: in C/C++, changing whatever+i to 
> &whatever[i] never makes any difference to the type of the pointer.
>
You're right of course. The real problem seems to be that Thomas was 
using an older version of the file...In the version from cvs c_index is 
a t_int and _play_voice_lint expects a pointer to t_int, so it should 
work alright. The error was about converting a t_int* to an int*, which 
didn't make sense to me since no ints should be involved:
blosc.cc:114: error: invalid conversion from 't_int*' to 'int*'
blosc.cc:114: error:   initializing argument 2 of 'float 
_play_voice_lint(float*, int*, float, float)'
...but obviously the error explicitly states that _play_voice_lint 
expects an int* as the second argument, which is not the case in the 
latest version, which has:
static inline float _play_voice_lint(float *table, t_int *index, float 
frac, float scale)
So now I'm wondering if/why it ever worked at all before.
Martin

> in m_pd.h, t_int is typedefed as long, which means that in 64-bit 
> mode, using int in place of t_int or vice-versa may lead to crashes, 
> or weirdnesses like what happens when pd treats a t_word as a t_float 
> and vice-versa.
>
>  _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
> | Freelance Digital Arts Engineer, Montréal QC Canada
> ------------------------------------------------------------------------
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>   





More information about the Pd-list mailing list