[Spice-commits] 2 commits - server/reds.c server/reds-private.h
Frediano Ziglio
fziglio at kemper.freedesktop.org
Mon Feb 1 07:25:42 PST 2016
server/reds-private.h | 2 --
server/reds.c | 16 ++++++++--------
2 files changed, 8 insertions(+), 10 deletions(-)
New commits:
commit 3cc00f12075cc8dbe731a9cde20afdd2333bc303
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Jan 30 05:05:32 2016 +0000
reds: constify renderers_info array
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/reds.c b/server/reds.c
index 120d385..7aa5122 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3442,7 +3442,7 @@ typedef struct RendererInfo {
const char *name;
} RendererInfo;
-static RendererInfo renderers_info[] = {
+static const RendererInfo renderers_info[] = {
{RED_RENDERER_SW, "sw"},
{RED_RENDERER_INVALID, NULL},
};
@@ -3450,9 +3450,9 @@ static RendererInfo renderers_info[] = {
uint32_t renderers[RED_RENDERER_LAST];
uint32_t num_renderers = 0;
-static RendererInfo *find_renderer(const char *name)
+static const RendererInfo *find_renderer(const char *name)
{
- RendererInfo *inf = renderers_info;
+ const RendererInfo *inf = renderers_info;
while (inf->name) {
if (strcmp(name, inf->name) == 0) {
return inf;
@@ -3464,7 +3464,7 @@ static RendererInfo *find_renderer(const char *name)
static int red_add_renderer(const char *name)
{
- RendererInfo *inf;
+ const RendererInfo *inf;
if (num_renderers == RED_RENDERER_LAST || !(inf = find_renderer(name))) {
return FALSE;
commit e940ba1fe78a3d275d5b568aa751089618a6dc24
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Jan 30 05:04:56 2016 +0000
reds: remove default_renderer as field
Was used to just assure there was at least one renderer in the list.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index b154a92..fda613d 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -191,8 +191,6 @@ struct RedsState {
int mm_time_enabled;
uint32_t mm_time_latency;
- const char *default_renderer;
-
int spice_port;
int spice_secure_port;
SpiceCharDeviceInstance *vdagent;
diff --git a/server/reds.c b/server/reds.c
index 09fb56e..120d385 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3415,6 +3415,8 @@ err:
return -1;
}
+static const char default_renderer[] = "sw";
+
/* new interface */
SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
{
@@ -3422,7 +3424,6 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
spice_assert(reds == NULL);
reds = spice_new0(RedsState, 1);
- reds->default_renderer = "sw";
reds->spice_port = -1;
reds->spice_secure_port = -1;
reds->spice_listen_socket_fd = -1;
@@ -3478,8 +3479,8 @@ SPICE_GNUC_VISIBLE int spice_server_init(SpiceServer *s, SpiceCoreInterface *cor
spice_assert(reds == s);
ret = do_spice_init(s, core);
- if (s->default_renderer) {
- red_add_renderer(s->default_renderer);
+ if (num_renderers == 0) {
+ red_add_renderer(default_renderer);
}
return ret;
}
@@ -3775,7 +3776,6 @@ SPICE_GNUC_VISIBLE int spice_server_add_renderer(SpiceServer *s, const char *nam
if (!red_add_renderer(name)) {
return -1;
}
- s->default_renderer = NULL;
return 0;
}
More information about the Spice-commits
mailing list