elm_atspi_bridge: Use narrower index types 36/290036/1 accepted/tizen/unified/20230321.123225
authorArtur Świgoń <a.swigon@samsung.com>
Fri, 17 Mar 2023 11:39:16 +0000 (12:39 +0100)
committerArtur Świgoń <a.swigon@samsung.com>
Fri, 17 Mar 2023 11:42:11 +0000 (12:42 +0100)
This patch changes `long` to `int` for indices. They either come from other
`int`-typed variables or from the literal value zero, and are further passed
to functions which expect an `int` parameter (possibly unsigned, but values
nearing 2^31 are purely theoretical, so it should never be a problem).

Change-Id: I5b110f308cd63b692b3f616f2d999e5e6b56cb09

src/lib/elementary/elm_atspi_bridge.c

index 05b5b2b..f1a7d58 100644 (file)
@@ -4161,13 +4161,13 @@ _collection_match_attributes_lookup(Eo *obj, struct collection_match_rule *rule)
 static int
 _collection_sort_order_canonical(struct collection_match_rule *rule, Eina_List **ls,
                       int count, int max,
-                      Eo *obj, long index, Eina_Bool flag,
+                      Eo *obj, int index, Eina_Bool flag,
                       Eo *pobj, Eina_Bool recurse, Eina_Bool traverse)
 {
    int i = index;
    Eina_List *children;
    children = efl_access_object_access_children_get(obj);
-   long acount = eina_list_count(children);
+   int acount = eina_list_count(children);
    Eina_Bool prev = pobj ? EINA_TRUE : EINA_FALSE;
 
    for (; i < acount && (max == 0 || count < max); i++)
@@ -4206,7 +4206,7 @@ _collection_sort_order_reverse_canonical(struct collection_match_rule *rule, Ein
                       int count, int max, Eo *obj, Eina_Bool flag, Eo *pobj)
 {
   Eo *nextobj, *parent;
-  long indexinparent;
+  int indexinparent;
   Eina_List *children;
 
   /* This breaks us out of the recursion. */
@@ -4306,7 +4306,7 @@ _collection_inorder(Eo *collection, struct collection_match_rule *rule, Eina_Lis
 
 static int
 _collection_query(struct collection_match_rule *rule, AtspiCollectionSortOrder sortby,
-                         Eina_List **list, int count, int max, Eo *obj, long index,
+                         Eina_List **list, int count, int max, Eo *obj, int index,
                          Eina_Bool flag, Eo *pobj, Eina_Bool recurse, Eina_Bool traverse)
 {
    switch (sortby)