nmealib: make nmea_INFO_is_present an INLINE function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 13 Jun 2016 13:41:48 +0000 (15:41 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 14 Jun 2016 07:21:25 +0000 (09:21 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/nmealib/include/nmea/info.h
lib/pud/nmealib/src/info.c

index e7095dd..d79a5e9 100644 (file)
 extern "C" {
 #endif /* __cplusplus */
 
+#ifndef INLINE
+#define INLINE inline __attribute__((always_inline))
+#endif
+
 /**
  * @file
  * The table below describes which fields are present in the sentences that are
@@ -200,7 +204,18 @@ void nmea_time_now(nmeaTIME *utc, uint32_t * present);
 void nmea_zero_INFO(nmeaINFO *info);
 
 bool nmea_INFO_is_present_smask(int smask, nmeaINFO_FIELD fieldName);
-bool nmea_INFO_is_present(uint32_t present, nmeaINFO_FIELD fieldName);
+
+/**
+ * Determine if a nmeaINFO structure has a certain field
+ *
+ * @param present the presence field
+ * @param fieldName use a name from nmeaINFO_FIELD
+ * @return a boolean, true when the structure has the requested field
+ */
+static INLINE bool nmea_INFO_is_present(uint32_t present, nmeaINFO_FIELD fieldName) {
+  return ((present & fieldName) != 0);
+}
+
 void nmea_INFO_set_present(uint32_t * present, nmeaINFO_FIELD fieldName);
 void nmea_INFO_unset_present(uint32_t * present, nmeaINFO_FIELD fieldName);
 
index 113b70e..56383fc 100644 (file)
@@ -133,17 +133,6 @@ bool nmea_INFO_is_present_smask(int smask, nmeaINFO_FIELD fieldName) {
        }
 }
 
-/**
- * Determine if a nmeaINFO structure has a certain field
- *
- * @param present the presence field
- * @param fieldName use a name from nmeaINFO_FIELD
- * @return a boolean, true when the structure has the requested field
- */
-bool nmea_INFO_is_present(uint32_t present, nmeaINFO_FIELD fieldName) {
-       return ((present & fieldName) != 0);
-}
-
 /**
  * Flag a nmeaINFO structure to contain a certain field
  *