-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from Shopify/pz-immediate-raw
Implement OP_WRITE_RAW on the instructions buffer
- Loading branch information
Showing
7 changed files
with
142 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef LIQUID_INTUTIL_H | ||
#define LIQUID_INTUTIL_H | ||
|
||
#include <stdint.h> | ||
|
||
static inline unsigned int bytes_to_uint24(const uint8_t *bytes) | ||
{ | ||
return (bytes[0] << 16) | (bytes[1] << 8) | bytes[2]; | ||
} | ||
|
||
static inline void uint24_to_bytes(unsigned int num, uint8_t *bytes) | ||
{ | ||
assert(num < (1 << 24)); | ||
|
||
bytes[0] = num >> 16; | ||
bytes[1] = num >> 8; | ||
bytes[2] = num; | ||
|
||
assert(bytes_to_uint24(bytes) == num); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters