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 /include | |
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 'include')
-rw-r--r-- | include/cubeb/cubeb.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h index 449b39c..7a36b83 100644 --- a/include/cubeb/cubeb.h +++ b/include/cubeb/cubeb.h @@ -167,7 +167,7 @@ typedef enum { /** An opaque handle used to refer a particular input or output device * across calls. */ -typedef void * cubeb_devid; +typedef void const * cubeb_devid; /** Level (verbosity) of logging for a particular cubeb context. */ typedef enum { @@ -276,10 +276,10 @@ typedef enum { * `cubeb_device_info_destroy`. */ typedef struct { cubeb_devid devid; /**< Device identifier handle. */ - char * device_id; /**< Device identifier which might be presented in a UI. */ - char * friendly_name; /**< Friendly device name which might be presented in a UI. */ - char * group_id; /**< Two devices have the same group identifier if they belong to the same physical device; for example a headset and microphone. */ - char * vendor_name; /**< Optional vendor name, may be NULL. */ + char const * device_id; /**< Device identifier which might be presented in a UI. */ + char const * friendly_name; /**< Friendly device name which might be presented in a UI. */ + char const * group_id; /**< Two devices have the same group identifier if they belong to the same physical device; for example a headset and microphone. */ + char const * vendor_name; /**< Optional vendor name, may be NULL. */ cubeb_device_type type; /**< Type of device (Input/Output). */ cubeb_device_state state; /**< State of device disabled/enabled/unplugged. */ @@ -322,7 +322,7 @@ typedef struct { and the stream will enter a shutdown state. */ typedef long (* cubeb_data_callback)(cubeb_stream * stream, void * user_ptr, - const void * input_buffer, + void const * input_buffer, void * output_buffer, long nframes); @@ -347,7 +347,7 @@ typedef void (* cubeb_device_collection_changed_callback)(cubeb * context, void * user_ptr); /** User supplied callback called when a message needs logging. */ -typedef void (* cubeb_log_callback)(const char * fmt, ...); +typedef void (* cubeb_log_callback)(char const * fmt, ...); /** Initialize an application context. This will perform any library or application scoped initialization. |