projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LogicSegment::pow2_ceil(): Fix potentіal integer overflow.
[pulseview.git]
/
pv
/
data
/
logicsegment.cpp
diff --git
a/pv/data/logicsegment.cpp
b/pv/data/logicsegment.cpp
index 707f797d294accad64b5ee12f1ecd1551049344d..5d6faf8f8fe1a5333f8130cfcb17725db99a07ab 100644
(file)
--- a/
pv/data/logicsegment.cpp
+++ b/
pv/data/logicsegment.cpp
@@
-25,6
+25,7
@@
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstring>
+#include <cstdint>
#include "logic.hpp"
#include "logicsegment.hpp"
#include "logic.hpp"
#include "logicsegment.hpp"
@@
-480,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)
{
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;
}
return (x + p - 1) / p * p;
}