Przeglądaj źródła

Add casts to allow compile on freebsd with gcc 4.2.1

mingodad 12 lat temu
rodzic
commit
ead02ad946
1 zmienionych plików z 26 dodań i 26 usunięć
  1. 26 26
      librs232/rs232_posix.c

+ 26 - 26
librs232/rs232_posix.c

@@ -9,10 +9,10 @@
  * copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following
  * conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be
  * included in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -72,7 +72,7 @@ rs232_init(void)
 void
 rs232_end(struct rs232_port_t *p)
 {
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -101,7 +101,7 @@ rs232_in_qeue(struct rs232_port_t *p, unsigned int *in_bytes)
 	int ret;
 	int b;
 	struct timeval tv;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -138,7 +138,7 @@ rs232_in_qeue_clear(struct rs232_port_t *p)
 	unsigned int blen;
 	unsigned char *buf = NULL;
 	struct timeval tv;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -174,7 +174,7 @@ rs232_read(struct rs232_port_t *p, unsigned char *buf, unsigned int buf_len,
 	   unsigned int *read_len)
 {
 	int r;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p buf_len=%d\n", (void *)p, p->pt, buf_len);
 
@@ -215,7 +215,7 @@ rs232_read_timeout_forced(struct rs232_port_t *p, unsigned char *buf,
 	int reti;
 	fd_set set;
 	int r;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 	struct timeval tv;
 	struct timeval t1;
 	struct timeval t2;
@@ -300,7 +300,7 @@ rs232_read_timeout(struct rs232_port_t *p, unsigned char *buf,
 	fd_set set;
 	int r;
 	struct timeval tv;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p buf_len=%d timeout=%d\n", (void *)p, p->pt,
 		buf_len, timeout);
@@ -345,10 +345,10 @@ rs232_write(struct rs232_port_t *p, const unsigned char *buf, unsigned int buf_l
 		unsigned int *write_len)
 {
 	int w;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
-	DBG("p=%p p->pt=%p hex='%s' ascii='%s' buf_len=%d\n", 
-	    (void *)p, p->pt, rs232_hex_dump(buf, buf_len), 
+	DBG("p=%p p->pt=%p hex='%s' ascii='%s' buf_len=%d\n",
+	    (void *)p, p->pt, rs232_hex_dump(buf, buf_len),
 	    rs232_ascii_dump(buf, buf_len), buf_len);
 
 	if (!rs232_port_open(p))
@@ -378,7 +378,7 @@ rs232_write_timeout(struct rs232_port_t *p, const unsigned char *buf,
 	int ret;
 	fd_set set;
 	int w;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 	struct timeval tv;
 
 	DBG("p=%p p->pt=%p timeout=%d\n", (void *)p, p->pt, timeout);
@@ -424,7 +424,7 @@ rs232_open(struct rs232_port_t *p)
 {
 	int flags;
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -434,7 +434,7 @@ rs232_open(struct rs232_port_t *p)
 		return RS232_ERR_OPEN;
 	}
 
-	/* 
+	/*
 	 * On OSX (and maybe on more systems), we need to open() the port with
 	 * O_NDELAY, because otherwise it would block forever waiting for DCD
 	 * signal, so here we restore back to blocking operations.
@@ -489,7 +489,7 @@ unsigned int
 rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud)
 {
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p baud=%d (%s bauds)\n",
 	    (void *)p, p->pt, baud, rs232_strbaud(baud));
@@ -551,7 +551,7 @@ rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state)
 {
 	int ret;
 	int set;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p dtr=%d (dtr control %s)\n",
 	    (void *)p, p->pt, state, rs232_strdtr(state));
@@ -581,7 +581,7 @@ rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state)
 		DBG("%s\n", "TIOCMSET RS232_ERR_IOCTL");
 		return RS232_ERR_IOCTL;
 	}
-	
+
 	p->dtr = state;
 
 	return RS232_ERR_NOERROR;
@@ -592,7 +592,7 @@ rs232_set_rts(struct rs232_port_t *p, enum rs232_rts_e state)
 {
 	int ret;
 	int set;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p rts=%d (rts control %s)\n",
 	    (void *)p, p->pt, state, rs232_strrts(state));
@@ -622,7 +622,7 @@ rs232_set_rts(struct rs232_port_t *p, enum rs232_rts_e state)
 		DBG("%s\n", "TIOCMSET RS232_ERR_IOCTL");
 		return RS232_ERR_IOCTL;
 	}
-	
+
 	p->rts = state;
 
 	return RS232_ERR_NOERROR;
@@ -632,7 +632,7 @@ unsigned int
 rs232_set_parity(struct rs232_port_t *p, enum rs232_parity_e parity)
 {
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p parity=%d (parity %s)\n",
 	    (void *)p, p->pt, parity, rs232_strparity(parity));
@@ -667,7 +667,7 @@ unsigned int
 rs232_set_stop(struct rs232_port_t *p, enum rs232_stop_e stop)
 {
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p stop=%d (%s stop bits)\n",
 	    (void *)p, p->pt, stop, rs232_strstop(stop));
@@ -698,7 +698,7 @@ unsigned int
 rs232_set_data(struct rs232_port_t *p, enum rs232_data_e data)
 {
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p data=%d (%s data bits)\n",
 	    (void *)p, p->pt, data, rs232_strdata(data));
@@ -736,7 +736,7 @@ unsigned int
 rs232_set_flow(struct rs232_port_t *p, enum rs232_flow_e flow)
 {
 	struct termios term;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p flow=%d (flow control %s)\n",
 	    (void *)p, p->pt, flow, rs232_strflow(flow));
@@ -773,7 +773,7 @@ unsigned int
 rs232_flush(struct rs232_port_t *p)
 {
 	int ret;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -791,7 +791,7 @@ unsigned int
 rs232_close(struct rs232_port_t *p)
 {
 	int ret;
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p\n", (void *)p, p->pt);
 
@@ -809,7 +809,7 @@ rs232_close(struct rs232_port_t *p)
 unsigned int
 rs232_fd(struct rs232_port_t *p)
 {
-	struct rs232_posix_t *ux = p->pt;
+	struct rs232_posix_t *ux = (struct rs232_posix_t *)p->pt;
 
 	DBG("p=%p p->pt=%p ux->fd=%d\n", (void *)p, p->pt, ux->fd);