Browse Source

Fixes for gcc >= 3.2 from Georg Baum

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
7b423c0988

+ 4
- 4
src/arch/i386/firmware/pcbios/basemem.c View File

@@ -130,8 +130,8 @@ void free_base_memory ( void *ptr, size_t size ) {
130 130
 	 */
131 131
 	for ( ; size_kb > 0 ; free_block++, size_kb-- ) {
132 132
 		/* Mark this block as unused */
133
-		free_block->magic = FREE_BLOCK_MAGIC;
134
-		free_block->size_kb = size_kb;
133
+		free_block->header.magic = FREE_BLOCK_MAGIC;
134
+		free_block->header.size_kb = size_kb;
135 135
 	}
136 136
 
137 137
 	/* Free up unused base memory */
@@ -161,12 +161,12 @@ static void free_unused_base_memory ( void ) {
161 161
 		 * if this is not a free block
162 162
 		 */
163 163
 		if ( ( fbms == FBMS_MAX ) ||
164
-		     ( free_block->magic != FREE_BLOCK_MAGIC ) ) {
164
+		     ( free_block->header.magic != FREE_BLOCK_MAGIC ) ) {
165 165
 			break;
166 166
 		}
167 167
 
168 168
 		/* Return memory to BIOS */
169
-		fbms += free_block->size_kb;
169
+		fbms += free_block->header.size_kb;
170 170
 
171 171
 		DBG ( "Freed %d kB of base memory at [%hx:0000,%hx:0000), "
172 172
 		      "%d kB now free\n",

+ 1
- 1
src/arch/i386/include/basemem.h View File

@@ -19,7 +19,7 @@ struct free_base_memory_header {
19 19
 };
20 20
 
21 21
 union free_base_memory_block {
22
-	struct free_base_memory_header;
22
+	struct free_base_memory_header header;
23 23
 	char bytes[1024];
24 24
 };
25 25
 

+ 2
- 2
src/arch/i386/include/librm.h View File

@@ -17,8 +17,8 @@
17 17
 
18 18
 /* Real-mode call parameter block, as passed to real_call */
19 19
 struct real_call_params {
20
-	struct i386_seg_regs;
21
-	struct i386_regs;
20
+	struct i386_seg_regs segs;
21
+	struct i386_regs regs;
22 22
 	segoff_t rm_code;
23 23
 	segoff_t reserved;
24 24
 } PACKED;

+ 2
- 2
src/include/dns.h View File

@@ -70,12 +70,12 @@ struct dns_rr_info {
70 70
 } __attribute__ (( packed ));
71 71
 
72 72
 struct dns_rr_info_a {
73
-	struct dns_rr_info;
73
+	struct dns_rr_info info;
74 74
 	struct in_addr in_addr;
75 75
 } __attribute__ (( packed ));
76 76
 
77 77
 struct dns_rr_info_cname {
78
-	struct dns_rr_info;
78
+	struct dns_rr_info info;
79 79
 	char		cname[0];
80 80
 } __attribute__ (( packed ));
81 81
 

+ 1
- 1
src/include/nmb.h View File

@@ -14,7 +14,7 @@
14 14
 #define NBNS_UDP_PORT		137
15 15
 
16 16
 struct dns_rr_info_nb {
17
-	struct dns_rr_info;
17
+	struct dns_rr_info info;
18 18
 	uint16_t	nb_flags;
19 19
 	struct in_addr	nb_address;
20 20
 } __attribute__ (( packed ));

+ 8
- 7
src/proto/http.c View File

@@ -40,18 +40,19 @@ static int send_tcp_request(int length, void *buffer, void *ptr) {
40 40
 /**************************************************************************
41 41
 RECV_TCP_CALLBACK - Receive data using TCP
42 42
 **************************************************************************/
43
-static int recv_tcp_request(int length, const void *buffer, void *ptr) {
43
+static int recv_tcp_request(int length, const void *data, void *ptr) {
44 44
 	struct send_recv_state *state = (struct send_recv_state *)ptr;
45
+	const char *buffer = data;
45 46
 
46 47
 	/* Assume that the lines in an HTTP header do not straddle a packet */
47 48
 	/* boundary. This is probably a reasonable assumption */
48 49
 	if (state->recv_state == RESULT_CODE) {
49 50
 		while (length > 0) {
50 51
 			/* Find HTTP result code */
51
-			if (*(const char *)buffer == ' ') {
52
-				const char *ptr = ((const char *)buffer) + 1;
52
+			if (*buffer == ' ') {
53
+				const char *ptr = buffer + 1;
53 54
 				int rc = strtoul(ptr, &ptr, 10);
54
-				if (ptr >= (const char *)buffer + length) {
55
+				if (ptr >= buffer + length) {
55 56
 					state->recv_state = ERROR;
56 57
 					DBG ( "HTTP got bad result code\n" );
57 58
 					return 0;
@@ -61,7 +62,7 @@ static int recv_tcp_request(int length, const void *buffer, void *ptr) {
61 62
 				DBG ( "HTTP got result code %d\n", rc );
62 63
 				goto header;
63 64
 			}
64
-			++(const char *)buffer;
65
+			++buffer;
65 66
 			length--;
66 67
 		}
67 68
 		state->recv_state = ERROR;
@@ -88,7 +89,7 @@ static int recv_tcp_request(int length, const void *buffer, void *ptr) {
88 89
 			/* Find beginning of line */
89 90
 			while (length > 0) {
90 91
 				length--;
91
-				if (*((const char *)buffer)++ == '\n')
92
+				if (*buffer++ == '\n')
92 93
 					break;
93 94
 			}
94 95
 			/* Check for end of header */
@@ -140,7 +141,7 @@ static int http ( char *url, struct sockaddr_in *server __unused,
140 141
 			
141 142
 			tcp_transaction ( server->sin_addr.s_addr,
142 143
 					  server->sin_port, &state,
143
-					  send_tcp_request, recv_tcp_request );
144
+					  send_tcp_request, (int (*)(int, const void *, void *))recv_tcp_request );
144 145
 		}
145 146
 
146 147
 		if ( state.recv_state == MOVED ) {

+ 5
- 2
src/proto/nmb.c View File

@@ -15,6 +15,7 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
15 15
 	char nb_name[16];
16 16
 	char c;
17 17
 	int i;
18
+	uint16_t *d;
18 19
 
19 20
 	*(dest++) = 32; /* Length is always 32 */
20 21
 
@@ -26,11 +27,13 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
26 27
 	memset ( nb_name, ' ', 15 );
27 28
 	nb_name[15] = '\0';
28 29
 	memcpy ( nb_name, name, strlen ( name ) ); /* Do not copy NUL */
30
+
31
+	d = ( uint16_t * ) dest;
29 32
 	for ( i = 0 ; i < 16 ; i++ ) {
30 33
 		c = nb_name[i];
31
-		*( ( ( uint16_t * ) dest ) ++ ) = 
32
-			htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
34
+		*( d++ )  = htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
33 35
 	}
36
+	dest = ( char * ) d;
34 37
 
35 38
 	*(dest++) = 0; /* Terminating 0-length name component */
36 39
 	return dest;

Loading…
Cancel
Save