summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/common.h3
-rw-r--r--client/glz_decoder_config.h18
-rw-r--r--common/cairo_canvas.c6
-rw-r--r--common/canvas_base.c8
-rw-r--r--common/canvas_utils.h8
-rw-r--r--common/gdi_canvas.c2
-rw-r--r--common/gl_canvas.c2
-rw-r--r--common/lookup3.h20
-rw-r--r--common/lz_config.h8
-rw-r--r--common/quic_config.h7
-rw-r--r--server/red_worker.c32
11 files changed, 33 insertions, 81 deletions
diff --git a/client/common.h b/client/common.h
index 69253db5..f9b19566 100644
--- a/client/common.h
+++ b/client/common.h
@@ -22,7 +22,7 @@
#include <errno.h>
#endif
-#include <stdint.h>
+#include <spice/types.h>
#include <stdio.h>
#include <string>
#include <vector>
@@ -35,7 +35,6 @@
#ifdef WIN32
#include <winsock2.h>
#include <windows.h>
-#include <basetsd.h>
#pragma warning(disable:4355)
#pragma warning(disable:4996)
diff --git a/client/glz_decoder_config.h b/client/glz_decoder_config.h
index 44ef1653..3e820a5f 100644
--- a/client/glz_decoder_config.h
+++ b/client/glz_decoder_config.h
@@ -25,23 +25,7 @@
#include <stdio.h>
-#ifdef __GNUC__
-
-#include <stdint.h>
-
-
-#else
-
-#include <stddef.h>
-#include <basetsd.h>
-
-
-typedef UINT64 uint64_t;
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
-
-#endif //__GNUC__
+#include <spice/types.h>
#define MIN(x, y) (((x) <= (y)) ? (x) : (y))
#define MAX(x, y) (((x) >= (y)) ? (x) : (y))
diff --git a/common/cairo_canvas.c b/common/cairo_canvas.c
index 1a4993da..f1988787 100644
--- a/common/cairo_canvas.c
+++ b/common/cairo_canvas.c
@@ -146,7 +146,7 @@ static void canvas_set_line_attr_no_dash(CairoCanvas *canvas, SpiceLineAttr *att
cairo_set_dash(cairo, NULL, 0, 0);
}
-static void canvas_set_dash(CairoCanvas *canvas, UINT8 nseg, SPICE_ADDRESS addr, int start_is_gap)
+static void canvas_set_dash(CairoCanvas *canvas, uint8_t nseg, SPICE_ADDRESS addr, int start_is_gap)
{
SPICE_FIXED28_4* style = (SPICE_FIXED28_4*)SPICE_GET_ADDRESS(addr);
double offset = 0;
@@ -1136,8 +1136,8 @@ void canvas_draw_rop3(CairoCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, Spi
x_pos = bbox->left;
y_pos = bbox->top;
cairo_user_to_device(cairo, &x_pos, &y_pos);
- pos.x = (INT32)x_pos;
- pos.y = (INT32)y_pos;
+ pos.x = (int32_t)x_pos;
+ pos.y = (int32_t)y_pos;
d = canvas_surface_from_self(canvas, &pos, width, heigth);
s = canvas_get_image(&canvas->base, rop3->src_bitmap);
diff --git a/common/canvas_base.c b/common/canvas_base.c
index fe9ef9b7..de467c7a 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -199,10 +199,10 @@ typedef struct CanvasBase {
#endif
typedef struct ATTR_PACKED DataChunk {
- UINT32 size;
+ uint32_t size;
SPICE_ADDRESS prev;
SPICE_ADDRESS next;
- UINT8 data[0];
+ uint8_t data[0];
} DataChunk;
#undef ATTR_PACKED
@@ -217,8 +217,8 @@ typedef struct ATTR_PACKED DataChunk {
static inline void canvas_localize_palette(CanvasBase *canvas, SpicePalette *palette)
{
if (canvas->color_shift == 5) {
- UINT32 *now = palette->ents;
- UINT32 *end = now + palette->num_ents;
+ uint32_t *now = palette->ents;
+ uint32_t *end = now + palette->num_ents;
for (; now < end; now++) {
*now = canvas_16bpp_to_32bpp(*now);
}
diff --git a/common/canvas_utils.h b/common/canvas_utils.h
index 8ccc3044..10f2d640 100644
--- a/common/canvas_utils.h
+++ b/common/canvas_utils.h
@@ -18,13 +18,7 @@
#ifndef _H_CANVAS_UTILS
#define _H_CANVAS_UTILS
-#ifdef __GNUC__
-#include <stdint.h>
-#else
-#include <stddef.h>
-#include <basetsd.h>
-typedef UINT8 uint8_t;
-#endif //__GNUC__
+#include <spice/types.h>
#include "cairo.h"
#include "lz.h"
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index b60bef2a..df5ae64b 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -1477,7 +1477,7 @@ static int get_cap(int end_style)
}
}
-static uint32_t *gdi_get_userstyle(GdiCanvas *canvas, UINT8 nseg, SPICE_ADDRESS addr, int start_is_gap)
+static uint32_t *gdi_get_userstyle(GdiCanvas *canvas, uint8_t nseg, SPICE_ADDRESS addr, int start_is_gap)
{
SPICE_FIXED28_4* style = (SPICE_FIXED28_4*)SPICE_GET_ADDRESS(addr);
double offset = 0;
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index eaf1e91e..fd1a2c9d 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -282,7 +282,7 @@ static void set_brush(GLCanvas *canvas, SpiceBrush *brush)
}
}
-static void set_op(GLCanvas *canvas, UINT16 rop_decriptor)
+static void set_op(GLCanvas *canvas, uint16_t rop_decriptor)
{
GLCOp op;
diff --git a/common/lookup3.h b/common/lookup3.h
index a2fbdeab..00bc4eba 100644
--- a/common/lookup3.h
+++ b/common/lookup3.h
@@ -18,25 +18,7 @@
#ifndef __LOOKUP3_H
#define __LOOKUP3_H
-#ifdef __GNUC__
-
-#include <stdint.h>
-
-#else
-
-#ifdef QXLDD
-#include <windef.h>
-#include "os_dep.h"
-#else
-#include <stddef.h>
-#include <basetsd.h>
-#endif
-
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
-
-#endif
+#include <spice/types.h>
uint32_t hashlittle(const void *key, size_t length, uint32_t initval);
diff --git a/common/lz_config.h b/common/lz_config.h
index 1020e7ba..748d79df 100644
--- a/common/lz_config.h
+++ b/common/lz_config.h
@@ -20,6 +20,8 @@
#ifndef __LZ_CONFIG_H
#define __LZ_CONFIG_H
+#include <spice/types.h>
+
#ifndef FALSE
#define FALSE 0
#endif
@@ -31,7 +33,6 @@
#ifdef __GNUC__
-#include <stdint.h>
#include <string.h>
#define INLINE inline
@@ -45,15 +46,10 @@
#else
#include <stddef.h>
-#include <basetsd.h>
#include <string.h>
#define INLINE inline
#endif // QXLDD
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
-
#endif //__GNUC__
#endif //__LZ_CONFIG_H
diff --git a/common/quic_config.h b/common/quic_config.h
index ab418b13..c9eb8fa2 100644
--- a/common/quic_config.h
+++ b/common/quic_config.h
@@ -18,9 +18,10 @@
#ifndef __QUIC_CONFIG_H
#define __QUIC_CONFIG_H
+#include <spice/types.h>
+
#ifdef __GNUC__
-#include <stdint.h>
#include <string.h>
#define INLINE inline
@@ -36,16 +37,12 @@
#define MEMCLEAR(ptr, size) RtlZeroMemory(ptr, size)
#else
#include <stddef.h>
-#include <basetsd.h>
#include <string.h>
#define INLINE inline
#define MEMCLEAR(ptr, size) memset(ptr, 0, size)
#endif
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
#endif
diff --git a/server/red_worker.c b/server/red_worker.c
index 483c5a3c..2b50b9f1 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1229,7 +1229,7 @@ static void cb_validate_virt_preload_group(void *opaque, unsigned long virt,
((RedWorker *)opaque)->preload_group_id);
}
-char *draw_type_to_str(UINT8 type)
+char *draw_type_to_str(uint8_t type)
{
switch (type) {
case QXL_DRAW_FILL:
@@ -3724,11 +3724,11 @@ static void localize_path(RedWorker *worker, QXLPHYSICAL *in_path, uint32_t grou
ASSERT(in_path && *in_path);
path = (QXLPath *)get_virt(worker, *in_path, sizeof(QXLPath), group_id);
- data = malloc(sizeof(UINT32) + path->data_size);
+ data = malloc(sizeof(uint32_t) + path->data_size);
ASSERT(data);
*in_path = (QXLPHYSICAL)data;
- *(UINT32 *)data = path->data_size;
- data += sizeof(UINT32);
+ *(uint32_t *)data = path->data_size;
+ data += sizeof(uint32_t);
chunk = &path->chunk;
do {
data_size = chunk->data_size;
@@ -3757,7 +3757,7 @@ static void localize_str(RedWorker *worker, QXLPHYSICAL *in_str, uint32_t group_
int memslot_id = get_memslot_id(worker, *in_str);
ASSERT(in_str);
- str = malloc(sizeof(UINT32) + qxl_str->data_size);
+ str = malloc(sizeof(uint32_t) + qxl_str->data_size);
ASSERT(str);
*in_str = (QXLPHYSICAL)str;
str->length = qxl_str->length;
@@ -3801,11 +3801,11 @@ static void localize_clip(RedWorker *worker, SpiceClip *clip, uint32_t group_id)
clip_rects = (QXLClipRects *)get_virt(worker, clip->data, sizeof(QXLClipRects), group_id);
chunk = &clip_rects->chunk;
ASSERT(clip->data);
- data = malloc(sizeof(UINT32) + clip_rects->num_rects * sizeof(SpiceRect));
+ data = malloc(sizeof(uint32_t) + clip_rects->num_rects * sizeof(SpiceRect));
ASSERT(data);
clip->data = (QXLPHYSICAL)data;
- *(UINT32 *)(data) = clip_rects->num_rects;
- data += sizeof(UINT32);
+ *(uint32_t *)(data) = clip_rects->num_rects;
+ data += sizeof(uint32_t);
do {
data_size = chunk->data_size;
validate_virt(worker, (unsigned long)chunk->data, memslot_id, data_size, group_id);
@@ -3848,7 +3848,7 @@ static LocalImage *alloc_local_image(RedWorker *worker)
return &worker->local_images[worker->local_images_pos++];
}
-static ImageCacheItem *image_cache_find(ImageCache *cache, UINT64 id)
+static ImageCacheItem *image_cache_find(ImageCache *cache, uint64_t id)
{
ImageCacheItem *item = cache->hash_table[id % IMAGE_CACHE_HASH_SIZE];
@@ -3861,7 +3861,7 @@ static ImageCacheItem *image_cache_find(ImageCache *cache, UINT64 id)
return NULL;
}
-static int image_cache_hit(ImageCache *cache, UINT64 id)
+static int image_cache_hit(ImageCache *cache, uint64_t id)
{
ImageCacheItem *item;
if (!(item = image_cache_find(cache, id))) {
@@ -4744,7 +4744,7 @@ static void fill_path(DisplayChannel *display_channel, QXLPHYSICAL *in_path, uin
memslot_id = get_memslot_id(worker, *in_path);
QXLPath *path = (QXLPath *)get_virt(worker, *in_path, sizeof(QXLPath), group_id);
*in_path = channel->send_data.header.size;
- add_buf(channel, BUF_TYPE_RAW, &path->data_size, sizeof(UINT32), 0, 0);
+ add_buf(channel, BUF_TYPE_RAW, &path->data_size, sizeof(uint32_t), 0, 0);
add_buf(channel, BUF_TYPE_CHUNK, &path->chunk, path->data_size, memslot_id, group_id);
}
@@ -4758,7 +4758,7 @@ static void fill_str(DisplayChannel *display_channel, QXLPHYSICAL *in_str, uint3
memslot_id = get_memslot_id(worker, *in_str);
QXLString *str = (QXLString *)get_virt(worker, *in_str, sizeof(QXLString), group_id);
*in_str = channel->send_data.header.size;
- add_buf(channel, BUF_TYPE_RAW, &str->length, sizeof(UINT32), 0, 0);
+ add_buf(channel, BUF_TYPE_RAW, &str->length, sizeof(uint32_t), 0, 0);
add_buf(channel, BUF_TYPE_CHUNK, &str->chunk, str->data_size, memslot_id, group_id);
}
@@ -4771,7 +4771,7 @@ static inline void fill_rects_clip(RedChannel *channel, QXLPHYSICAL *in_clip, ui
ASSERT(in_clip && *in_clip);
clip = (QXLClipRects *)get_virt(worker, *in_clip, sizeof(QXLClipRects), group_id);
*in_clip = channel->send_data.header.size;
- add_buf(channel, BUF_TYPE_RAW, &clip->num_rects, sizeof(UINT32), 0, 0);
+ add_buf(channel, BUF_TYPE_RAW, &clip->num_rects, sizeof(uint32_t), 0, 0);
add_buf(channel, BUF_TYPE_CHUNK, &clip->chunk, clip->num_rects * sizeof(SpiceRect), memslot_id,
group_id);
}
@@ -4798,7 +4798,7 @@ static inline RedImage *alloc_image(DisplayChannel *display_channel)
}
/* io_palette is relative address of the palette*/
-static inline void fill_palette(DisplayChannel *display_channel, SPICE_ADDRESS *io_palette, UINT8 *flags,
+static inline void fill_palette(DisplayChannel *display_channel, SPICE_ADDRESS *io_palette, uint8_t *flags,
uint32_t group_id)
{
RedChannel *channel = &display_channel->base;
@@ -4821,7 +4821,7 @@ static inline void fill_palette(DisplayChannel *display_channel, SPICE_ADDRESS *
}
*io_palette = channel->send_data.header.size;
add_buf(channel, BUF_TYPE_RAW, palette,
- sizeof(SpicePalette) + palette->num_ents * sizeof(UINT32), 0, 0);
+ sizeof(SpicePalette) + palette->num_ents * sizeof(uint32_t), 0, 0);
}
static inline RedCompressBuf *red_display_alloc_compress_buf(DisplayChannel *display_channel)
@@ -5559,7 +5559,7 @@ typedef struct compress_send_data_t {
void* comp_buf;
uint32_t comp_buf_size;
SPICE_ADDRESS *plt_ptr;
- UINT8 *flags_ptr;
+ uint8_t *flags_ptr;
} compress_send_data_t;