Constify spice_server_char_device_recognized_subtypes

Users should not change the list of supported subtypes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-06-24 07:38:10 +01:00
parent c70b2067a9
commit 3b2fd86e8a
3 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@ AC_PREREQ([2.57])
# - If any interfaces have been removed or changed since the last public release,
# then set age to 0.
#
dnl TODO see server/spice-char.h TODO comment for API breakage
m4_define([SPICE_CURRENT], [12])
m4_define([SPICE_REVISION], [0])
m4_define([SPICE_AGE], [11])

View File

@ -3161,7 +3161,7 @@ SPICE_GNUC_VISIBLE void spice_server_char_device_wakeup(SpiceCharDeviceInstance*
#define SUBTYPE_USBREDIR "usbredir"
#define SUBTYPE_PORT "port"
static const char *spice_server_char_device_recognized_subtypes_list[] = {
static const char *const spice_server_char_device_recognized_subtypes_list[] = {
SUBTYPE_VDAGENT,
#ifdef USE_SMARTCARD
SUBTYPE_SMARTCARD,
@ -3172,7 +3172,7 @@ static const char *spice_server_char_device_recognized_subtypes_list[] = {
SPICE_GNUC_VISIBLE const char** spice_server_char_device_recognized_subtypes(void)
{
return spice_server_char_device_recognized_subtypes_list;
return (const char **) spice_server_char_device_recognized_subtypes_list;
}
static void reds_add_char_device(RedsState *reds, RedCharDevice *dev)

View File

@ -56,6 +56,7 @@ struct SpiceCharDeviceInstance {
void spice_server_char_device_wakeup(SpiceCharDeviceInstance *sin);
void spice_server_port_event(SpiceCharDeviceInstance *char_device, uint8_t event);
/* TODO change return to const char *const * when API break */
const char** spice_server_char_device_recognized_subtypes(void);
#endif /* SPICE_CHAR_H_ */