summaryrefslogtreecommitdiffstats
path: root/import
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2015-10-29 14:20:53 +0530
committerJennifer A. Stofer <stofer@us.ibm.com>2015-12-04 08:25:58 -0600
commit8b69f6e2957193da871457282230df8f538f0ac9 (patch)
tree4efaa49bf2471717d8dba879d04c16a5b62e2db6 /import
parent57439c8215b984477bf81122c445671458f18a99 (diff)
downloadtalos-sbe-8b69f6e2957193da871457282230df8f538f0ac9.tar.gz
talos-sbe-8b69f6e2957193da871457282230df8f538f0ac9.zip
Fix mask calculation in buffer insert function
Change-Id: Iec346df5b73f4e1796a73b1c6ac8fcebfcf58c4d Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21589 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Brian Silver <bsilver@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22419
Diffstat (limited to 'import')
-rw-r--r--import/hwpf/fapi2/include/buffer.H10
1 files changed, 5 insertions, 5 deletions
diff --git a/import/hwpf/fapi2/include/buffer.H b/import/hwpf/fapi2/include/buffer.H
index d4a18412..2e49a0f6 100644
--- a/import/hwpf/fapi2/include/buffer.H
+++ b/import/hwpf/fapi2/include/buffer.H
@@ -477,8 +477,8 @@ class buffer
(target_length - TS);
// Get mask value for Target buffer
- // Note: Need "& 0UL" because bit shift left for Target buffer doesn't roll off
- uint64_t mask = ((~0UL << (parameterTraits<uint64_t>::bit_length() - L)) & ~0UL)
+ // Note: Need "& 0ULL" because bit shift left for Target buffer doesn't roll off
+ uint64_t mask = ((~0ULL << (parameterTraits<uint64_t>::bit_length() - L)) & ~0ULL)
>> target_start;
// Align the source to the target. Make things signed so we know which way to shift.
@@ -551,9 +551,9 @@ class buffer
(target_length - i_targetStart);
// Get mask value for Target buffer
- // Note: Need "& 0UL" because bit shift left for Target buffer doesn't roll off
- uint64_t mask = ((~0UL << (parameterTraits<uint64_t>::bit_length() - i_len)) &
- ~0UL) >> target_start;
+ // Note: Need "& 0ULL" because bit shift left for Target buffer doesn't roll off
+ uint64_t mask = ((~0ULL << (parameterTraits<uint64_t>::bit_length() - i_len)) &
+ ~0ULL) >> target_start;
// Align the source to the target. Make things signed so we know which way to shift.
int32_t shift = source_start - target_start;
OpenPOWER on IntegriCloud