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

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

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

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

17
 
17
 
18
 /* Real-mode call parameter block, as passed to real_call */
18
 /* Real-mode call parameter block, as passed to real_call */
19
 struct real_call_params {
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
 	segoff_t rm_code;
22
 	segoff_t rm_code;
23
 	segoff_t reserved;
23
 	segoff_t reserved;
24
 } PACKED;
24
 } PACKED;

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

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

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

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

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

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

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

15
 	char nb_name[16];
15
 	char nb_name[16];
16
 	char c;
16
 	char c;
17
 	int i;
17
 	int i;
18
+	uint16_t *d;
18
 
19
 
19
 	*(dest++) = 32; /* Length is always 32 */
20
 	*(dest++) = 32; /* Length is always 32 */
20
 
21
 
26
 	memset ( nb_name, ' ', 15 );
27
 	memset ( nb_name, ' ', 15 );
27
 	nb_name[15] = '\0';
28
 	nb_name[15] = '\0';
28
 	memcpy ( nb_name, name, strlen ( name ) ); /* Do not copy NUL */
29
 	memcpy ( nb_name, name, strlen ( name ) ); /* Do not copy NUL */
30
+
31
+	d = ( uint16_t * ) dest;
29
 	for ( i = 0 ; i < 16 ; i++ ) {
32
 	for ( i = 0 ; i < 16 ; i++ ) {
30
 		c = nb_name[i];
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
 	*(dest++) = 0; /* Terminating 0-length name component */
38
 	*(dest++) = 0; /* Terminating 0-length name component */
36
 	return dest;
39
 	return dest;

Loading…
Cancel
Save