mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use rpn_isKnown wrapper outside rpn.cpp
This commit is contained in:
@@ -367,7 +367,7 @@ static void writerpn(uint8_t *rpnexpr, uint32_t *rpnptr, uint8_t *rpn,
|
|||||||
static struct Patch *allocpatch(uint32_t type, struct Expression const *expr, uint32_t ofs)
|
static struct Patch *allocpatch(uint32_t type, struct Expression const *expr, uint32_t ofs)
|
||||||
{
|
{
|
||||||
struct Patch *patch = (struct Patch *)malloc(sizeof(*patch));
|
struct Patch *patch = (struct Patch *)malloc(sizeof(*patch));
|
||||||
uint32_t rpnSize = expr->isKnown ? 5 : expr->rpnPatchSize;
|
uint32_t rpnSize = rpn_isKnown(expr) ? 5 : expr->rpnPatchSize;
|
||||||
struct FileStackNode *node = fstk_GetFileStack();
|
struct FileStackNode *node = fstk_GetFileStack();
|
||||||
|
|
||||||
if (!patch)
|
if (!patch)
|
||||||
@@ -386,7 +386,7 @@ static struct Patch *allocpatch(uint32_t type, struct Expression const *expr, ui
|
|||||||
patch->pcOffset = sect_GetSymbolOffset();
|
patch->pcOffset = sect_GetSymbolOffset();
|
||||||
|
|
||||||
// If the rpnSize's value is known, output a constant RPN rpnSize directly
|
// If the rpnSize's value is known, output a constant RPN rpnSize directly
|
||||||
if (expr->isKnown) {
|
if (rpn_isKnown(expr)) {
|
||||||
patch->rpnSize = rpnSize;
|
patch->rpnSize = rpnSize;
|
||||||
// Make sure to update `rpnSize` above if modifying this!
|
// Make sure to update `rpnSize` above if modifying this!
|
||||||
patch->rpn[0] = RPN_CONST;
|
patch->rpn[0] = RPN_CONST;
|
||||||
|
|||||||
Reference in New Issue
Block a user