From 543e3d0b73bd6eb26deed665387b7c0d8f1ca04e Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 12 Mar 2018 00:33:08 -0500 Subject: [PATCH] Use uint32_t for all fields --- include/vm_area.h | 12 +++++++----- src/vm_area.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/vm_area.h b/include/vm_area.h index 1b40bbd..0515689 100644 --- a/include/vm_area.h +++ b/include/vm_area.h @@ -1,6 +1,8 @@ #ifndef _VM_AREA_H_ #define _VM_AREA_H_ +#include + typedef struct { /* * These are the x and y coordinate offsets in the logical dimension @@ -8,8 +10,8 @@ typedef struct { * top-left; (5, 5) would be 5 pixels down, and 5 pixels to the * right, of that top-left corner. */ - int xoff; - int yoff; + uint32_t xoff; + uint32_t yoff; /* * These are the width and height of the area we're defining. A @@ -17,8 +19,8 @@ typedef struct { * (1, 1); use larger numbers to indicate a larger square (if the * two are equal) or rectangle (if unequal). */ - int width; - int height; + uint32_t width; + uint32_t height; } vm_area; /* @@ -40,6 +42,6 @@ typedef struct { SDL_Rect name; \ SET_SDL_RECT(name, a) -extern void vm_area_set(vm_area *, int, int, int, int); +extern void vm_area_set(vm_area *, uint32_t, uint32_t, uint32_t, uint32_t); #endif diff --git a/src/vm_area.c b/src/vm_area.c index 6097edc..fb00e38 100644 --- a/src/vm_area.c +++ b/src/vm_area.c @@ -16,7 +16,7 @@ * width and height. */ inline void -vm_area_set(vm_area *area, int xoff, int yoff, int width, int height) +vm_area_set(vm_area *area, uint32_t xoff, uint32_t yoff, uint32_t width, uint32_t height) { area->xoff = xoff; area->yoff = yoff;