diff options
| author | ruki <[email protected]> | 2022-04-07 22:55:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-04-07 22:55:17 +0800 |
| commit | 3c562917883423cbf50c94aecd2dc790b6bbf988 (patch) | |
| tree | a7dd02e7a06a64ac58a3f0c6f78a6e4ebdfda6cf /xmake/core/base/bytes.lua | |
| parent | d9c1d3f8c9eaf1a92f7ab4d720491b5f239c5535 (diff) | |
impl stream.send
Diffstat (limited to 'xmake/core/base/bytes.lua')
| -rw-r--r-- | xmake/core/base/bytes.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/base/bytes.lua b/xmake/core/base/bytes.lua index f26301492..48a93cde8 100644 --- a/xmake/core/base/bytes.lua +++ b/xmake/core/base/bytes.lua @@ -421,7 +421,7 @@ end -- set uint8 value function _instance:u8_set(offset, value) - self[offset] = value + self[offset] = bit.band(value, 0xff) return self end @@ -438,7 +438,7 @@ end -- set uint16 little-endian value function _instance:u16le_set(offset, value) - self[offset + 1] = bit.rshift(value, 8) + self[offset + 1] = bit.band(bit.rshift(value, 8), 0xff) self[offset] = bit.band(value, 0xff) return self end @@ -450,7 +450,7 @@ end -- set uint16 big-endian value function _instance:u16be_set(offset, value) - self[offset] = bit.rshift(value, 8) + self[offset] = bit.band(bit.rshift(value, 8), 0xff) self[offset + 1] = bit.band(value, 0xff) return self end |
