From 04f1141345396e96f26ce2ec90e4904b1222cefd Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Tue, 16 Jan 2018 11:02:45 -0500 Subject: [PATCH 1/3] Add TI-RTOS compat header --- compat/minmea_compat_ti-rtos.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 compat/minmea_compat_ti-rtos.h diff --git a/compat/minmea_compat_ti-rtos.h b/compat/minmea_compat_ti-rtos.h new file mode 100644 index 0000000..b1deb97 --- /dev/null +++ b/compat/minmea_compat_ti-rtos.h @@ -0,0 +1,16 @@ +/* + * Copyright © 2017 Kosma Moczek + * This program is free software. It comes without any warranty, to the extent + * permitted by applicable law. You can redistribute it and/or modify it under + * the terms of the Do What The Fuck You Want To Public License, Version 2, as + * published by Sam Hocevar. See the COPYING file for more details. + */ + +#if defined(__TI_ARM__) + +// timespec definition +#include + +#endif + +/* vim: set ts=4 sw=4 et: */ From 0456bbb0ce9faaff22596b3a94521c05e9ce5d49 Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Tue, 16 Jan 2018 11:05:31 -0500 Subject: [PATCH 2/3] Define timegm --- compat/minmea_compat_ti-rtos.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compat/minmea_compat_ti-rtos.h b/compat/minmea_compat_ti-rtos.h index b1deb97..1a79fa6 100644 --- a/compat/minmea_compat_ti-rtos.h +++ b/compat/minmea_compat_ti-rtos.h @@ -11,6 +11,8 @@ // timespec definition #include +#define timegm mktime + #endif /* vim: set ts=4 sw=4 et: */ From 4d9710940889b0b31385e6fb71b977e0f3e9944d Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Tue, 16 Jan 2018 11:15:12 -0500 Subject: [PATCH 3/3] Fix compiler warnings. --- minmea.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minmea.c b/minmea.c index 6bcf0f3..43d6926 100644 --- a/minmea.c +++ b/minmea.c @@ -323,7 +323,7 @@ bool minmea_scan(const char *sentence, const char *format, ...) default: { // Unknown. goto parse_error; - } break; + } } next_field(); @@ -581,7 +581,7 @@ bool minmea_parse_vtg(struct minmea_sentence_vtg *frame, const char *sentence) c_knots != 'N' || c_kph != 'K') return false; - frame->faa_mode = c_faa_mode; + frame->faa_mode = (enum minmea_faa_mode)c_faa_mode; return true; } @@ -633,7 +633,7 @@ int minmea_gettime(struct timespec *ts, const struct minmea_date *date, const st tm.tm_sec = time_->seconds; time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */ - if (timestamp != -1) { + if (timestamp != (time_t)-1) { ts->tv_sec = timestamp; ts->tv_nsec = time_->microseconds * 1000; return 0;