style fixes
This commit is contained in:
parent
04d2369c2e
commit
a2f628d240
24
src/bool.c
24
src/bool.c
|
@ -10,17 +10,20 @@
|
|||
#include "picrin/blob.h"
|
||||
#include "picrin/string.h"
|
||||
|
||||
bool pic_string_equal_p(struct pic_string *str1, struct pic_string *str2)
|
||||
bool
|
||||
pic_string_equal_p(struct pic_string *str1, struct pic_string *str2)
|
||||
{
|
||||
return pic_strcmp(str1, str2) == 0;
|
||||
}
|
||||
|
||||
bool pic_blob_equal_p(struct pic_blob *blob1, struct pic_blob *blob2)
|
||||
bool
|
||||
pic_blob_equal_p(struct pic_blob *blob1, struct pic_blob *blob2)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (blob1->len != blob2->len) {
|
||||
return false;
|
||||
}
|
||||
size_t i;
|
||||
for (i = 0; i < blob1->len; ++i) {
|
||||
if (blob1->data[i] != blob2->data[i])
|
||||
return false;
|
||||
|
@ -28,9 +31,13 @@ bool pic_blob_equal_p(struct pic_blob *blob1, struct pic_blob *blob2)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
static bool
|
||||
pic_internal_equal_p(pic_state *pic, pic_value x, pic_value y, size_t depth, xhash *ht)
|
||||
{
|
||||
xh_entry *e;
|
||||
enum pic_tt type;
|
||||
pic_value local = pic_nil_value();
|
||||
size_t rapid_count = 0;
|
||||
|
||||
if (depth > 10) {
|
||||
if (depth > 200) {
|
||||
|
@ -42,7 +49,7 @@ pic_internal_equal_p(pic_state *pic, pic_value x, pic_value y, size_t depth, xha
|
|||
switch (pic_type(x)) {
|
||||
case PIC_TT_PAIR:
|
||||
case PIC_TT_VECTOR: {
|
||||
xh_entry *e = xh_get(ht, pic_obj_ptr(x));
|
||||
e = xh_get(ht, pic_obj_ptr(x));
|
||||
if (e) {
|
||||
/* `x' was seen already. */
|
||||
return true;
|
||||
|
@ -50,14 +57,11 @@ pic_internal_equal_p(pic_state *pic, pic_value x, pic_value y, size_t depth, xha
|
|||
xh_put(ht, pic_obj_ptr(x), NULL);
|
||||
}
|
||||
}
|
||||
default:;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
enum pic_tt type;
|
||||
pic_value local = pic_nil_value();
|
||||
size_t rapid_count = 0;
|
||||
|
||||
LOOP:
|
||||
|
||||
if (pic_eqv_p(x, y))
|
||||
|
|
Loading…
Reference in New Issue