[PD] C externals in M1 give errors
IOhannes m zmoelnig
zmoelnig at iem.at
Tue Aug 16 10:09:53 CEST 2022
On 8/15/22 08:29, Jaime Oliver wrote:
>
> The specific error I'm getting right now is that it is reading that number
> 32 as 29. Again, this same code works fine in all other OSs I've tried.
>
> I'm assuming the issue is in the pow() function and all the typecasting
> (int), (double) as Chris suggested?
[...]
>
> int readbarfile(int a[][8], FILE *f) {
> int i, ii, j, jj, strsize, temp;
> char * line = NULL;
> size_t len = 0;
> ssize_t read;
> char ss[10];
> temp=j=0;
>
> ii=0;
> while ((read = getline(&line, &len, f)) != -1) {
[...]
my suggestion for a completely different approach:
rather than brewing your own file-reader: how about using [text] (or
whatever existing object you prefer) to parse the file contents into an
atom list and then use only messages to set the internal state of your
object?
in general this makes your object much more flexible, e.g. you can write
patches that do not need your "barfile" *at all, but instead store the
entire configuration in the patch.
gfasmdr
IOhannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20220816/2e9599b5/attachment.sig>
More information about the Pd-list
mailing list