diff options
author | Matthew Gregan <[email protected]> | 2016-11-01 23:54:01 +1300 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2016-11-08 16:46:48 +0100 |
commit | 7ac08e01b01a665d73496ef0679be49716cf10cf (patch) | |
tree | a7ab7b2d465bbb4a5beb5813b573aef75b624850 /src/cubeb.c | |
parent | f8467510a8b36793b1b8b7e85461e2e189eb7015 (diff) | |
download | cubeb-7ac08e01b01a665d73496ef0679be49716cf10cf.tar.gz cubeb-7ac08e01b01a665d73496ef0679be49716cf10cf.zip |
Make API visible cubeb_device_info members and cubeb_devid const.
The API user is never permitted to modify these (nor deallocate them
directly, which non-const can imply), so they should marked const in the
public definition.
I suspect this happened originally because free()ing the
cubeb_device_info members requires casting const away in
cubeb_device_info_destroy, but other than being slightly ugly there's no
problem doing that and it's better to have the public API be consistent.
This also allows fixing the const-ness of utf8_to_wstr and wstr_to_utf8
const in cubeb_wasapi.cpp.
Diffstat (limited to 'src/cubeb.c')
-rw-r--r-- | src/cubeb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cubeb.c b/src/cubeb.c index e0375c3..6a32029 100644 --- a/src/cubeb.c +++ b/src/cubeb.c @@ -514,10 +514,10 @@ int cubeb_device_info_destroy(cubeb_device_info * info) return CUBEB_ERROR_INVALID_PARAMETER; } - free(info->device_id); - free(info->friendly_name); - free(info->group_id); - free(info->vendor_name); + free((void *) info->device_id); + free((void *) info->friendly_name); + free((void *) info->group_id); + free((void *) info->vendor_name); free(info); return CUBEB_OK; |