fix bit shift errors when compliing on arm - take 2
This commit is contained in:
parent
e7988dc64b
commit
56c23505a3
1 changed files with 5 additions and 5 deletions
|
@ -124,9 +124,9 @@ func appendContentText(content string) (int, Burst) {
|
||||||
out := make(Burst, 0)
|
out := make(Burst, 0)
|
||||||
debugf("appendContentText: %s", content)
|
debugf("appendContentText: %s", content)
|
||||||
|
|
||||||
bitpos := uint32(0)
|
bitpos := 0
|
||||||
word := uint32(0)
|
word := uint32(0)
|
||||||
leftbits := uint32(0)
|
leftbits := 0
|
||||||
pos := 0
|
pos := 0
|
||||||
|
|
||||||
// walk through characters in message
|
// walk through characters in message
|
||||||
|
@ -146,7 +146,7 @@ func appendContentText(content string) (int, Burst) {
|
||||||
debugf(" bits of char won't fit since bitpos is %d, got %d bits free, leaving %d bits in next word", bitpos, space, leftbits)
|
debugf(" bits of char won't fit since bitpos is %d, got %d bits free, leaving %d bits in next word", bitpos, space, leftbits)
|
||||||
}
|
}
|
||||||
|
|
||||||
word |= (uint32(char)<<31 - 7 - bitpos)
|
word |= (uint32(char) << uint(31-7-bitpos))
|
||||||
|
|
||||||
bitpos += 7
|
bitpos += 7
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ func appendContentText(content string) (int, Burst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if leftbits > 0 {
|
if leftbits > 0 {
|
||||||
word |= (uint32(char) << int(31-leftbits))
|
word |= (uint32(char) << uint(31-leftbits))
|
||||||
bitpos = leftbits
|
bitpos = leftbits
|
||||||
leftbits = 0
|
leftbits = 0
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ func appendContentText(content string) (int, Burst) {
|
||||||
step := 0
|
step := 0
|
||||||
for bitpos < 20 {
|
for bitpos < 20 {
|
||||||
if step == 2 {
|
if step == 2 {
|
||||||
word |= (1 << int(30-bitpos))
|
word |= (1 << uint(30-bitpos))
|
||||||
}
|
}
|
||||||
bitpos++
|
bitpos++
|
||||||
step++
|
step++
|
||||||
|
|
Loading…
Add table
Reference in a new issue