Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.4
kvm.853
kvm-qemu-preXX-vnc-palette-add-palette_init-cal...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kvm-qemu-preXX-vnc-palette-add-palette_init-calls.patch of Package kvm.853
From 72aefb76f9268bec6eeb60530fd523b60effe610 Mon Sep 17 00:00:00 2001 From: Corentin Chary <corentincj@iksaif.net> Date: Fri, 4 Feb 2011 09:05:59 +0100 Subject: [PATCH] vnc: palette: add palette_init calls This allow to use palette on the stack instead of always allocating them. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- ui/vnc-palette.c | 8 +++++++- ui/vnc-palette.h | 1 + 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index c47420b..f93250b 100644 --- a/ui/vnc-palette.c +++ b/ui/vnc-palette.c @@ -56,9 +56,15 @@ VncPalette *palette_new(size_t max, int bpp) VncPalette *palette; palette = qemu_mallocz(sizeof(*palette)); + palette_init(palette, max, bpp); + return palette; +} + +void palette_init(VncPalette *palette, size_t max, int bpp) +{ + memset(palette, 0, sizeof (*palette)); palette->max = max; palette->bpp = bpp; - return palette; } void palette_destroy(VncPalette *palette) diff --git a/ui/vnc-palette.h b/ui/vnc-palette.h index f57d0e7..c646e4d 100644 --- a/ui/vnc-palette.h +++ b/ui/vnc-palette.h @@ -51,6 +51,7 @@ typedef struct VncPalette { } VncPalette; VncPalette *palette_new(size_t max, int bpp); +void palette_init(VncPalette *palette, size_t max, int bpp); void palette_destroy(VncPalette *palette); int palette_put(VncPalette *palette, uint32_t color); -- 1.6.0.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor