[PD-dev] bitwise magic in OSS-backend
IOhannes m zmölnig
zmoelnig at iem.at
Wed Mar 16 11:06:47 CET 2016
while running Pd through some static code analysis, i stumbled upon the
following in s_audio_oss.c:322-325
~~~
if ((flags = fcntl(fd, F_GETFL)) < 0)
post("couldn't get audio device flags");
else if (fcntl(fd, F_SETFL, flags & (!O_NDELAY)) < 0)
post("couldn't set audio device flags");
~~~
i guess this is meant to put the device into blocking-mode (without
changing other device settings), so Pd could use it as a time-source,
but shouldn't it then read :
flags & (~O_NDELAY)
i guess the OSS code has not been used for a while, and probably the
'flags' only ever contained the O_NDELAY bit (if any), so it haven't
made much of a difference...
fmads
IOhannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20160316/08b3827f/attachment-0001.sig>
More information about the Pd-dev
mailing list