host: fix various compiler warnings
diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 1f4f5d0..f7cc666 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -139,7 +139,7 @@
 	printf("<- %s\n", msgb_hexdump(msg));
 
 	if (transp->udp_fd < 0) {
-		unsigned int xfer_len;
+		int xfer_len;
 
 		rc = libusb_bulk_transfer(transp->usb_devh, transp->usb_ep.out,
 					  msgb_data(msg), msgb_length(msg),
@@ -155,13 +155,16 @@
 static struct simtrace_msg_hdr *st_push_hdr(struct msgb *msg, uint8_t msg_class, uint8_t msg_type,
 					    uint8_t slot_nr)
 {
-	struct simtrace_msg_hdr *sh = msgb_push(msg, sizeof(*sh));
+	struct simtrace_msg_hdr *sh;
 
+	sh = (struct simtrace_msg_hdr *) msgb_push(msg, sizeof(*sh));
 	memset(sh, 0, sizeof(*sh));
 	sh->msg_class = msg_class;
 	sh->msg_type = msg_type;
 	sh->slot_nr = slot_nr;
 	sh->msg_len = msgb_length(msg);
+
+	return sh;
 }
 
 /* transmit a given message to a specified slot. Expects all headers
@@ -169,7 +172,7 @@
 int st_slot_tx_msg(struct st_slot *slot, struct msgb *msg,
 		   uint8_t msg_class, uint8_t msg_type)
 {
-	struct simtrace_msg_hdr *sh = msg->data;
+	struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr *) msg->data;
 
 	sh->slot_nr = slot->slot_nr;
 
@@ -682,7 +685,6 @@
 			sleep(1);
 	} while (keep_running);
 
-release_exit:
 	if (transp->udp_fd < 0)
 		libusb_exit(NULL);
 do_exit:
diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c
index e4c5818..ad4b73b 100644
--- a/host/simtrace2_usb.c
+++ b/host/simtrace2_usb.c
@@ -52,7 +52,8 @@
 			perror("Cannot open device");
 			continue;
 		}
-		rc = libusb_get_string_descriptor_ascii(dev_handle, m->string_idx, strbuf, sizeof(strbuf));
+		rc = libusb_get_string_descriptor_ascii(dev_handle, m->string_idx,
+					(unsigned char *)strbuf, sizeof(strbuf));
 		libusb_close(dev_handle);
 		if (rc < 0) {
 			printf("\n");
diff --git a/host/usb2udp.c b/host/usb2udp.c
index 5e48b22..7a1e4a3 100644
--- a/host/usb2udp.c
+++ b/host/usb2udp.c
@@ -142,10 +142,10 @@
 /* call-back when libusb removes a FD */
 static void libusb_fd_removed_cb(int fd, void *user_data)
 {
-	struct osmo_fd *ofd;
 
 	printf("%s(%u)\n", __func__, fd);
 #if 0
+	struct osmo_fd *ofd;
 	/* FIXME: This needs new export in libosmocore! */
 	ofd = osmo_fd_get_by_fd(fd);
 
@@ -160,7 +160,7 @@
 static int ofd_udp_cb(struct osmo_fd *ofd, unsigned int what)
 {
 	int rc;
-	int addrlen = sizeof(g_sa_remote);
+	socklen_t addrlen = sizeof(g_sa_remote);
 
 	rc = recvfrom(ofd->fd, g_buf_out.buf, sizeof(g_buf_out.buf), 0,
 			(struct sockaddr *)&g_sa_remote, &addrlen);
@@ -204,7 +204,6 @@
 {
 	int rc;
 	int c, ret = 1;
-	char *remote_host = NULL;
 	int local_udp_port = 52342;
 	unsigned int if_num = 0;
 
@@ -282,7 +281,6 @@
 	if (g_devh)
 		libusb_close(g_devh);
 
-release_exit:
 	libusb_exit(NULL);
 	return ret;
 }