Skip to content

Commit 3087861

Browse files
author
Elbing Miss
committed
Fixing what is needed for GCC.
Change-Id: I72e0ace3c7cc2acb22eddfc05192ec1f6f60b6ee
1 parent 4d7bcfa commit 3087861

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+936
-775
lines changed

Makefile.inc

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ ARCH=amd64
99

1010
BIN=${HARVEY}/${ARCH}/bin
1111
LIB=${HARVEY}/${ARCH}/lib
12-
AS=as
13-
CC=gcc
14-
LD=ld
12+
AS=x86_64-harvey-elf-as
13+
CC=x86_64-harvey-elf-gcc
14+
LD=x86_64-harvey-elf-ld
1515

1616
IDIR=${HARVEY}/include
1717
IOBJDIR=${HARVEY}/${ARCH}/include
1818

19-
CFLAGS=-O0 -static -mno-red-zone -ffreestanding -nostdinc -D_SUSV2_SOURCE -D_POSIX_SOURCE -D_LIMITS_EXTENSION ${WFLAGS} -g -I${IDIR} -I${IOBJDIR}
19+
CFLAGS= -std=c99 -O0 -static -mno-red-zone -ffreestanding -nostdinc -D_SUSV2_SOURCE -D_POSIX_SOURCE -D_LIMITS_EXTENSION ${WFLAGS} -g -I${IDIR} -I${IOBJDIR}
2020

2121
WFLAGS=-Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wuninitialized -Wmaybe-uninitialized
2222

23-
AR=ar # manipulating libraries
23+
AR=x86_64-harvey-elf-ar # manipulating libraries
2424
RANLIB=echo # for updating libraries

