mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Rename private functions to avoid problems with MSYS stdio.h.
This commit is contained in:
14
jsproperty.c
14
jsproperty.c
@@ -104,16 +104,16 @@ static void freeproperty(js_State *J, js_Object *obj, js_Property *node)
|
||||
--obj->count;
|
||||
}
|
||||
|
||||
static js_Property *unlink(js_State *J, js_Object *obj, js_Property *node, const char *name, js_Property **garbage)
|
||||
static js_Property *unlinkproperty(js_State *J, js_Object *obj, js_Property *node, const char *name, js_Property **garbage)
|
||||
{
|
||||
js_Property *temp, *succ;
|
||||
|
||||
if (node != &sentinel) {
|
||||
int c = strcmp(name, node->name);
|
||||
if (c < 0) {
|
||||
node->left = unlink(J, obj, node->left, name, garbage);
|
||||
node->left = unlinkproperty(J, obj, node->left, name, garbage);
|
||||
} else if (c > 0) {
|
||||
node->right = unlink(J, obj, node->right, name, garbage);
|
||||
node->right = unlinkproperty(J, obj, node->right, name, garbage);
|
||||
} else {
|
||||
if (node->left == &sentinel) {
|
||||
*garbage = node;
|
||||
@@ -126,7 +126,7 @@ static js_Property *unlink(js_State *J, js_Object *obj, js_Property *node, const
|
||||
succ = node->right;
|
||||
while (succ->left != &sentinel)
|
||||
succ = succ->left;
|
||||
succ->right = unlink(J, obj, node->right, succ->name, &temp);
|
||||
succ->right = unlinkproperty(J, obj, node->right, succ->name, &temp);
|
||||
succ->left = node->left;
|
||||
node = succ;
|
||||
}
|
||||
@@ -147,10 +147,10 @@ static js_Property *unlink(js_State *J, js_Object *obj, js_Property *node, const
|
||||
return node;
|
||||
}
|
||||
|
||||
static js_Property *delete(js_State *J, js_Object *obj, js_Property *tree, const char *name)
|
||||
static js_Property *deleteproperty(js_State *J, js_Object *obj, js_Property *tree, const char *name)
|
||||
{
|
||||
js_Property *garbage = NULL;
|
||||
tree = unlink(J, obj, tree, name, &garbage);
|
||||
tree = unlinkproperty(J, obj, tree, name, &garbage);
|
||||
if (garbage != NULL)
|
||||
freeproperty(J, obj, garbage);
|
||||
return tree;
|
||||
@@ -230,7 +230,7 @@ js_Property *jsV_setproperty(js_State *J, js_Object *obj, const char *name)
|
||||
|
||||
void jsV_delproperty(js_State *J, js_Object *obj, const char *name)
|
||||
{
|
||||
obj->properties = delete(J, obj, obj->properties, name);
|
||||
obj->properties = deleteproperty(J, obj, obj->properties, name);
|
||||
}
|
||||
|
||||
/* Flatten hierarchy of enumerable properties into an iterator object */
|
||||
|
||||
Reference in New Issue
Block a user