]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logicsegment.cpp
logicsegment.cpp: Suggest inlining of pack_sample()/unpack_sample().
[pulseview.git] / pv / data / logicsegment.cpp
index 58cf00e5dddbfcc6e1514cb0534084546fbe3dec..707f797d294accad64b5ee12f1ecd1551049344d 100644 (file)
@@ -17,6 +17,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h" // For HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS
+
 #include <extdef.h>
 
 #include <cassert>
@@ -62,7 +64,7 @@ LogicSegment::~LogicSegment()
                free(l.data);
 }
 
-uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const
+inline uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const
 {
 #ifdef HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS
        return *(uint64_t*)ptr;
@@ -100,7 +102,7 @@ uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const
 #endif
 }
 
-void LogicSegment::pack_sample(uint8_t *ptr, uint64_t value)
+inline void LogicSegment::pack_sample(uint8_t *ptr, uint64_t value)
 {
 #ifdef HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS
        *(uint64_t*)ptr = value;