Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 7be13eb63177b237ab2e7c525bd88ccf2bf7e20e Author: Sven Eckelmann sven@open-mesh.com Date: Fri Jan 4 09:53:42 2013 +0100
alfred: Fix warnings about mixing (un-)signed types in comparisons
Signed-off-by: Sven Eckelmann sven@open-mesh.com
7be13eb63177b237ab2e7c525bd88ccf2bf7e20e alfred.h | 2 +- client.c | 2 +- recv.c | 2 +- send.c | 2 +- unix_sock.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/alfred.h b/alfred.h index 82c997d..4f1a89f 100644 --- a/alfred.h +++ b/alfred.h @@ -125,7 +125,7 @@ int alfred_client_set_data(struct globals *globals); int recv_alfred_packet(struct globals *globals); /* send.c */ int push_data(struct globals *globals, uint8_t *destination, - int max_source_level, int type_filter); + enum data_source max_source_level, int type_filter); int announce_master(struct globals *globals); int push_local_data(struct globals *globals); int sync_data(struct globals *globals); diff --git a/client.c b/client.c index 700c96e..527d78d 100644 --- a/client.c +++ b/client.c @@ -63,7 +63,7 @@ int alfred_client_request_data(struct globals *globals) data_len = ntohs(data->length);
/* would it fit? it should! */ - if (data_len > sizeof(buf) - headlen) + if (data_len > (int)(sizeof(buf) - headlen)) break;
/* read the data */ diff --git a/recv.c b/recv.c index e99acdc..609fa2a 100644 --- a/recv.c +++ b/recv.c @@ -50,7 +50,7 @@ int process_alfred_push_data(struct globals *globals, struct ethhdr *ethhdr, data_len = ntohs(data->length);
/* check if enough data is available */ - if (data_len + sizeof(*data) > len) + if ((int)(data_len + sizeof(*data)) > len) break;
dataset = hash_find(globals->data_hash, data); diff --git a/send.c b/send.c index cef20e0..ffd9df9 100644 --- a/send.c +++ b/send.c @@ -49,7 +49,7 @@ int announce_master(struct globals *globals) }
int push_data(struct globals *globals, uint8_t *destination, - int max_source_level, int type_filter) + enum data_source max_source_level, int type_filter) { struct hash_it_t *hashit = NULL; uint8_t buf[9000]; diff --git a/unix_sock.c b/unix_sock.c index 799b5a8..7277d69 100644 --- a/unix_sock.c +++ b/unix_sock.c @@ -98,14 +98,14 @@ int unix_sock_add_data(struct globals *globals, struct alfred_packet *packet)
len = ntohs(packet->length);
- if (len < sizeof(*data)) + if (len < (int)sizeof(*data)) return -1;
data = (struct alfred_data *)(packet + 1); data_len = ntohs(data->length); memcpy(data->source, globals->hwaddr, sizeof(globals->hwaddr));
- if (data_len + sizeof(*data) > len) + if ((int)(data_len + sizeof(*data)) > len) return -1;
dataset = hash_find(globals->data_hash, data);