Skip to content

Commit 85b7ade

Browse files
committed
[unix/fbdev] use C standard int names
1 parent d2c335a commit 85b7ade

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

platforms/unix/vm-display-fbdev/sqUnixFBDevFramebuffer.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,12 @@
3838

3939

4040
#include <unistd.h>
41+
#include <stdint.h>
4142
#include <sys/mman.h>
4243
#include <sys/ioctl.h>
4344

44-
/* be less dependent on architecture defs */
45-
#include <sys/types.h>
46-
#define uint8 u_int8_t
47-
#define uint16 u_int16_t
48-
#define uint32 u_int32_t
49-
/* Pixels are kept as 32 bits: uint32 */
50-
#define pixel_t u_int32_t
45+
/* Pixels are kept as 32 bits: uint32_t */
46+
typedef uint32_t pixel_t;
5147

5248
#include <linux/fb.h>
5349
#include <linux/vt.h>
@@ -88,8 +84,8 @@ struct fb
8884
SqPoint cursorPosition;
8985
SqPoint cursorOffset;
9086
int cursorVisible;
91-
uint16 cursorBits[16];
92-
uint16 cursorMask[16];
87+
uint16_t cursorBits[16];
88+
uint16_t cursorMask[16];
9389
pixel_t cursorBack[16][16];
9490
};
9591

@@ -151,7 +147,7 @@ static inline void fb_putPixel_32(_self, int x, int y, pixel_t pix)
151147
static inline pixel_t fb_getPixel_16(_self, int x, int y)
152148
{
153149
return ((x >= 0) && (y >= 0) && (x < fb_width(self)) && (y < fb_height(self)))
154-
? *((uint16 *)(self->addr
150+
? *((uint16_t *)(self->addr
155151
+ (x + self->var.xoffset) * (16 / 8)
156152
+ (y + self->var.yoffset) * (self->fix.line_length)))
157153
: 0;
@@ -161,7 +157,7 @@ static inline void fb_putPixel_16(_self, int x, int y, pixel_t pix)
161157
{
162158
if ((x >= 0) && (y >= 0) && (x < fb_width(self)) && (y < fb_height(self)))
163159
{
164-
*((uint16 *)(self->addr
160+
*((uint16_t *)(self->addr
165161
+ (x + self->var.xoffset) * (16 / 8)
166162
+ (y + self->var.yoffset) * (self->fix.line_length)))
167163
= pix;
@@ -172,7 +168,7 @@ static inline void fb_putPixel_16(_self, int x, int y, pixel_t pix)
172168
static inline pixel_t fb_getPixel_8(_self, int x, int y)
173169
{
174170
return ((x >= 0) && (y >= 0) && (x < fb_width(self)) && (y < fb_height(self)))
175-
? *((uint16 *)(self->addr
171+
? *((uint16_t *)(self->addr
176172
+ (x + self->var.xoffset)
177173
+ (y + self->var.yoffset) * (self->fix.line_length)))
178174
: 0;
@@ -342,9 +338,9 @@ static void fb_copyBits_16(_self, char *bits, int left, int right, int top, int
342338
hideCursorIn(self, left, right, top, bottom);
343339
for (y= top; y < bottom; y += 1)
344340
{
345-
uint16 *in= (uint16 *)(bits + ((left + (y * fb_width(self))) * 2));
341+
uint16_t *in= (uint16_t *)(bits + ((left + (y * fb_width(self))) * 2));
346342
/* unsigned short *out= (unsigned short *)(self->addr + ((left + (y * fb_pitch(self))) * 2)); */
347-
uint16 *out= (uint16 *)(self->addr + fb_pixel_position(self, left, y));
343+
uint16_t *out= (uint16_t *)(self->addr + fb_pixel_position(self, left, y));
348344
for (x= left; x < right; x += 2, in += 2, out += 2)
349345
{
350346
# if defined(WORDS_BIGENDIAN)

0 commit comments

Comments
 (0)