@@ -2672,7 +2672,7 @@ ndb_filter_find_elements(struct ndb_filter *filter, enum ndb_filter_fieldtype ty
2672
2672
return NULL ;
2673
2673
}
2674
2674
2675
- int ndb_filter_is_subset_of (struct ndb_filter * a , struct ndb_filter * b )
2675
+ int ndb_filter_is_subset_of (const struct ndb_filter * a , const struct ndb_filter * b )
2676
2676
{
2677
2677
int i ;
2678
2678
struct ndb_filter_elements * b_field , * a_field ;
@@ -2700,20 +2700,22 @@ int ndb_filter_is_subset_of(struct ndb_filter *a, struct ndb_filter *b)
2700
2700
// A is a subset of B because `k:1` and `a:b` both exist in A
2701
2701
2702
2702
for (i = 0 ; i < b -> num_elements ; i ++ ) {
2703
- b_field = ndb_filter_get_elements (b , i );
2704
- a_field = ndb_filter_find_elements (a , b_field -> field .type );
2703
+ b_field = ndb_filter_get_elements ((struct ndb_filter * )b , i );
2704
+ a_field = ndb_filter_find_elements ((struct ndb_filter * )a ,
2705
+ b_field -> field .type );
2705
2706
2706
2707
if (a_field == NULL )
2707
2708
return 0 ;
2708
2709
2709
- if (!ndb_filter_field_eq (a , a_field , b , b_field ))
2710
+ if (!ndb_filter_field_eq ((struct ndb_filter * )a , a_field ,
2711
+ (struct ndb_filter * )b , b_field ))
2710
2712
return 0 ;
2711
2713
}
2712
2714
2713
2715
return 1 ;
2714
2716
}
2715
2717
2716
- int ndb_filter_eq (struct ndb_filter * a , struct ndb_filter * b )
2718
+ int ndb_filter_eq (const struct ndb_filter * a , const struct ndb_filter * b )
2717
2719
{
2718
2720
int i ;
2719
2721
struct ndb_filter_elements * a_els , * b_els ;
@@ -2722,13 +2724,15 @@ int ndb_filter_eq(struct ndb_filter *a, struct ndb_filter *b)
2722
2724
return 0 ;
2723
2725
2724
2726
for (i = 0 ; i < a -> num_elements ; i ++ ) {
2725
- a_els = ndb_filter_get_elements (a , i );
2726
- b_els = ndb_filter_find_elements (b , a_els -> field .type );
2727
+ a_els = ndb_filter_get_elements ((struct ndb_filter * )a , i );
2728
+ b_els = ndb_filter_find_elements ((struct ndb_filter * )b ,
2729
+ a_els -> field .type );
2727
2730
2728
2731
if (b_els == NULL )
2729
2732
return 0 ;
2730
2733
2731
- if (!ndb_filter_field_eq (a , a_els , b , b_els ))
2734
+ if (!ndb_filter_field_eq ((struct ndb_filter * )a , a_els ,
2735
+ (struct ndb_filter * )b , b_els ))
2732
2736
return 0 ;
2733
2737
}
2734
2738
0 commit comments