summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/arch/i386/firmware/pcbios/basemem.c8
-rw-r--r--src/arch/i386/include/basemem.h2
-rw-r--r--src/arch/i386/include/librm.h4
-rw-r--r--src/include/dns.h4
-rw-r--r--src/include/nmb.h2
-rw-r--r--src/proto/http.c15
-rw-r--r--src/proto/nmb.c7
7 files changed, 23 insertions, 19 deletions
diff --git a/src/arch/i386/firmware/pcbios/basemem.c b/src/arch/i386/firmware/pcbios/basemem.c
index 0bc9ca98..7dad640e 100644
--- a/src/arch/i386/firmware/pcbios/basemem.c
+++ b/src/arch/i386/firmware/pcbios/basemem.c
@@ -130,8 +130,8 @@ void free_base_memory ( void *ptr, size_t size ) {
*/
for ( ; size_kb > 0 ; free_block++, size_kb-- ) {
/* Mark this block as unused */
- free_block->magic = FREE_BLOCK_MAGIC;
- free_block->size_kb = size_kb;
+ free_block->header.magic = FREE_BLOCK_MAGIC;
+ free_block->header.size_kb = size_kb;
}
/* Free up unused base memory */
@@ -161,12 +161,12 @@ static void free_unused_base_memory ( void ) {
* if this is not a free block
*/
if ( ( fbms == FBMS_MAX ) ||
- ( free_block->magic != FREE_BLOCK_MAGIC ) ) {
+ ( free_block->header.magic != FREE_BLOCK_MAGIC ) ) {
break;
}
/* Return memory to BIOS */
- fbms += free_block->size_kb;
+ fbms += free_block->header.size_kb;
DBG ( "Freed %d kB of base memory at [%hx:0000,%hx:0000), "
"%d kB now free\n",
diff --git a/src/arch/i386/include/basemem.h b/src/arch/i386/include/basemem.h
index 6e7c22dd..289824eb 100644
--- a/src/arch/i386/include/basemem.h
+++ b/src/arch/i386/include/basemem.h
@@ -19,7 +19,7 @@ struct free_base_memory_header {
};
union free_base_memory_block {
- struct free_base_memory_header;
+ struct free_base_memory_header header;
char bytes[1024];
};
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h
index 2edc1096..1b82a982 100644
--- a/src/arch/i386/include/librm.h
+++ b/src/arch/i386/include/librm.h
@@ -17,8 +17,8 @@
/* Real-mode call parameter block, as passed to real_call */
struct real_call_params {
- struct i386_seg_regs;
- struct i386_regs;
+ struct i386_seg_regs segs;
+ struct i386_regs regs;
segoff_t rm_code;
segoff_t reserved;
} PACKED;
diff --git a/src/include/dns.h b/src/include/dns.h
index 5b8b81f1..33ee73fe 100644
--- a/src/include/dns.h
+++ b/src/include/dns.h
@@ -70,12 +70,12 @@ struct dns_rr_info {
} __attribute__ (( packed ));
struct dns_rr_info_a {
- struct dns_rr_info;
+ struct dns_rr_info info;
struct in_addr in_addr;
} __attribute__ (( packed ));
struct dns_rr_info_cname {
- struct dns_rr_info;
+ struct dns_rr_info info;
char cname[0];
} __attribute__ (( packed ));
diff --git a/src/include/nmb.h b/src/include/nmb.h
index 695f8e08..7948d9e4 100644
--- a/src/include/nmb.h
+++ b/src/include/nmb.h
@@ -14,7 +14,7 @@
#define NBNS_UDP_PORT 137
struct dns_rr_info_nb {
- struct dns_rr_info;
+ struct dns_rr_info info;
uint16_t nb_flags;
struct in_addr nb_address;
} __attribute__ (( packed ));
diff --git a/src/proto/http.c b/src/proto/http.c
index 6f47fc14..4fa594f6 100644
--- a/src/proto/http.c
+++ b/src/proto/http.c
@@ -40,18 +40,19 @@ static int send_tcp_request(int length, void *buffer, void *ptr) {
/**************************************************************************
RECV_TCP_CALLBACK - Receive data using TCP
**************************************************************************/
-static int recv_tcp_request(int length, const void *buffer, void *ptr) {
+static int recv_tcp_request(int length, const void *data, void *ptr) {
struct send_recv_state *state = (struct send_recv_state *)ptr;
+ const char *buffer = data;
/* Assume that the lines in an HTTP header do not straddle a packet */
/* boundary. This is probably a reasonable assumption */
if (state->recv_state == RESULT_CODE) {
while (length > 0) {
/* Find HTTP result code */
- if (*(const char *)buffer == ' ') {
- const char *ptr = ((const char *)buffer) + 1;
+ if (*buffer == ' ') {
+ const char *ptr = buffer + 1;
int rc = strtoul(ptr, &ptr, 10);
- if (ptr >= (const char *)buffer + length) {
+ if (ptr >= buffer + length) {
state->recv_state = ERROR;
DBG ( "HTTP got bad result code\n" );
return 0;
@@ -61,7 +62,7 @@ static int recv_tcp_request(int length, const void *buffer, void *ptr) {
DBG ( "HTTP got result code %d\n", rc );
goto header;
}
- ++(const char *)buffer;
+ ++buffer;
length--;
}
state->recv_state = ERROR;
@@ -88,7 +89,7 @@ static int recv_tcp_request(int length, const void *buffer, void *ptr) {
/* Find beginning of line */
while (length > 0) {
length--;
- if (*((const char *)buffer)++ == '\n')
+ if (*buffer++ == '\n')
break;
}
/* Check for end of header */
@@ -140,7 +141,7 @@ static int http ( char *url, struct sockaddr_in *server __unused,
tcp_transaction ( server->sin_addr.s_addr,
server->sin_port, &state,
- send_tcp_request, recv_tcp_request );
+ send_tcp_request, (int (*)(int, const void *, void *))recv_tcp_request );
}
if ( state.recv_state == MOVED ) {
diff --git a/src/proto/nmb.c b/src/proto/nmb.c
index b395dabe..d44c0685 100644
--- a/src/proto/nmb.c
+++ b/src/proto/nmb.c
@@ -15,6 +15,7 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
char nb_name[16];
char c;
int i;
+ uint16_t *d;
*(dest++) = 32; /* Length is always 32 */
@@ -26,11 +27,13 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
memset ( nb_name, ' ', 15 );
nb_name[15] = '\0';
memcpy ( nb_name, name, strlen ( name ) ); /* Do not copy NUL */
+
+ d = ( uint16_t * ) dest;
for ( i = 0 ; i < 16 ; i++ ) {
c = nb_name[i];
- *( ( ( uint16_t * ) dest ) ++ ) =
- htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
+ *( d++ ) = htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
}
+ dest = ( char * ) d;
*(dest++) = 0; /* Terminating 0-length name component */
return dest;