Commit 80030410 authored by Brendan Shanks's avatar Brendan Shanks Committed by Jeremy White
Browse files

Use unsigned int/size_t for display width/height/buffer size

Signed-off-by: Brendan Shanks's avatarBrendan Shanks <>
Acked-by: Jeremy White's avatarJeremy White <>
parent c4cc4ccd
......@@ -59,7 +59,7 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *c, int screen)
return NULL;
static int bits_per_pixel(display_t *d)
static unsigned int bits_per_pixel(display_t *d)
xcb_format_iterator_t fmt;
......@@ -332,10 +332,10 @@ int display_open(display_t *d, session_t *session)
shm_image_t *create_shm_image(display_t *d, int w, int h)
shm_image_t *create_shm_image(display_t *d, unsigned int w, unsigned int h)
shm_image_t *shmi;
int imgsize;
size_t imgsize;
xcb_void_cookie_t cookie;
xcb_generic_error_t *error;
......@@ -353,7 +353,7 @@ shm_image_t *create_shm_image(display_t *d, int w, int h)
if (shmi->shmid != -1)
shmi->shmaddr = shmat(shmi->shmid, 0, 0);
if (shmi->shmid == -1 || shmi->shmaddr == (void *) -1) {
g_warning("Cannot get shared memory of size %d; errno %d", imgsize, errno);
g_warning("Cannot get shared memory of size %" G_GSIZE_FORMAT "; errno %d", imgsize, errno);
return NULL;
......@@ -33,9 +33,9 @@ struct session_struct;
typedef struct {
int shmid;
int w;
int h;
int bytes_per_line;
unsigned int w;
unsigned int h;
unsigned int bytes_per_line;
xcb_shm_seg_t shmseg;
void *shmaddr;
void *drawable_ptr;
......@@ -44,9 +44,9 @@ typedef struct {
typedef struct {
xcb_connection_t *c;
xcb_window_t root;
int width;
int height;
int depth;
unsigned int width;
unsigned int height;
unsigned int depth;
const xcb_query_extension_reply_t *damage_ext;
xcb_damage_damage_t damage;
......@@ -76,7 +76,7 @@ void display_stop_event_thread(display_t *d);
int display_find_changed_tiles(display_t *d, int row, int *tiles, int tiles_across);
void display_copy_image_into_fullscreen(display_t *d, shm_image_t *shmi, int x, int y);
shm_image_t *create_shm_image(display_t *d, int w, int h);
shm_image_t *create_shm_image(display_t *d, unsigned int w, unsigned int h);
int read_shm_image(display_t *d, shm_image_t *shmi, int x, int y);
void destroy_shm_image(display_t *d, shm_image_t *shmi);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment