[Spice-devel] [PATCH spice-server 1/3] red-stream-device: Constify stream_device_get_device_display_info result
Christophe Fergeau
cfergeau at redhat.com
Mon Feb 4 17:51:42 UTC 2019
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Mon, Feb 04, 2019 at 02:27:51PM +0000, Frediano Ziglio wrote:
> There should be no reason for the caller to modify the internal
> structure.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/red-stream-device.c | 2 +-
> server/red-stream-device.h | 2 +-
> server/reds.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/server/red-stream-device.c b/server/red-stream-device.c
> index 2a210cc7..70829fbf 100644
> --- a/server/red-stream-device.c
> +++ b/server/red-stream-device.c
> @@ -807,7 +807,7 @@ stream_device_init(StreamDevice *dev)
> dev->msg_len = sizeof(*dev->msg);
> }
>
> -StreamDeviceDisplayInfo *stream_device_get_device_display_info(StreamDevice *dev)
> +const StreamDeviceDisplayInfo *stream_device_get_device_display_info(StreamDevice *dev)
> {
> return &dev->device_display_info;
> }
> diff --git a/server/red-stream-device.h b/server/red-stream-device.h
> index d7ab5e41..aa2b23a2 100644
> --- a/server/red-stream-device.h
> +++ b/server/red-stream-device.h
> @@ -56,7 +56,7 @@ StreamDevice *stream_device_connect(RedsState *reds, SpiceCharDeviceInstance *si
> */
> void stream_device_create_channel(StreamDevice *dev);
>
> -StreamDeviceDisplayInfo *stream_device_get_device_display_info(StreamDevice *dev);
> +const StreamDeviceDisplayInfo *stream_device_get_device_display_info(StreamDevice *dev);
>
> /**
> * Returns -1 if the StreamDevice doesn't have a channel yet.
> diff --git a/server/reds.c b/server/reds.c
> index 87715c48..24047bda 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -978,7 +978,7 @@ void reds_send_device_display_info(RedsState *reds)
> GLIST_FOREACH(reds->char_devices, RedCharDevice, dev) {
> if (IS_STREAM_DEVICE(dev)) {
> StreamDevice *stream_dev = STREAM_DEVICE(dev);
> - StreamDeviceDisplayInfo *info = stream_device_get_device_display_info(stream_dev);
> + const StreamDeviceDisplayInfo *info = stream_device_get_device_display_info(stream_dev);
> size_t device_address_len = strlen(info->device_address);
>
> if (device_address_len == 0) {
> --
> 2.20.1
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190204/9a0029b3/attachment-0001.sig>
More information about the Spice-devel
mailing list