trivial portability issues c89

This commit is contained in:
Jeff Lenk 2011-08-01 09:48:08 -05:00
parent 5c455bda74
commit 2b6a4f97c3
2 changed files with 12 additions and 12 deletions

View File

@ -116,12 +116,12 @@ struct msg_buffer_s {
struct hep_hdr{
u_int8_t hp_v; /* version */
u_int8_t hp_l; /* length */
u_int8_t hp_f; /* family */
u_int8_t hp_p; /* protocol */
u_int16_t hp_sport; /* source port */
u_int16_t hp_dport; /* destination port */
uint8_t hp_v; /* version */
uint8_t hp_l; /* length */
uint8_t hp_f; /* family */
uint8_t hp_p; /* protocol */
uint16_t hp_sport; /* source port */
uint16_t hp_dport; /* destination port */
};

View File

@ -114,10 +114,10 @@ su_log_t tport_log[] = {
/** Initialize logging. */
int tport_open_log(tport_master_t *mr, tagi_t *tags)
{
int n;
int log_msg = mr->mr_log != 0;
char const *dump = NULL;
char const *capt = NULL;;
int n;
if(mr->mr_capt_name) capt = mr->mr_capt_name;
@ -352,7 +352,7 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
struct hep_ip6hdr hep_ip6header;
#endif
int eth_frame_len = 8000;
void* buffer;
char* buffer;
size_t i, dst = 0;
tport_master_t *mr;
@ -408,16 +408,16 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
/* Copy hepheader */
memset(buffer, '\0', eth_frame_len);
memcpy((void*)buffer, &hep_header, sizeof(struct hep_hdr));
memcpy(buffer, &hep_header, sizeof(struct hep_hdr));
buflen = sizeof(struct hep_hdr);
if(su->su_family == AF_INET) {
memcpy((void*)buffer + buflen, &hep_ipheader, sizeof(struct hep_iphdr));
memcpy(buffer + buflen, &hep_ipheader, sizeof(struct hep_iphdr));
buflen += sizeof(struct hep_iphdr);
}
#if SU_HAVE_IN6
else {
memcpy((void*)buffer+buflen, &hep_ip6header, sizeof(struct hep_ip6hdr));
memcpy(buffer+buflen, &hep_ip6header, sizeof(struct hep_ip6hdr));
buflen += sizeof(struct hep_ip6hdr);
}
#endif
@ -430,7 +430,7 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
if((buflen + len) > eth_frame_len)
break;
memcpy((void*)(buffer + buflen) , (void*)iov[i].mv_base, len);
memcpy(buffer + buflen , (void*)iov[i].mv_base, len);
buflen +=len;
n -= len;
}