diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-10-29 17:30:33 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-10-29 17:46:27 +0000 |
commit | 1b2c3e40678f01ac4e3c714d243f65642de254be (patch) | |
tree | a9ebb783172b43b6d8e45b9ab9ec54a5736ca401 /server | |
parent | 3c1ab4a5fa4ad10d034bcb96d1fd0a819640e4c8 (diff) | |
download | spice-1b2c3e40678f01ac4e3c714d243f65642de254be.tar.gz spice-1b2c3e40678f01ac4e3c714d243f65642de254be.tar.xz spice-1b2c3e40678f01ac4e3c714d243f65642de254be.zip |
worker: avoid to use constant directly for capabilities size
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server')
-rw-r--r-- | server/red_worker.c | 2 | ||||
-rw-r--r-- | server/spice-qxl.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/server/red_worker.c b/server/red_worker.c index 96c0f143..2b23ffdb 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -9802,7 +9802,7 @@ static void guest_set_client_capabilities(RedWorker *worker) DisplayChannelClient *dcc; RedChannelClient *rcc; RingItem *link, *next; - uint8_t caps[58] = { 0 }; + uint8_t caps[SPICE_CAPABILITIES_SIZE] = { 0 }; int caps_available[] = { SPICE_DISPLAY_CAP_SIZED_STREAM, SPICE_DISPLAY_CAP_MONITORS_CONFIG, diff --git a/server/spice-qxl.h b/server/spice-qxl.h index dd49a860..e1f14e77 100644 --- a/server/spice-qxl.h +++ b/server/spice-qxl.h @@ -24,6 +24,10 @@ #include "spice-core.h" +#ifndef SPICE_CAPABILITIES_SIZE +#define SPICE_CAPABILITIES_SIZE (sizeof(((QXLRom*)0)->client_capabilities)) +#endif + /* qxl interface */ #define SPICE_INTERFACE_QXL "qxl" @@ -175,7 +179,7 @@ struct QXLInterface { uint32_t num_updated_rects); void (*set_client_capabilities)(QXLInstance *qin, uint8_t client_present, - uint8_t caps[58]); + uint8_t caps[SPICE_CAPABILITIES_SIZE]); /* returns 1 if the interface is supported, 0 otherwise. * if monitors_config is NULL nothing is done except reporting the * return code. */ |