include/arpa/inet.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,28 +81,28 @@ struct in_addr {
8181
* On subnets, the decomposition of addresses to host and net parts
8282
* is done according to subnet mask, not the masks here.
8383
*/
84-
#define IN_CLASSA(i) (((int32_t)(i) & 0x80000000) == 0)
84+
#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
8585
#define IN_CLASSA_NET 0xff000000
8686
#define IN_CLASSA_NSHIFT 24
8787
#define IN_CLASSA_HOST 0x00ffffff
8888
#define IN_CLASSA_MAX 128
8989

90-
#define IN_CLASSB(i) (((int32_t)(i) & 0xc0000000) == 0x80000000)
90+
#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
9191
#define IN_CLASSB_NET 0xffff0000
9292
#define IN_CLASSB_NSHIFT 16
9393
#define IN_CLASSB_HOST 0x0000ffff
9494
#define IN_CLASSB_MAX 65536
9595

96-
#define IN_CLASSC(i) (((int32_t)(i) & 0xe0000000) == 0xc0000000)
96+
#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
9797
#define IN_CLASSC_NET 0xffffff00
9898
#define IN_CLASSC_NSHIFT 8
9999
#define IN_CLASSC_HOST 0x000000ff
100100

101-
#define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000)
101+
#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
102102
#define IN_MULTICAST(i) IN_CLASSD(i)
103103

104-
#define IN_EXPERIMENTAL(i) (((int32_t)(i) & 0xe0000000) == 0xe0000000)
105-
#define IN_BADCLASS(i) (((int32_t)(i) & 0xf0000000) == 0xf0000000)
104+
#define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000) == 0xe0000000)
105+
#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000)
106106

107107
#define INADDR_ANY (unsigned long)0x00000000
108108
#define INADDR_BROADCAST (unsigned long)0xffffffff /* must be masked */

include/dirent.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ struct dirent {
2020

2121
typedef struct _dirdesc {
2222
int dd_fd; /* file descriptor */
23-
int32_t dd_loc; /* buf offset of entry from last readdir() */
24-
int32_t dd_size; /* amount of valid data in buffer */
23+
long dd_loc; /* buf offset of entry from last readdir() */
24+
long dd_size; /* amount of valid data in buffer */
2525
char *dd_buf; /* directory data buffer */
2626
void *dirs;
2727
int dirsize;

include/draw.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ enum {
159159
XBGR32 = CHAN4(CIgnore, 8, CBlue, 8, CGreen, 8, CRed, 8),
160160
};
161161

162-
extern char* chantostr(char*, uint32_t);
163-
extern uint32_t strtochan(char*);
164-
extern int chantodepth(uint32_t);
162+
extern char* chantostr(char*, long);
163+
extern long strtochan(char*);
164+
extern int chantodepth(long);
165165

166166
struct Point
167167
{
@@ -199,7 +199,7 @@ struct Display
199199
char *devdir;
200200
char *windir;
201201
char oldlabel[64];
202-
uint32_t dataqid;
202+
long dataqid;
203203
Image *white;
204204
Image *black;
205205
Image *opaque;
@@ -222,17 +222,17 @@ struct Image
222222
Rectangle r; /* rectangle in data area, local coords */
223223
Rectangle clipr; /* clipping region */
224224
int depth; /* number of bits per pixel */
225-
uint32_t chan;
225+
long chan;
226226
int repl; /* flag: data replicates to tile clipr */
227227
Screen *screen; /* 0 if not a window */
228228
Image *next; /* next in list of windows */
229229
};
230230

231231
struct RGB
232232
{
233-
uint32_t red;
234-
uint32_t green;
235-
uint32_t blue;
233+
long red;
234+
long green;
235+
long blue;
236236
};
237237

238238
/*
@@ -304,7 +304,7 @@ struct Cacheinfo
304304

305305
struct Cachesubf
306306
{
307-
uint32_t age; /* for replacement */
307+
long age; /* for replacement */
308308
Cachefont *cf; /* font info that owns us */
309309
Subfont *f; /* attached subfont */
310310
};
@@ -317,7 +317,7 @@ struct Font
317317
int16_t ascent; /* top of image to baseline */
318318
int16_t width; /* widest so far; used in caching only */
319319
int16_t nsub; /* number of subfonts */
320-
uint32_t age; /* increasing counter; used for LRU */
320+
long age; /* increasing counter; used for LRU */
321321
int maxdepth; /* maximum depth of all loaded subfonts */
322322
int ncache; /* size of cache */
323323
int nsubf; /* size of subfont list */
@@ -337,10 +337,10 @@ extern "C" {
337337
/*
338338
* Image management
339339
*/
340-
extern Image* _allocimage(Image*, Display*, Rectangle, uint32_t, int,
341-
uint32_t, int, int);
342-
extern Image* allocimage(Display*, Rectangle, uint32_t, int,
343-
uint32_t);
340+
extern Image* _allocimage(Image*, Display*, Rectangle, long, int,
341+
long, int, int);
342+
extern Image* allocimage(Display*, Rectangle, long, int,
343+
long);
344344
extern uint8_t* bufimage(Display*, int);
345345
extern int bytesperline(Rectangle, int);
346346
extern void closedisplay(Display*);
@@ -365,25 +365,25 @@ extern int wordsperline(Rectangle, int);
365365
extern int writeimage(int, Image*, int);
366366
extern Image* namedimage(Display*, char*);
367367
extern int nameimage(Image*, char*, int);
368-
extern Image* allocimagemix(Display*, uint32_t, uint32_t);
368+
extern Image* allocimagemix(Display*, long, long);
369369

370370
/*
371371
* Colors
372372
*/
373373
extern void readcolmap(Display*, RGB*);
374374
extern void writecolmap(Display*, RGB*);
375-
extern uint32_t setalpha(uint32_t, uint8_t);
375+
extern long setalpha(long, uint8_t);
376376

377377
/*
378378
* Windows
379379
*/
380380
extern Screen* allocscreen(Image*, Image*, int);
381-
extern Image* _allocwindow(Image*, Screen*, Rectangle, int, uint32_t);
382-
extern Image* allocwindow(Screen*, Rectangle, int, uint32_t);
381+
extern Image* _allocwindow(Image*, Screen*, Rectangle, int, long);
382+
extern Image* allocwindow(Screen*, Rectangle, int, long);
383383
extern void bottomnwindows(Image**, int);
384384
extern void bottomwindow(Image*);
385385
extern int freescreen(Screen*);
386-
extern Screen* publicscreen(Display*, int, uint32_t);
386+
extern Screen* publicscreen(Display*, int, long);
387387
extern void topnwindows(Image**, int);
388388
extern void topwindow(Image*);
389389
extern int originwindow(Image*, Point, Point);
@@ -511,7 +511,7 @@ extern Subfont* _getsubfont(Display*, char*);
511511
extern Subfont* getdefont(Display*);
512512
extern void lockdisplay(Display*);
513513
extern void unlockdisplay(Display*);
514-
extern int drawlsetrefresh(uint32_t, int, void*, void*);
514+
extern int drawlsetrefresh(long, int, void*, void*);
515515

516516
/*
517517
* Predefined
@@ -549,7 +549,7 @@ extern void _twiddlecompressed(uint8_t*, int);
549549
extern int _compblocksize(Rectangle, int);
550550

551551
/* XXX backwards helps; should go */
552-
extern uint32_t drawld2chan[];
552+
extern long drawld2chan[];
553553
extern void drawsetdebug(int);
554554

555555
#ifdef __cplusplus

include/fcntl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#define FD_CLOEXEC 1
4242

4343
struct flock {
44-
int16_t l_type;
45-
int16_t l_whence;
44+
short l_type;
45+
short l_whence;
4646
off_t l_start;
4747
off_t l_len;
4848
pid_t l_pid;

include/inttypes.h

+3-11
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@
1414
#ifndef _INTTYPES_H_
1515
#define _INTTYPES_H_ 1
1616

17-
typedef int _intptr_t;
17+
typedef long long _intptr_t;
1818
typedef unsigned long long _uintptr_t;
1919

20-
21-
typedef signed char int8_t;
22-
typedef int int32_t;
23-
typedef long long int64_t;
24-
typedef unsigned char uint8_t;
25-
typedef unsigned short uint16_t;
26-
typedef unsigned int uint32_t;
27-
typedef unsigned long long uint64_t;
2820
typedef _intptr_t intptr_t;
2921
typedef _uintptr_t uintptr_t;
30-
typedef int64_t intmax_t;
31-
typedef uint64_t uintmax_t;
22+
typedef long long intmax_t;
23+
typedef unsigned long long uintmax_t;
3224

3325
#endif

0 commit comments

Comments
 (0)