bug #28659: Missing casts

This commit is contained in:
goldsimon 2010-01-25 08:20:46 +00:00
parent 0f5c7fa169
commit 892859455c
4 changed files with 21 additions and 22 deletions

View File

@ -24,7 +24,7 @@ http_server_netconn_serve(struct netconn *conn)
err = netconn_recv(conn, &inbuf);
if (err == ERR_OK) {
netbuf_data(inbuf, &buf, &buflen);
netbuf_data(inbuf, (void**)&buf, &buflen);
/* Is this an HTTP GET command? (only check the first 5 chars, since
there are other formats for GET, and we're keeping it very simple )*/

View File

@ -100,9 +100,9 @@ static struct http_state*
http_state_alloc()
{
#if HTTPD_USE_MEM_POOL
return memp_malloc(MEMP_HTTPD_STATE);
return (struct http_state *)memp_malloc(MEMP_HTTPD_STATE);
#else /* HTTPD_USE_MEM_POOL */
return mem_malloc(sizeof(struct http_state));
return (struct http_state *)mem_malloc(sizeof(struct http_state));
#endif /* HTTPD_USE_MEM_POOL */
}
@ -224,7 +224,7 @@ http_parse_request(struct pbuf *p, struct http_state *hs)
struct fs_file file;
const char* filename = NULL;
data = p->payload;
data = (char*)p->payload;
/* default is request not supported */
request_supported = ERR_ARG;
@ -285,7 +285,7 @@ http_parse_request(struct pbuf *p, struct http_state *hs)
static void
http_err(void *arg, err_t err)
{
struct http_state *hs = arg;
struct http_state *hs = (struct http_state *)arg;
LWIP_UNUSED_ARG(err);
LWIP_DEBUGF(HTTPD_DEBUG, ("http_err: %s", lwip_strerr(err)));
@ -302,7 +302,7 @@ http_err(void *arg, err_t err)
static err_t
http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
{
struct http_state *hs = arg;
struct http_state *hs = (struct http_state *)arg;
LWIP_DEBUGF(HTTPD_DEBUG, ("http_sent: pcb=%p hs=%p len=%"U16_F"\n",
(void*)pcb, (void*)hs, len));
@ -344,7 +344,7 @@ http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
static err_t
http_poll(void *arg, struct tcp_pcb *pcb)
{
struct http_state *hs = arg;
struct http_state *hs = (struct http_state *)arg;
LWIP_DEBUGF(HTTPD_DEBUG, ("http_poll: pcb=%p hs=%p pcb_state=%s\n",
(void*)pcb, (void*)hs, tcp_debug_state_str(pcb->state)));
@ -377,7 +377,7 @@ static err_t
http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
err_t parsed = ERR_ABRT;
struct http_state *hs = arg;
struct http_state *hs = (struct http_state *)arg;
LWIP_DEBUGF(HTTPD_DEBUG, ("http_recv: pcb=%p pbuf=%p err=%s\n", (void*)pcb,
(void*)p, lwip_strerr(err)));

View File

@ -103,7 +103,7 @@ struct packet_adapter {
* @return number of adapters found or negative on error
*/
static int
get_adapter_list(void** adapter_list, int list_len, void* buffer, size_t buf_len)
get_adapter_list(char** adapter_list, int list_len, void* buffer, size_t buf_len)
{
int i;
char *temp, *start;
@ -123,8 +123,8 @@ get_adapter_list(void** adapter_list, int list_len, void* buffer, size_t buf_len
/* get the start of each adapter name in the list and put it into
* the AdapterList array */
i = 0;
temp = buffer;
start = buffer;
temp = (char*)buffer;
start = (char*)buffer;
while ((*temp != '\0') || (*(temp - 1) != '\0')) {
if (*temp == '\0') {
adapter_list[i] = start;
@ -147,7 +147,7 @@ get_adapter_list(void** adapter_list, int list_len, void* buffer, size_t buf_len
int
get_adapter_index(const char* adapter_guid)
{
void *AdapterList[MAX_NUM_ADAPTERS];
char *AdapterList[MAX_NUM_ADAPTERS];
int i;
char AdapterName[ADAPTER_NAME_LEN]; /* string that contains a list of the network adapters */
int AdapterNum;
@ -156,7 +156,7 @@ get_adapter_index(const char* adapter_guid)
AdapterNum = get_adapter_list(AdapterList, MAX_NUM_ADAPTERS, AdapterName, ADAPTER_NAME_LEN);
if (AdapterNum > 0) {
for (i = 0; i < AdapterNum; i++) {
if(strstr(AdapterList[i], adapter_guid)) {
if(strstr((char*)AdapterList[i], adapter_guid)) {
return i;
}
}
@ -178,7 +178,7 @@ get_adapter_index(const char* adapter_guid)
void*
init_adapter(int adapter_num, char *mac_addr, input_fn input, void *arg)
{
void *AdapterList[MAX_NUM_ADAPTERS];
char *AdapterList[MAX_NUM_ADAPTERS];
int i;
char AdapterName[ADAPTER_NAME_LEN]; /* string that contains a list of the network adapters */
int AdapterNum;
@ -186,7 +186,7 @@ init_adapter(int adapter_num, char *mac_addr, input_fn input, void *arg)
unsigned char ethaddr[ETHARP_HWADDR_LEN];
struct packet_adapter *pa;
pa = malloc(sizeof(struct packet_adapter));
pa = (struct packet_adapter *)malloc(sizeof(struct packet_adapter));
if (!pa) {
printf("Unable to alloc the adapter!\n");
return NULL;
@ -209,7 +209,7 @@ init_adapter(int adapter_num, char *mac_addr, input_fn input, void *arg)
/* set up the selected adapter */
lpAdapter = PacketOpenAdapter(AdapterList[i]);
if (lpAdapter && (lpAdapter->hFile != INVALID_HANDLE_VALUE)) {
ppacket_oid_data = malloc(sizeof(PACKET_OID_DATA) + PACKET_OID_DATA_SIZE);
ppacket_oid_data = (PPACKET_OID_DATA)malloc(sizeof(PACKET_OID_DATA) + PACKET_OID_DATA_SIZE);
if (ppacket_oid_data) {
ppacket_oid_data->Oid = OID_GEN_VENDOR_DESCRIPTION;
ppacket_oid_data->Length = PACKET_OID_DATA_SIZE;
@ -242,7 +242,7 @@ init_adapter(int adapter_num, char *mac_addr, input_fn input, void *arg)
return NULL;
}
/* alloc the OID packet */
ppacket_oid_data = malloc(sizeof(PACKET_OID_DATA) + PACKET_OID_DATA_SIZE);
ppacket_oid_data = (PPACKET_OID_DATA)malloc(sizeof(PACKET_OID_DATA) + PACKET_OID_DATA_SIZE);
if (!ppacket_oid_data) {
PacketCloseAdapter(pa->lpAdapter);
free(pa);
@ -362,7 +362,7 @@ ProcessPackets(void *adapter, LPPACKET lpPacket)
ulBytesReceived = lpPacket->ulBytesReceived;
buf = lpPacket->Buffer;
buf = (char*)lpPacket->Buffer;
off=0;
@ -430,7 +430,7 @@ link_adapter(void *adapter)
NDIS_MEDIA_STATE fNdisMediaState = pa->fNdisMediaState;
/* get the media connect status of the selected adapter */
ppacket_oid_data = malloc(sizeof(PACKET_OID_DATA) + sizeof(NDIS_MEDIA_STATE));
ppacket_oid_data = (PPACKET_OID_DATA)malloc(sizeof(PACKET_OID_DATA) + sizeof(NDIS_MEDIA_STATE));
if (ppacket_oid_data) {
ppacket_oid_data->Oid = OID_GEN_MEDIA_CONNECT_STATUS;
ppacket_oid_data->Length = sizeof(NDIS_MEDIA_STATE);

View File

@ -218,8 +218,7 @@ low_level_input(struct netif *netif, void *packet, int packet_len)
if (((memcmp(&ethhdr->dest, &netif->hwaddr, ETHARP_HWADDR_LEN)) &&
((ethhdr->dest.addr[0] & 0x01) == 0)) ||
/* and don't let feedback packets through (limitation in winpcap?) */
((!memcmp(&ethhdr->src, netif->hwaddr, ETHARP_HWADDR_LEN)) &&
((ethhdr->dest.addr[0] & 0x01) == 0))) {
(!memcmp(&ethhdr->src, netif->hwaddr, ETHARP_HWADDR_LEN))) {
return NULL;
}
@ -279,7 +278,7 @@ ethernetif_input(struct netif *netif, void *packet, int packet_len)
}
/* points to packet payload, which starts with an Ethernet header */
ethhdr = p->payload;
ethhdr = (struct eth_hdr *)p->payload;
switch (htons(ethhdr->type)) {
/* IP or ARP packet? */
case ETHTYPE_IP: