Skip to content

Commit

Permalink
Fix: Cast shift operand to uint to comply with Go's type requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
takaeda committed Aug 2, 2024
1 parent 191d52f commit 71abb02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alaw.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func EncodeAlawFrame(frame int16) uint8 {
compressedByte = frame >> 4
if compressedByte > 15 {
seg = int16(12 - bits.LeadingZeros16(uint16(compressedByte)))
compressedByte >>= seg - 1
compressedByte >>= uint(seg - 1)
compressedByte -= 16
compressedByte += seg << 4
}
Expand Down
2 changes: 1 addition & 1 deletion ulaw.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func EncodeUlawFrame(frame int16) uint8 {
frame = ulawClip
}
seg = int16(16 - bits.LeadingZeros16(uint16(frame>>5)))
lowNibble = 0x000F - ((frame >> (seg)) & 0x000F)
lowNibble = 0x000F - ((frame >> uint(seg)) & 0x000F)
return uint8(sign | ((8 - seg) << 4) | lowNibble)
}

Expand Down

0 comments on commit 71abb02

Please sign in to comment.