[pulseaudio-discuss] [patches] constification round #3
jnqnfe at gmail.com
jnqnfe at gmail.com
Thu Jun 7 04:01:46 UTC 2018
API constification set #3
Some API functions perform validation routines which may modify the
'error' attribute of a context object. For API functions where the
"primary" object is not a context object, and the object holds a non-
const context pointer, this internal mechanism could be successfully
hidden - such functions were constified in my previous two patch sets.
However, some functions, namely those related directly to context
objects, had to be passed over previously. These could not be
constified because the validation routines accessed the context object
directly to change the error attribute.
This patch set addresses this shortcoming.
Firstly the patch set moves the context's error attribute behind a
pointer. The validation routines are then changed to store the error
value via this pointer. That then allows a collection of further API
functions to be constified.
(actually pa_context_errno and the two rttime ones could have been done
previously on second inspection)
Although the indirection of the error attribute is obviously ever so
slightly worse off for efficiency, it is surely worth the price. After
all, the error setting of the validation checks is just an artifact of
an internal mechanism and should not be allowed to influence the public
API like it currently does.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01.patch
Type: text/x-patch
Size: 2122 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02.patch
Type: text/x-patch
Size: 1658 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0013.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03.patch
Type: text/x-patch
Size: 3123 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0014.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 04.patch
Type: text/x-patch
Size: 1179 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0015.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 05.patch
Type: text/x-patch
Size: 1201 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0016.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06.patch
Type: text/x-patch
Size: 1361 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0017.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 07.patch
Type: text/x-patch
Size: 1224 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0018.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 08.patch
Type: text/x-patch
Size: 1277 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0019.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 09.patch
Type: text/x-patch
Size: 1272 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0020.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10.patch
Type: text/x-patch
Size: 1356 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0021.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0022.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 12.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180607/fb1b0b20/attachment-0023.bin>
More information about the pulseaudio-discuss
mailing list