slirp: Remove some type casts caused by bad declaration of x.tp_buf

x.tp_buf was declared as a uint8_t array, but always used as
a char array (which needed a lot of type casts).

The patch includes these changes:

* Fix declaration of x.tp_buf and remove all type casts.

* Use offsetof() to get the offset of x.tp_buf.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Stefan Weil 2011-02-23 19:40:14 +01:00 committed by Blue Swirl
parent c3febae62b
commit 89d2d3af51
2 changed files with 8 additions and 8 deletions

View file

@ -26,7 +26,7 @@ struct tftp_t {
uint16_t tp_error_code;
uint8_t tp_msg[512];
} tp_error;
uint8_t tp_buf[512 + 2];
char tp_buf[512 + 2];
} x;
};