diff --git a/.travis.yml b/.travis.yml index 1a15303f..c2e27e70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,11 @@ addons: - cmake - check - lcov + # Required for doxygen check + - doxygen + - texlive + - texlive-pictures + - pgf # Required for gcc-arm-embedded - lib32bz2-1.0 - lib32ncurses5 @@ -30,6 +35,9 @@ install: - wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q2-update/+download/gcc-arm-none-eabi-4_9-2015q2-20150609-linux.tar.bz2 - tar -xf gcc-arm-none-eabi-4_9-2015q2-20150609-linux.tar.bz2 - export PATH=$PATH:$PWD/gcc-arm-none-eabi-4_9-2015q2/bin + # Install doxygen 1.8 + # TODO: Replace with PPA once whitelisted, see https://github.com/travis-ci/apt-source-whitelist/issues/40 + script: # Test libswiftnav @@ -37,6 +45,8 @@ script: - cd build/ - cmake -DCMAKE_BUILD_TYPE=Coverage ../ - make + # Check the doxygen + - make check-style # Install locally to avoid sudo - make DESTDIR="./install" install # Test ARM cross-compile diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 1cabab50..c678065d 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -7,7 +7,8 @@ Tools needed: - doxygen - convert from ImageMagick - pip install gcovr diff-cover - - pdflatex from TeX Live + - texlive and texlive-pictures + - pgf (for missing TeX dependency) - libcheck (otherwise `make` will not run unit tests) To get started, run:: diff --git a/include/libswiftnav/logging.h b/include/libswiftnav/logging.h index 6d9c36ef..1b222b05 100644 --- a/include/libswiftnav/logging.h +++ b/include/libswiftnav/logging.h @@ -90,7 +90,7 @@ do { \ } while (0) /** Log a debug message indicating entry to a function. - * Logs a debug message of the form `` to indicate entry to a + * Logs a debug message of the form `\` to indicate entry to a * function. `function_name` is automatically filled in with the name of the * current function by GCC magic. */ @@ -102,7 +102,7 @@ do { \ } while (0) /** Log a debug message indicating exit to a function. - * Logs a debug message of the form `` to indicate exit from a + * Logs a debug message of the form `\` to indicate exit from a * function. `function_name` is automatically filled in with the name of the * current function by GCC magic. */ diff --git a/include/libswiftnav/signal.h b/include/libswiftnav/signal.h index ad3f1d51..5eb3411b 100644 --- a/include/libswiftnav/signal.h +++ b/include/libswiftnav/signal.h @@ -44,26 +44,26 @@ #define SID_STR_LEN_MAX 16 /** Constellation identifier. */ -enum constellation { +typedef enum constellation { CONSTELLATION_INVALID = -1, CONSTELLATION_GPS, CONSTELLATION_SBAS, CONSTELLATION_COUNT, -}; +} constellation_t; /** Code identifier. */ -enum code { +typedef enum code { CODE_INVALID = -1, CODE_GPS_L1CA, CODE_GPS_L2CM, CODE_SBAS_L1CA, CODE_COUNT, -}; +} code_t; /** GNSS signal identifier. */ typedef struct { u16 sat; - enum code code; + code_t code; } gnss_signal_t; /** Signal comparison function. */ @@ -89,14 +89,14 @@ static inline bool sid_is_equal(const gnss_signal_t a, const gnss_signal_t b) /* \} */ -gnss_signal_t construct_sid(enum code code, u16 sat); +gnss_signal_t construct_sid(code_t code, u16 sat); int sid_to_string(char *s, int n, gnss_signal_t sid); bool sid_valid(gnss_signal_t sid); -bool code_valid(enum code code); -bool constellation_valid(enum constellation constellation); -gnss_signal_t sid_from_code_index(enum code code, u16 code_index); +bool code_valid(code_t code); +bool constellation_valid(constellation_t constellation); +gnss_signal_t sid_from_code_index(code_t code, u16 code_index); u16 sid_to_code_index(gnss_signal_t sid); enum constellation sid_to_constellation(gnss_signal_t sid); -enum constellation code_to_constellation(enum code code); +enum constellation code_to_constellation(code_t code); #endif /* LIBSWIFTNAV_SIGNAL_H */ diff --git a/src/signal.c b/src/signal.c index 272f3360..2d10eb0b 100644 --- a/src/signal.c +++ b/src/signal.c @@ -21,7 +21,7 @@ /** Element in the code data table. */ typedef struct { - enum constellation constellation; + constellation_t constellation; u16 sat_count; u16 sat_start; const char *str; @@ -49,7 +49,7 @@ static const char * unknown_str = "?"; * * \return gnss_signal_t corresponding to the specified arguments. */ -gnss_signal_t construct_sid(enum code code, u16 sat) +gnss_signal_t construct_sid(code_t code, u16 sat) { gnss_signal_t sid = {.code = code, .sat = sat}; return sid; @@ -98,7 +98,7 @@ bool sid_valid(gnss_signal_t sid) * * \return true if code is valid, false otherwise */ -bool code_valid(enum code code) +bool code_valid(code_t code) { return ((code >= 0) && (code < CODE_COUNT)); } @@ -109,7 +109,7 @@ bool code_valid(enum code code) * * \return true if constellation is valid, false otherwise */ -bool constellation_valid(enum constellation constellation) +bool constellation_valid(constellation_t constellation) { return ((constellation >= 0) && (constellation < CONSTELLATION_COUNT)); } @@ -122,7 +122,7 @@ bool constellation_valid(enum constellation constellation) * * \return gnss_signal_t corresponding to code and code_index. */ -gnss_signal_t sid_from_code_index(enum code code, u16 code_index) +gnss_signal_t sid_from_code_index(code_t code, u16 code_index) { assert(code_valid(code)); assert(code_index < code_table[code].sat_count); @@ -147,7 +147,7 @@ u16 sid_to_code_index(gnss_signal_t sid) * * \return Constellation to which sid belongs. */ -enum constellation sid_to_constellation(gnss_signal_t sid) +constellation_t sid_to_constellation(gnss_signal_t sid) { return code_to_constellation(sid.code); } @@ -158,7 +158,7 @@ enum constellation sid_to_constellation(gnss_signal_t sid) * * \return Constellation to which code belongs. */ -enum constellation code_to_constellation(enum code code) +constellation_t code_to_constellation(code_t code) { assert(code_valid(code)); return code_table[code].constellation;