summaryrefslogtreecommitdiff
path: root/ao-tools/ao-sky-flash/sky_serial.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-01-03 11:41:49 -0800
committerKeith Packard <keithp@keithp.com>2019-01-03 12:09:58 -0800
commit6f729ff46b2f4531db68f0af85e7e9fe0f6d1969 (patch)
treed0a93a48bd3012decbb230f5aa17ecc6c793cad2 /ao-tools/ao-sky-flash/sky_serial.c
parentf14c799ae7ff3be56c28f5694f04c03daff7708e (diff)
ao-tools: Fix warnings in ao-tools
None of these appear likely to have caused actual problems. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-sky-flash/sky_serial.c')
-rw-r--r--ao-tools/ao-sky-flash/sky_serial.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ao-tools/ao-sky-flash/sky_serial.c b/ao-tools/ao-sky-flash/sky_serial.c
index 94b0b156..e56ab923 100644
--- a/ao-tools/ao-sky-flash/sky_serial.c
+++ b/ao-tools/ao-sky-flash/sky_serial.c
@@ -16,7 +16,7 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE 1
#include <termios.h>
#include <unistd.h>
#include <sys/types.h>
@@ -98,11 +98,10 @@ skytraq_open(const char *path)
#define US_PER_CHAR (1000000 / BPS)
int
-skytraq_write(int fd, const char *data, int len)
+skytraq_write(int fd, const void *d, int len)
{
- const char *d = data;
+ const char *data = d;
int r;
- int us;
skytraq_dbg_printf (0, "%4d: ", len);
if (len < 70)
@@ -116,7 +115,6 @@ skytraq_write(int fd, const char *data, int len)
r = write(fd, data, this_time);
if (r <= 0)
return r;
- us = r * US_PER_CHAR;
usleep(r * US_PER_CHAR);
data += r;
len -= r;
@@ -132,7 +130,7 @@ skytraq_setcomm(int fd, int baudrate)
int i;
uint8_t cksum;
- int target_baudrate;
+ int target_baudrate = 0;
switch(baudrate)
{
case 4800: