X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Flogicsegment.cpp;h=5d6faf8f8fe1a5333f8130cfcb17725db99a07ab;hb=727083851e431c1a0303347550d5ace9ea6962d1;hp=58cf00e5dddbfcc6e1514cb0534084546fbe3dec;hpb=53aa9bb42c921cfc3a658855598f984cdaac17d0;p=pulseview.git diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index 58cf00e..5d6faf8 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -17,12 +17,15 @@ * along with this program; if not, see . */ +#include "config.h" // For HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS + #include #include #include #include #include +#include #include "logic.hpp" #include "logicsegment.hpp" @@ -62,7 +65,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 +103,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; @@ -478,7 +481,7 @@ uint64_t LogicSegment::get_subsample(int level, uint64_t offset) const uint64_t LogicSegment::pow2_ceil(uint64_t x, unsigned int power) { - const uint64_t p = 1 << power; + const uint64_t p = UINT64_C(1) << power; return (x + p - 1) / p * p; }