|
|
@@ -23,10 +23,10 @@ uint8_t* finsh_compile_pc; /* PC */
|
|
|
|
|
|
static int finsh_compile(struct finsh_node* node)
|
|
|
{
|
|
|
- if (node != NULL)
|
|
|
+ if (node != RT_NULL)
|
|
|
{
|
|
|
/* compile child node */
|
|
|
- if (finsh_node_child(node) != NULL)
|
|
|
+ if (finsh_node_child(node) != RT_NULL)
|
|
|
finsh_compile(finsh_node_child(node));
|
|
|
|
|
|
/* compile current node */
|
|
|
@@ -47,7 +47,7 @@ static int finsh_compile(struct finsh_node* node)
|
|
|
struct finsh_sysvar* sysvar;
|
|
|
|
|
|
sysvar = node->id.sysvar;
|
|
|
- if (sysvar != NULL)
|
|
|
+ if (sysvar != RT_NULL)
|
|
|
{
|
|
|
switch (sysvar->type)
|
|
|
{
|
|
|
@@ -113,7 +113,7 @@ static int finsh_compile(struct finsh_node* node)
|
|
|
struct finsh_var* var;
|
|
|
|
|
|
var = node->id.var;
|
|
|
- if (var != NULL)
|
|
|
+ if (var != RT_NULL)
|
|
|
{
|
|
|
switch (var->type)
|
|
|
{
|
|
|
@@ -269,10 +269,10 @@ static int finsh_compile(struct finsh_node* node)
|
|
|
struct finsh_node* sibling;
|
|
|
|
|
|
parameters = 0;
|
|
|
- if (finsh_node_child(node) != NULL)
|
|
|
+ if (finsh_node_child(node) != RT_NULL)
|
|
|
{
|
|
|
sibling = finsh_node_sibling(finsh_node_child(node));
|
|
|
- while (sibling != NULL)
|
|
|
+ while (sibling != RT_NULL)
|
|
|
{
|
|
|
parameters ++;
|
|
|
sibling = finsh_node_sibling(sibling);
|
|
|
@@ -730,7 +730,7 @@ static int finsh_compile(struct finsh_node* node)
|
|
|
}
|
|
|
|
|
|
/* compile sibling node */
|
|
|
- if (finsh_node_sibling(node) != NULL)
|
|
|
+ if (finsh_node_sibling(node) != RT_NULL)
|
|
|
finsh_compile(finsh_node_sibling(node));
|
|
|
}
|
|
|
|
|
|
@@ -739,7 +739,7 @@ static int finsh_compile(struct finsh_node* node)
|
|
|
|
|
|
static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
|
|
|
{
|
|
|
- if (node != NULL)
|
|
|
+ if (node != RT_NULL)
|
|
|
{
|
|
|
/* address & value */
|
|
|
if (node->node_type == FINSH_NODE_SYS_ASSIGN ||
|
|
|
@@ -769,7 +769,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
|
|
|
/* make sure the current node is address or value */
|
|
|
if (node->idtype != FINSH_IDTYPE_SYSCALL) node->idtype |= is_addr;
|
|
|
|
|
|
- if (finsh_node_child(node) != NULL)
|
|
|
+ if (finsh_node_child(node) != RT_NULL)
|
|
|
{
|
|
|
node->data_type = finsh_node_child(node)->data_type;
|
|
|
return 0;
|
|
|
@@ -782,7 +782,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
|
|
|
struct finsh_var* var;
|
|
|
|
|
|
var = node->id.var;
|
|
|
- if (var != NULL)
|
|
|
+ if (var != RT_NULL)
|
|
|
{
|
|
|
switch (var->type)
|
|
|
{
|
|
|
@@ -826,7 +826,7 @@ static int finsh_type_check(struct finsh_node* node, uint8_t is_addr)
|
|
|
struct finsh_sysvar *sysvar;
|
|
|
|
|
|
sysvar = node->id.sysvar;
|
|
|
- if (sysvar != NULL)
|
|
|
+ if (sysvar != RT_NULL)
|
|
|
{
|
|
|
switch (sysvar->type)
|
|
|
{
|
|
|
@@ -898,7 +898,7 @@ int finsh_compiler_run(struct finsh_node* node)
|
|
|
|
|
|
/* compile node */
|
|
|
sibling = node;
|
|
|
- while (sibling != NULL)
|
|
|
+ while (sibling != RT_NULL)
|
|
|
{
|
|
|
struct finsh_node* current_node;
|
|
|
current_node = sibling;
|
|
|
@@ -907,11 +907,11 @@ int finsh_compiler_run(struct finsh_node* node)
|
|
|
sibling = current_node->sibling;
|
|
|
|
|
|
/* clean sibling node */
|
|
|
- current_node->sibling = NULL;
|
|
|
+ current_node->sibling = RT_NULL;
|
|
|
finsh_compile(current_node);
|
|
|
|
|
|
/* pop current value */
|
|
|
- if (sibling != NULL) finsh_code_byte(FINSH_OP_POP);
|
|
|
+ if (sibling != RT_NULL) finsh_code_byte(FINSH_OP_POP);
|
|
|
}
|
|
|
|
|
|
return 0;
|